src/Flexy/ShopBundle/Entity/Payment/BankBook.php line 14

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Payment;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\Flexy\ShopBundle\Entity\Payment\BankBookRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassBankBookRepository::class)]
  10. #[ApiResource]
  11. class BankBook
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column]
  18.     private ?int $reference null;
  19.     #[ORM\Column]
  20.     private ?int $nbrPages null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $type null;
  23.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  24.     private ?\DateTimeInterface $createdAt null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $createdBy null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $updatedBy null;
  29.     #[ORM\OneToMany(mappedBy'bankBook'targetEntityBankBookItem::class)]
  30.     private Collection $bankBookItems;
  31.     public function __construct()
  32.     {
  33.         $this->bankBookItems = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getReference(): ?int
  40.     {
  41.         return $this->reference;
  42.     }
  43.     public function setReference(int $reference): self
  44.     {
  45.         $this->reference $reference;
  46.         return $this;
  47.     }
  48.     public function getNbrPages(): ?int
  49.     {
  50.         return $this->nbrPages;
  51.     }
  52.     public function setNbrPages(int $nbrPages): self
  53.     {
  54.         $this->nbrPages $nbrPages;
  55.         return $this;
  56.     }
  57.     public function getType(): ?string
  58.     {
  59.         return $this->type;
  60.     }
  61.     public function setType(string $type): self
  62.     {
  63.         $this->type $type;
  64.         return $this;
  65.     }
  66.     public function getCreatedAt(): ?\DateTimeInterface
  67.     {
  68.         return $this->createdAt;
  69.     }
  70.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  71.     {
  72.         $this->createdAt $createdAt;
  73.         return $this;
  74.     }
  75.     public function getCreatedBy(): ?string
  76.     {
  77.         return $this->createdBy;
  78.     }
  79.     public function setCreatedBy(?string $createdBy): self
  80.     {
  81.         $this->createdBy $createdBy;
  82.         return $this;
  83.     }
  84.     public function getUpdatedBy(): ?string
  85.     {
  86.         return $this->updatedBy;
  87.     }
  88.     public function setUpdatedBy(?string $updatedBy): self
  89.     {
  90.         $this->updatedBy $updatedBy;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, BankBookItem>
  95.      */
  96.     public function getBankBookItems(): Collection
  97.     {
  98.         return $this->bankBookItems;
  99.     }
  100.     public function addBankBookItem(BankBookItem $bankBookItem): self
  101.     {
  102.         if (!$this->bankBookItems->contains($bankBookItem)) {
  103.             $this->bankBookItems->add($bankBookItem);
  104.             $bankBookItem->setBankBook($this);
  105.         }
  106.         return $this;
  107.     }
  108.     public function removeBankBookItem(BankBookItem $bankBookItem): self
  109.     {
  110.         if ($this->bankBookItems->removeElement($bankBookItem)) {
  111.             // set the owning side to null (unless already changed)
  112.             if ($bankBookItem->getBankBook() === $this) {
  113.                 $bankBookItem->setBankBook(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118. }