src/ProductBundle/Entity/ProductHasAttribute.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\ProductBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table(name="product_has_attribute")
  6. * @ORM\Entity(repositoryClass="App\ProductBundle\Repository\ProductHasAttributeRepository")
  7. */
  8. class ProductHasAttribute
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\Column(name="id", type="integer")
  13. * @ORM\GeneratedValue(strategy="AUTO")
  14. */
  15. private ?int $id = null;
  16. /**
  17. * @ORM\ManyToOne(targetEntity="Product", inversedBy="productHasAttributes")
  18. */
  19. private ?Product $product = null;
  20. /**
  21. * @ORM\ManyToOne(targetEntity="Attribute", inversedBy="productHasAttributes")
  22. */
  23. private ?Attribute $attribute = null;
  24. /**
  25. * @ORM\ManyToOne(targetEntity="SubAttribute", inversedBy="productHasAttributes")
  26. */
  27. private ?SubAttribute $subAttribute = null;
  28. /**
  29. * @ORM\Column(name="other_value", type="string", length=255, nullable=true)
  30. */
  31. private ?string $otherValue = null;
  32. public function __clone()
  33. {
  34. if ($this->id) {
  35. $this->id = null;
  36. }
  37. }
  38. public function getId(): ?int
  39. {
  40. return $this->id;
  41. }
  42. public function getOtherValue(): ?string
  43. {
  44. return $this->otherValue;
  45. }
  46. public function setOtherValue(?string $otherValue): self
  47. {
  48. $this->otherValue = $otherValue;
  49. return $this;
  50. }
  51. public function getProduct(): ?Product
  52. {
  53. return $this->product;
  54. }
  55. public function setProduct(?Product $product): self
  56. {
  57. $this->product = $product;
  58. return $this;
  59. }
  60. public function getAttribute(): ?Attribute
  61. {
  62. return $this->attribute;
  63. }
  64. public function setAttribute(?Attribute $attribute): self
  65. {
  66. $this->attribute = $attribute;
  67. return $this;
  68. }
  69. public function getSubAttribute(): ?SubAttribute
  70. {
  71. return $this->subAttribute;
  72. }
  73. public function setSubAttribute(?SubAttribute $subAttribute): self
  74. {
  75. $this->subAttribute = $subAttribute;
  76. return $this;
  77. }
  78. }