src/Entity/ItemsListComplaint.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ItemsListComplaintRepository;
  4. use DateTime;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassItemsListComplaintRepository::class)]
  8. #[ORM\Table(name'items_list_complaint')]
  9. class ItemsListComplaint {
  10.     #[ORM\Column(type'boolean')]
  11.     private bool $isDeleted false;
  12.     #[ORM\Column(name'createdAt'type'datetime')]
  13.     private DateTime $createdAt;
  14.     #[ORM\OneToMany(targetEntityArchiveComplaint::class, mappedBy'itemsListComplaint'cascade: ['persist'])]
  15.     private Collection|array $archiveComplaints;
  16.     #[ORM\Id]
  17.     #[ORM\Column(name'id'type'integer')]
  18.     #[ORM\GeneratedValue(strategy'AUTO')]
  19.     private ?int $id;
  20.     #[ORM\ManyToMany(targetEntityItem::class, inversedBy'itemsListComplaints')]
  21.     private Collection|array $items;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private ?string $pdfFileName;
  24.     #[ORM\ManyToMany(targetEntityPaymentMethod::class, inversedBy'itemsListComplaints')]
  25.     private Collection|array $paymentMethods;
  26.     #[ORM\Column(type'decimal'precision10scale2nullabletrue)]
  27.     private ?float $cash null;
  28.     #[ORM\Column(type'text'nullabletrue)]
  29.     private ?string $nonSavedItem null;
  30.     #[ORM\Column(type'text'nullabletrue)]
  31.     private ?string $nonSavedPaymentMethod null;
  32.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'itemsListComplaints')]
  33.     #[ORM\JoinColumn(nullablefalse)]
  34.     private User $user;
  35.     public function __construct() {
  36.         $this->createdAt = new DateTime();
  37.         $this->items = new \Doctrine\Common\Collections\ArrayCollection();
  38.         $this->paymentMethods = new \Doctrine\Common\Collections\ArrayCollection();
  39.     }
  40.     public function __toString() {
  41.         return "#" $this->id " - " $this->createdAt->format("d/m/Y H:i");
  42.     }
  43.     /**
  44.      * Get id
  45.      *
  46.      * @return int
  47.      */
  48.     public function getId() {
  49.         return $this->id;
  50.     }
  51.     /**
  52.      * Set cash
  53.      *
  54.      * @param string $cash
  55.      *
  56.      * @return ItemsListComplaint
  57.      */
  58.     public function setCash($cash) {
  59.         $this->cash $cash;
  60.         return $this;
  61.     }
  62.     /**
  63.      * Get cash
  64.      *
  65.      * @return string
  66.      */
  67.     public function getCash() {
  68.         return $this->cash;
  69.     }
  70.     /**
  71.      * Set nonSavedItem
  72.      *
  73.      * @param string $nonSavedItem
  74.      *
  75.      * @return ItemsListComplaint
  76.      */
  77.     public function setNonSavedItem($nonSavedItem) {
  78.         $this->nonSavedItem $nonSavedItem;
  79.         return $this;
  80.     }
  81.     /**
  82.      * Get nonSavedItem
  83.      *
  84.      * @return string
  85.      */
  86.     public function getNonSavedItem() {
  87.         return $this->nonSavedItem;
  88.     }
  89.     /**
  90.      * Set nonSavedPaymentMethod
  91.      *
  92.      * @param string $nonSavedPaymentMethod
  93.      *
  94.      * @return ItemsListComplaint
  95.      */
  96.     public function setNonSavedPaymentMethod($nonSavedPaymentMethod) {
  97.         $this->nonSavedPaymentMethod $nonSavedPaymentMethod;
  98.         return $this;
  99.     }
  100.     /**
  101.      * Get nonSavedPaymentMethod
  102.      *
  103.      * @return string
  104.      */
  105.     public function getNonSavedPaymentMethod() {
  106.         return $this->nonSavedPaymentMethod;
  107.     }
  108.     /**
  109.      * Add item
  110.      *
  111.      * @param \App\Entity\Item $item
  112.      *
  113.      * @return ItemsListComplaint
  114.      */
  115.     public function addItem(\App\Entity\Item $item) {
  116.         $this->items[] = $item;
  117.         return $this;
  118.     }
  119.     /**
  120.      * Remove item
  121.      *
  122.      * @param \App\Entity\Item $item
  123.      */
  124.     public function removeItem(\App\Entity\Item $item) {
  125.         $this->items->removeElement($item);
  126.     }
  127.     /**
  128.      * Get items
  129.      *
  130.      * @return \Doctrine\Common\Collections\Collection
  131.      */
  132.     public function getItems() {
  133.         return $this->items;
  134.     }
  135.     /**
  136.      * Add paymentMethod
  137.      *
  138.      * @param \App\Entity\PaymentMethod $paymentMethod
  139.      *
  140.      * @return ItemsListComplaint
  141.      */
  142.     public function addPaymentMethod(\App\Entity\PaymentMethod $paymentMethod) {
  143.         $this->paymentMethods[] = $paymentMethod;
  144.         return $this;
  145.     }
  146.     /**
  147.      * Remove paymentMethod
  148.      *
  149.      * @param \App\Entity\PaymentMethod $paymentMethod
  150.      */
  151.     public function removePaymentMethod(\App\Entity\PaymentMethod $paymentMethod) {
  152.         $this->paymentMethods->removeElement($paymentMethod);
  153.     }
  154.     /**
  155.      * Get paymentMethods
  156.      *
  157.      * @return \Doctrine\Common\Collections\Collection
  158.      */
  159.     public function getPaymentMethods() {
  160.         return $this->paymentMethods;
  161.     }
  162.     /**
  163.      * Set user
  164.      *
  165.      * @param \App\Entity\User $user
  166.      *
  167.      * @return ItemsListComplaint
  168.      */
  169.     public function setUser(\App\Entity\User $user) {
  170.         $this->user $user;
  171.         return $this;
  172.     }
  173.     /**
  174.      * Get user
  175.      *
  176.      * @return \App\Entity\User
  177.      */
  178.     public function getUser() {
  179.         return $this->user;
  180.     }
  181.     /**
  182.      * Set createdAt
  183.      *
  184.      * @param DateTime $createdAt
  185.      *
  186.      * @return ItemsListComplaint
  187.      */
  188.     public function setCreatedAt($createdAt) {
  189.         $this->createdAt $createdAt;
  190.         return $this;
  191.     }
  192.     /**
  193.      * Get createdAt
  194.      *
  195.      * @return DateTime
  196.      */
  197.     public function getCreatedAt() {
  198.         return $this->createdAt;
  199.     }
  200.     /**
  201.      * Set pdfFileName
  202.      *
  203.      * @param string $pdfFileName
  204.      *
  205.      * @return ItemsListComplaint
  206.      */
  207.     public function setPdfFileName($pdfFileName) {
  208.         $this->pdfFileName $pdfFileName;
  209.         return $this;
  210.     }
  211.     /**
  212.      * Get pdfFileName
  213.      *
  214.      * @return string
  215.      */
  216.     public function getPdfFileName() {
  217.         return $this->pdfFileName;
  218.     }
  219.     public function getPdfFileNameWithExtention(): string
  220.     {
  221.         return $this->pdfFileName '.pdf';
  222.     }
  223.     /**
  224.      * Add archiveComplaint
  225.      *
  226.      * @param \App\Entity\ArchiveComplaint $archiveComplaint
  227.      *
  228.      * @return ItemsListComplaint
  229.      */
  230.     public function addArchiveComplaint(\App\Entity\ArchiveComplaint $archiveComplaint) {
  231.         $this->archiveComplaints[] = $archiveComplaint;
  232.         return $this;
  233.     }
  234.     /**
  235.      * Remove archiveComplaint
  236.      *
  237.      * @param \App\Entity\ArchiveComplaint $archiveComplaint
  238.      */
  239.     public function removeArchiveComplaint(\App\Entity\ArchiveComplaint $archiveComplaint) {
  240.         $this->archiveComplaints->removeElement($archiveComplaint);
  241.     }
  242.     /**
  243.      * Get archiveComplaints
  244.      *
  245.      * @return \Doctrine\Common\Collections\Collection
  246.      */
  247.     public function getArchiveComplaints() {
  248.         return $this->archiveComplaints;
  249.     }
  250.     /**
  251.      * Set isDeleted
  252.      *
  253.      * @param boolean $isDeleted
  254.      *
  255.      * @return ItemsListComplaint
  256.      */
  257.     public function setIsDeleted($isDeleted)
  258.     {
  259.         $this->isDeleted $isDeleted;
  260.         return $this;
  261.     }
  262.     /**
  263.      * Get isDeleted
  264.      *
  265.      * @return boolean
  266.      */
  267.     public function getIsDeleted()
  268.     {
  269.         return $this->isDeleted;
  270.     }
  271. }