src/Entity/RecentlyProduct.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table(
  6. * uniqueConstraints={@ORM\UniqueConstraint(name="combination", columns={"hash", "product_id"})}
  7. * )
  8. * @ORM\Entity(repositoryClass="App\Repository\RecentlyProductRepository")
  9. */
  10. class RecentlyProduct
  11. {
  12. /**
  13. * @ORM\Id()
  14. * @ORM\GeneratedValue()
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=100)
  20. */
  21. private $hash;
  22. /**
  23. * @ORM\ManyToOne(targetEntity="App\Entity\Product", cascade={"MERGE"} )
  24. * @ORM\JoinColumn(nullable=false)
  25. */
  26. private $product;
  27. /**
  28. * @ORM\Column(type="datetime")
  29. */
  30. private $createts;
  31. /**
  32. * @ORM\ManyToOne(targetEntity="App\Entity\Client", inversedBy="recentlyProducts")
  33. */
  34. private $client;
  35. public function getId(): ?int
  36. {
  37. return $this->id;
  38. }
  39. public function getHash(): ?string
  40. {
  41. return $this->hash;
  42. }
  43. public function setHash(string $hash): self
  44. {
  45. $this->hash = $hash;
  46. return $this;
  47. }
  48. public function getProduct(): ?Product
  49. {
  50. return $this->product;
  51. }
  52. public function setProduct(?Product $product): self
  53. {
  54. $this->product = $product;
  55. return $this;
  56. }
  57. public function getCreatets(): ?\DateTimeInterface
  58. {
  59. return $this->createts;
  60. }
  61. public function setCreatets(\DateTimeInterface $createts): self
  62. {
  63. $this->createts = $createts;
  64. return $this;
  65. }
  66. public function getClient(): ?Client
  67. {
  68. return $this->client;
  69. }
  70. public function setClient(?Client $client): self
  71. {
  72. $this->client = $client;
  73. return $this;
  74. }
  75. }