src/Entity/Gos/ProductRelease.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\Gos\ProductReleaseRepository")
  8.  * @ORM\Table(name="product_release",
  9.  *    uniqueConstraints={
  10.  *        @ORM\UniqueConstraint(name="accessIdKey_unique",
  11.  *            columns={"access_id_key", "date_release"})
  12.  *    }
  13.  * )
  14.  * @ORM\HasLifecycleCallbacks
  15.  */
  16. class ProductRelease
  17. {
  18.     /**
  19.      * @ORM\Id()
  20.      * @ORM\GeneratedValue()
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="string", length=191)
  26.      */
  27.     private $accessIdKey;
  28.     /**
  29.      * @ORM\Column(type="datetime")
  30.      */
  31.     private $dateRelease;
  32.     /**
  33.      * @ORM\Column(name="description", type="text", nullable=true)
  34.      */
  35.     private $description;
  36.     /**
  37.      * @ORM\Column(type="datetime")
  38.      */
  39.     private $createdAt;
  40.     /**
  41.      * @ORM\Column(type="datetime", nullable=true)
  42.      */
  43.     private $updatedAt;
  44.     /**
  45.      * @ORM\Column(type="boolean", nullable=true)
  46.      */
  47.     private $isActive;
  48.     /**
  49.      * @ORM\Column(type="integer", nullable=true)
  50.      */
  51.     private $releaseNumber;
  52.     /**
  53.      * @ORM\Column(type="text", nullable=true)
  54.      */
  55.     private $flippingBookUrl;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="ProductAssociation", inversedBy="productRelease")
  58.      * @ORM\JoinColumn()
  59.      */
  60.     private $productAssociation;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $flippingBook;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity=ProductReleaseNotify::class, mappedBy="productRelease")
  67.      */
  68.     private $productReleaseNotifies;
  69.     public function __construct()
  70.     {
  71.         $this->productReleaseNotifies = new ArrayCollection();
  72.     }
  73.     /** @ORM\PrePersist() */
  74.     public function prePersist()
  75.     {
  76.         $this->createdAt = new \DateTime();
  77.     }
  78.     /** @ORM\PreUpdate() */
  79.     public function preUpdate()
  80.     {
  81.         $this->updatedAt = new \DateTime();
  82.     }
  83.     public function __toString()
  84.     {
  85.         return (string)$this->accessIdKey;
  86.     }
  87.     /* ****************************** GETTERS & SETTERS ******************************  */
  88.     public function getId(): ?int
  89.     {
  90.         return $this->id;
  91.     }
  92.     public function getDateRelease(): ?\DateTimeInterface
  93.     {
  94.         return $this->dateRelease;
  95.     }
  96.     public function setDateRelease(\DateTimeInterface $dateRelease): self
  97.     {
  98.         $this->dateRelease $dateRelease;
  99.         return $this;
  100.     }
  101.     public function getCreatedAt(): ?\DateTimeInterface
  102.     {
  103.         return $this->createdAt;
  104.     }
  105.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  106.     {
  107.         $this->createdAt $createdAt;
  108.         return $this;
  109.     }
  110.     public function getUpdatedAt(): ?\DateTimeInterface
  111.     {
  112.         return $this->updatedAt;
  113.     }
  114.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  115.     {
  116.         $this->updatedAt $updatedAt;
  117.         return $this;
  118.     }
  119.     public function getProductAssociation(): ?ProductAssociation
  120.     {
  121.         return $this->productAssociation;
  122.     }
  123.     public function setProductAssociation(?ProductAssociation $productAssociation): self
  124.     {
  125.         $this->productAssociation $productAssociation;
  126.         return $this;
  127.     }
  128.     public function getAccessIdKey(): ?string
  129.     {
  130.         return $this->accessIdKey;
  131.     }
  132.     public function setAccessIdKey(string $accessIdKey): self
  133.     {
  134.         $this->accessIdKey $accessIdKey;
  135.         return $this;
  136.     }
  137.     public function getDescription(): ?string
  138.     {
  139.         return $this->description;
  140.     }
  141.     public function setDescription(?string $description): self
  142.     {
  143.         $this->description $description;
  144.         return $this;
  145.     }
  146.     public function getIsActive()
  147.     {
  148.         return $this->isActive;
  149.     }
  150.     public function setIsActive($isActive): self
  151.     {
  152.         $this->isActive $isActive;
  153.         return $this;
  154.     }
  155.     public function getFlippingBookUrl()
  156.     {
  157.         return $this->flippingBookUrl;
  158.     }
  159.     public function setFlippingBookUrl($url): self
  160.     {
  161.         $this->flippingBookUrl $url;
  162.         return $this;
  163.     }
  164.     public function getReleaseNumber()
  165.     {
  166.         return $this->releaseNumber;
  167.     }
  168.     public function setReleaseNumber($releaseNumber): self
  169.     {
  170.         $this->releaseNumber $releaseNumber;
  171.         return $this;
  172.     }
  173.     public function getFlippingBook()
  174.     {
  175.         return $this->flippingBook;
  176.     }
  177.     public function setFlippingBook(?string $flippingBook): self
  178.     {
  179.         $this->flippingBook $flippingBook;
  180.         return $this;
  181.     }
  182.     /**
  183.      * @return Collection|ProductReleaseNotify[]
  184.      */
  185.     public function getProductReleaseNotifies(): Collection
  186.     {
  187.         return $this->productReleaseNotifies;
  188.     }
  189.     public function addProductReleaseNotify(ProductReleaseNotify $productReleaseNotify): self
  190.     {
  191.         if (!$this->productReleaseNotifies->contains($productReleaseNotify)) {
  192.             $this->productReleaseNotifies[] = $productReleaseNotify;
  193.             $productReleaseNotify->setProductRelease($this);
  194.         }
  195.         return $this;
  196.     }
  197.     public function removeProductReleaseNotify(ProductReleaseNotify $productReleaseNotify): self
  198.     {
  199.         if ($this->productReleaseNotifies->contains($productReleaseNotify)) {
  200.             $this->productReleaseNotifies->removeElement($productReleaseNotify);
  201.             // set the owning side to null (unless already changed)
  202.             if ($productReleaseNotify->getProductRelease() === $this) {
  203.                 $productReleaseNotify->setProductRelease(null);
  204.             }
  205.         }
  206.         return $this;
  207.     }
  208. }