<?php
namespace App\Entity\Gos;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\Gos\ProductReleaseRepository")
* @ORM\Table(name="product_release",
* uniqueConstraints={
* @ORM\UniqueConstraint(name="accessIdKey_unique",
* columns={"access_id_key", "date_release"})
* }
* )
* @ORM\HasLifecycleCallbacks
*/
class ProductRelease
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=191)
*/
private $accessIdKey;
/**
* @ORM\Column(type="datetime")
*/
private $dateRelease;
/**
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isActive;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $releaseNumber;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $flippingBookUrl;
/**
* @ORM\ManyToOne(targetEntity="ProductAssociation", inversedBy="productRelease")
* @ORM\JoinColumn()
*/
private $productAssociation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $flippingBook;
/**
* @ORM\OneToMany(targetEntity=ProductReleaseNotify::class, mappedBy="productRelease")
*/
private $productReleaseNotifies;
public function __construct()
{
$this->productReleaseNotifies = new ArrayCollection();
}
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string)$this->accessIdKey;
}
/* ****************************** GETTERS & SETTERS ****************************** */
public function getId(): ?int
{
return $this->id;
}
public function getDateRelease(): ?\DateTimeInterface
{
return $this->dateRelease;
}
public function setDateRelease(\DateTimeInterface $dateRelease): self
{
$this->dateRelease = $dateRelease;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getProductAssociation(): ?ProductAssociation
{
return $this->productAssociation;
}
public function setProductAssociation(?ProductAssociation $productAssociation): self
{
$this->productAssociation = $productAssociation;
return $this;
}
public function getAccessIdKey(): ?string
{
return $this->accessIdKey;
}
public function setAccessIdKey(string $accessIdKey): self
{
$this->accessIdKey = $accessIdKey;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getIsActive()
{
return $this->isActive;
}
public function setIsActive($isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getFlippingBookUrl()
{
return $this->flippingBookUrl;
}
public function setFlippingBookUrl($url): self
{
$this->flippingBookUrl = $url;
return $this;
}
public function getReleaseNumber()
{
return $this->releaseNumber;
}
public function setReleaseNumber($releaseNumber): self
{
$this->releaseNumber = $releaseNumber;
return $this;
}
public function getFlippingBook()
{
return $this->flippingBook;
}
public function setFlippingBook(?string $flippingBook): self
{
$this->flippingBook = $flippingBook;
return $this;
}
/**
* @return Collection|ProductReleaseNotify[]
*/
public function getProductReleaseNotifies(): Collection
{
return $this->productReleaseNotifies;
}
public function addProductReleaseNotify(ProductReleaseNotify $productReleaseNotify): self
{
if (!$this->productReleaseNotifies->contains($productReleaseNotify)) {
$this->productReleaseNotifies[] = $productReleaseNotify;
$productReleaseNotify->setProductRelease($this);
}
return $this;
}
public function removeProductReleaseNotify(ProductReleaseNotify $productReleaseNotify): self
{
if ($this->productReleaseNotifies->contains($productReleaseNotify)) {
$this->productReleaseNotifies->removeElement($productReleaseNotify);
// set the owning side to null (unless already changed)
if ($productReleaseNotify->getProductRelease() === $this) {
$productReleaseNotify->setProductRelease(null);
}
}
return $this;
}
}