src/Entity/DocapostReturn.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DocapostReturnRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: DocapostReturnRepository::class)]
  6. #[ORM\HasLifecycleCallbacks]
  7. class DocapostReturn
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type: 'integer')]
  12.     private ?int $id = null;
  13.     #[ORM\Column(type: 'datetime')]
  14.     private ?\DateTimeInterface $created_at = null;
  15.     #[ORM\Column(type: 'datetime')]
  16.     private ?\DateTimeInterface $updated_at = null;
  17.     #[ORM\Column(type: 'datetime', nullable: true)]
  18.     private ?\DateTimeInterface $sent_at = null;
  19.     #[ORM\OneToOne(inversedBy: 'docapostReturn', targetEntity: User::class, cascade: ['persist', 'remove'])]
  20.     #[ORM\JoinColumn(nullable: false)]
  21.     private ?User $user;
  22.     #[ORM\OneToOne(targetEntity: DocapostLog::class, cascade: ['persist', 'remove'])]
  23.     private ?DocapostLog $log;
  24.     #[ORM\Column(type: 'boolean', nullable: true)]
  25.     private ?bool $success = null;
  26.     #[ORM\PrePersist]
  27.     #[ORM\PreUpdate]
  28.     public function updatedTimestamps(): void
  29.     {
  30.         $dateTimeNow = new \DateTime();
  31.         $this->setUpdatedAt($dateTimeNow);
  32.         if (null === $this->getCreatedAt()) {
  33.             $this->setCreatedAt($dateTimeNow);
  34.         }
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getCreatedAt(): ?\DateTimeInterface
  41.     {
  42.         return $this->created_at;
  43.     }
  44.     public function setCreatedAt(\DateTimeInterface $created_at): self
  45.     {
  46.         $this->created_at = $created_at;
  47.         return $this;
  48.     }
  49.     public function getUpdatedAt(): ?\DateTimeInterface
  50.     {
  51.         return $this->updated_at;
  52.     }
  53.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  54.     {
  55.         $this->updated_at = $updated_at;
  56.         return $this;
  57.     }
  58.     public function getSentAt(): ?\DateTimeInterface
  59.     {
  60.         return $this->sent_at;
  61.     }
  62.     public function setSentAt(?\DateTimeInterface $sent_at): self
  63.     {
  64.         $this->sent_at = $sent_at;
  65.         return $this;
  66.     }
  67.     public function getUser(): ?User
  68.     {
  69.         return $this->user;
  70.     }
  71.     public function setUser(User $user): self
  72.     {
  73.         $this->user = $user;
  74.         return $this;
  75.     }
  76.     public function getLog(): ?DocapostLog
  77.     {
  78.         return $this->log;
  79.     }
  80.     public function setLog(?DocapostLog $log): self
  81.     {
  82.         $this->log = $log;
  83.         return $this;
  84.     }
  85.     public function getSuccess(): ?bool
  86.     {
  87.         return $this->success;
  88.     }
  89.     public function setSuccess(?bool $success): self
  90.     {
  91.         $this->success = $success;
  92.         return $this;
  93.     }
  94. }