src/Entity/ItemsListBackup.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ItemsListBackupRepository;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassItemsListBackupRepository::class)]
  7. #[ORM\Table(name'items_list_backup')]
  8. class ItemsListBackup {
  9.     #[ORM\Column(type'boolean')]
  10.     private bool $isDeleted false;
  11.     #[ORM\Column(name'createdAt'type'datetime')]
  12.     private DateTime $createdAt;
  13.     #[ORM\Id]
  14.     #[ORM\Column(name'id'type'integer')]
  15.     #[ORM\GeneratedValue(strategy'AUTO')]
  16.     private ?int $id;
  17.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'itemsListBackups')]
  18.     #[ORM\JoinColumn(nullablefalse)]
  19.     private User $user;
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private ?string $pdfFileName;
  22.     public function __construct() {
  23.         $this->createdAt = new DateTime();
  24.     }
  25.     public function __toString() {
  26.         return "#" $this->id " - " $this->pdfFileName;
  27.     }
  28.     /**
  29.      * Get id
  30.      *
  31.      * @return int
  32.      */
  33.     public function getId() {
  34.         return $this->id;
  35.     }
  36.     /**
  37.      * Set createdAt
  38.      *
  39.      * @param DateTime $createdAt
  40.      *
  41.      * @return ItemsListBackup
  42.      */
  43.     public function setCreatedAt($createdAt) {
  44.         $this->createdAt $createdAt;
  45.         return $this;
  46.     }
  47.     /**
  48.      * Get createdAt
  49.      *
  50.      * @return DateTime
  51.      */
  52.     public function getCreatedAt() {
  53.         return $this->createdAt;
  54.     }
  55.     /**
  56.      * Set pdfFileName
  57.      *
  58.      * @param string $pdfFileName
  59.      *
  60.      * @return ItemsListBackup
  61.      */
  62.     public function setPdfFileName($pdfFileName) {
  63.         $this->pdfFileName $pdfFileName;
  64.         return $this;
  65.     }
  66.     /**
  67.      * Get pdfFileName
  68.      *
  69.      * @return string
  70.      */
  71.     public function getPdfFileName() {
  72.         return $this->pdfFileName;
  73.     }
  74.     public function getPdfFileNameWithExtention(): string
  75.     {
  76.         return $this->pdfFileName '.pdf';
  77.     }
  78.     /**
  79.      * Set user
  80.      *
  81.      * @param \App\Entity\User $user
  82.      *
  83.      * @return ItemsListBackup
  84.      */
  85.     public function setUser(\App\Entity\User $user) {
  86.         $this->user $user;
  87.         return $this;
  88.     }
  89.     /**
  90.      * Get user
  91.      *
  92.      * @return \App\Entity\User
  93.      */
  94.     public function getUser() {
  95.         return $this->user;
  96.     }
  97.     /**
  98.      * Set isDeleted
  99.      *
  100.      * @param boolean $isDeleted
  101.      *
  102.      * @return ItemsListBackup
  103.      */
  104.     public function setIsDeleted($isDeleted)
  105.     {
  106.         $this->isDeleted $isDeleted;
  107.         return $this;
  108.     }
  109.     /**
  110.      * Get isDeleted
  111.      *
  112.      * @return boolean
  113.      */
  114.     public function getIsDeleted()
  115.     {
  116.         return $this->isDeleted;
  117.     }
  118. }