src/Entity/ProductAssociated.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * ProductsXsell
  6. *
  7. * @ORM\Table(name="products_xsell", indexes={@ORM\Index(name="idx1_products_xsell", columns={"products_id"})})
  8. * @ORM\Entity(repositoryClass="App\Repository\ProductAssociatedRepository")
  9. */
  10. class ProductAssociated
  11. {
  12. /**
  13. * @var int
  14. *
  15. * @ORM\Column(name="id", type="integer", nullable=false)
  16. * @ORM\Id
  17. * @ORM\GeneratedValue(strategy="IDENTITY")
  18. */
  19. private $id = '0';
  20. /** *
  21. * @ORM\ManyToOne(targetEntity="App\Entity\Product")
  22. * @ORM\JoinColumn(name="products_id", referencedColumnName="products_id")
  23. */
  24. private $product;
  25. /** *
  26. * @ORM\ManyToOne(targetEntity="App\Entity\Product")
  27. * @ORM\JoinColumn(name="xsell_id", referencedColumnName="products_id")
  28. */
  29. private $associated;
  30. /**
  31. * @var ?int
  32. *
  33. * @ORM\Column(name="sort_order", type="integer", nullable=false, options={"default"="1","unsigned"=true})
  34. */
  35. private $sortOrder;
  36. public function getId(): int {
  37. return $this->id;
  38. }
  39. public function getProduct() {
  40. return $this->product;
  41. }
  42. public function getAssociated() {
  43. return $this->associated;
  44. }
  45. public function getSortOrder(): ?int {
  46. return is_null($this->sortOrder) ? 0 : $this->sortOrder;
  47. }
  48. public function setProduct($product): void {
  49. $this->product = $product;
  50. }
  51. public function setAssociated($associated): void {
  52. $this->associated = $associated;
  53. }
  54. public function setSortOrder(int $sortOrder): void {
  55. $this->sortOrder = $sortOrder;
  56. }
  57. }