src/Entity/ProductModelAttribute.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
  5. use App\Entity\ProductModel;
  6. /**
  7. * ProductsAttributes
  8. *
  9. * @ORM\Table(name="products_models_attributes")
  10. * @ORM\Entity
  11. * @ORM\HasLifecycleCallbacks()
  12. */
  13. class ProductModelAttribute
  14. {
  15. /**
  16. * @var int
  17. *
  18. * @ORM\Column(name="id", type="integer", nullable=false)
  19. * @ORM\Id
  20. * @ORM\GeneratedValue(strategy="IDENTITY")
  21. */
  22. private $id;
  23. /**
  24. * @var ProductModel
  25. *
  26. * @ORM\ManyToOne(targetEntity="App\Entity\ProductModel", inversedBy="attributes", cascade={"persist"})
  27. * @ORM\JoinColumn(name="products_models_id", referencedColumnName="id", onDelete="CASCADE")
  28. */
  29. private $productModel;
  30. /**
  31. * @var Attribute
  32. *
  33. * @ORM\ManyToOne(targetEntity="App\Entity\Attribute")
  34. * @ORM\JoinColumn(name="attributes_id", referencedColumnName="attributes_id", onDelete="CASCADE")
  35. */
  36. private $attribute;
  37. /**
  38. * @var ?string
  39. *
  40. * @ORM\Column(name="attributes_value", type="string", length=255, nullable=true)
  41. */
  42. private $value;
  43. public function getId(): int {
  44. return $this->id;
  45. }
  46. public function getProductModel(): ProductModel {
  47. return $this->productModel;
  48. }
  49. public function getAttribute(): Attribute {
  50. return $this->attribute;
  51. }
  52. public function getValue(): ?string {
  53. return $this->value;
  54. }
  55. public function setId(int $id): void {
  56. $this->id = $id;
  57. }
  58. public function setAttribute(Attribute $attribute): void {
  59. $this->attribute = $attribute;
  60. }
  61. public function setValue(?string $value): void {
  62. $this->value = $value;
  63. }
  64. public function setProductModel(ProductModel $productModel): void {
  65. $this->productModel = $productModel;
  66. }
  67. }