src/Entity/Application/AppProduct.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Application;
  3. use App\Entity\Product;
  4. use App\Entity\Dealer;
  5. use App\Repository\Application\AppProductRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=AppProductRepository::class)
  9. */
  10. class AppProduct
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\OneToOne(targetEntity=Product::class, cascade={"persist"})
  20. * @ORM\JoinColumn(nullable=false)
  21. */
  22. private $product;
  23. /**
  24. * @ORM\ManyToOne(targetEntity=Category::class)
  25. */
  26. private $category;
  27. /**
  28. * @ORM\ManyToOne(targetEntity=Dealer::class, inversedBy="appProducts")
  29. */
  30. private $dealer;
  31. public function getId(): ?int
  32. {
  33. return $this->id;
  34. }
  35. public function getProduct(): ?Product
  36. {
  37. return $this->product;
  38. }
  39. public function setProduct(Product $product): self
  40. {
  41. $this->product = $product;
  42. return $this;
  43. }
  44. public function getCategory(): ?Category
  45. {
  46. return $this->category;
  47. }
  48. public function setCategory(?Category $category): self
  49. {
  50. $this->category = $category;
  51. return $this;
  52. }
  53. /**
  54. * Get Dealer
  55. *
  56. * @return mixed
  57. */
  58. public function getDealer()
  59. {
  60. return $this->dealer;
  61. }
  62. /**
  63. * Set Dealer
  64. *
  65. * @param mixed $dealer
  66. */
  67. public function setDealer( $dealer )
  68. {
  69. $this->dealer = $dealer;
  70. }
  71. }