<?php
namespace App\Entity\Gos;
use App\Repository\Gos\ProductReleaseNotifyRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=ProductReleaseNotifyRepository::class)
* @UniqueEntity(fields={"productRelease", "user"})
* @ORM\HasLifecycleCallbacks()
*/
class ProductReleaseNotify
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=ProductRelease::class, inversedBy="productReleaseNotifies")
* @ORM\JoinColumn(nullable=false)
*/
private $productRelease;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="productReleaseNotifies")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $sendFirst = false;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $mailSentAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $sentFailureReason;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $smsSentAt;
/**
* @ORM\Column(type="boolean", options={"default": true})
*/
private $sendPaperReleaseNotify = true;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $mailAboutPaperReleaseSentAt;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/** @ORM\PrePersist() */
public function prePersist()
{
$this->createdAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getProductRelease(): ?ProductRelease
{
return $this->productRelease;
}
public function setProductRelease(?ProductRelease $productRelease): self
{
$this->productRelease = $productRelease;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getSendFirst(): ?bool
{
return $this->sendFirst;
}
public function setSendFirst(bool $sendFirst): self
{
$this->sendFirst = $sendFirst;
return $this;
}
public function getMailSentAt(): ?\DateTimeInterface
{
return $this->mailSentAt;
}
public function setMailSentAt(?\DateTimeInterface $mailSentAt): self
{
$this->mailSentAt = $mailSentAt;
return $this;
}
public function getSentFailureReason(): ?string
{
return $this->sentFailureReason;
}
public function setSentFailureReason(?string $sentFailureReason): self
{
$this->sentFailureReason = $sentFailureReason;
return $this;
}
public function getSmsSentAt(): ?\DateTimeInterface
{
return $this->smsSentAt;
}
public function setSmsSentAt(?\DateTimeInterface $smsSentAt): self
{
$this->smsSentAt = $smsSentAt;
return $this;
}
public function getSendPaperReleaseNotify(): ?bool
{
return $this->sendPaperReleaseNotify;
}
public function setSendPaperReleaseNotify(bool $sendPaperReleaseNotify): self
{
$this->sendPaperReleaseNotify = $sendPaperReleaseNotify;
return $this;
}
public function getMailAboutPaperReleaseSentAt(): ?\DateTimeInterface
{
return $this->mailAboutPaperReleaseSentAt;
}
public function setMailAboutPaperReleaseSentAt(?\DateTimeInterface $mailAboutPaperReleaseSentAt): self
{
$this->mailAboutPaperReleaseSentAt = $mailAboutPaperReleaseSentAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}