You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 line
1.2KB

  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\ShopBundle\Context\ProductPropertyInterface;
  5. use Lc\ShopBundle\Context\SortableInterface;
  6. /**
  7. * @ORM\MappedSuperclass()
  8. */
  9. abstract class Product extends AbstractEntity implements SortableInterface, ProductPropertyInterface
  10. {
  11. use SortableTrait;
  12. use ProductPropertyTrait;
  13. /**
  14. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface", inversedBy="products")
  15. * @ORM\JoinColumn(nullable=false)
  16. */
  17. protected $productFamily;
  18. /**
  19. * @ORM\Column(type="string", length=255, nullable=true)
  20. */
  21. protected $title;
  22. public function getProductFamily(): ?ProductFamily
  23. {
  24. return $this->productFamily;
  25. }
  26. public function setProductFamily(?ProductFamily $productFamily): self
  27. {
  28. $this->productFamily = $productFamily;
  29. return $this;
  30. }
  31. public function getTitle(): ?string
  32. {
  33. return $this->title;
  34. }
  35. public function setTitle(?string $title): self
  36. {
  37. $this->title = $title;
  38. return $this;
  39. }
  40. }