src/Entity/CardType.php line 15
<?phpnamespace App\Entity;use App\Repository\CardTypeRepository;use App\Trait\ArrayableTrait;use App\Trait\DateTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: CardTypeRepository::class)]class CardType{use ArrayableTrait;use DateTrait{DateTrait::__construct as private constructDate;}const CLIENT = 'card.type.client';const EMPLOYEE = 'card.type.employee';const MEMBER = 'card.type.member';#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\OneToMany(mappedBy: 'cardType', targetEntity: Card::class, orphanRemoval: true)]private Collection $cards;#[ORM\ManyToOne(inversedBy: 'cardTypes')]#[ORM\JoinColumn(nullable: false)]private ?Establishment $establishment = null;#[ORM\Column(nullable: false)]private ?array $textPlaces = [];#[ORM\Column(length: 255)]#[Assert\Choice(callback: [self::class, 'getList'])]private ?string $type = null;#[ORM\ManyToOne(cascade: ['persist'])]private ?Attachment $file = null;#[ORM\ManyToOne(cascade: ['persist'])]private ?Attachment $fileBack = null;#[ORM\Column]private ?bool $withBack = false;#[ORM\Column]private ?array $identificators = [];#[ORM\Column]private ?bool $withWallet = false;#[ORM\ManyToMany(targetEntity: Currency::class)]private Collection $currencySupport;#[ORM\ManyToOne]private ?ArticleDepartment $article = null;#[ORM\ManyToOne(cascade: ["persist"])]#[ORM\JoinColumn(nullable: true)]#[Groups(['article:list'])]private ?Attachment $qrAttachment = null;#[ORM\Column(nullable: true)]private ?int $sizeWidth = null;#[ORM\Column(nullable: true)]private ?int $sizeHeight = null;public static function getList(){return [self::CLIENT,self::EMPLOYEE,self::MEMBER,];}public function __construct(){$this->constructDate();$this->cards = new ArrayCollection();$this->currencySupport = new ArrayCollection();}public function __toString(): string{return $this->name;}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}/*** @return Collection<int, Card>*/public function getCards(): Collection{return $this->cards;}public function addCard(Card $card): static{if (!$this->cards->contains($card)) {$this->cards->add($card);$card->setCardType($this);}return $this;}public function removeCard(Card $card): static{if ($this->cards->removeElement($card)) {// set the owning side to null (unless already changed)if ($card->getCardType() === $this) {$card->setCardType(null);}}return $this;}public function getEstablishment(): ?Establishment{return $this->establishment;}public function setEstablishment(?Establishment $establishment): static{$this->establishment = $establishment;return $this;}public function getTextPlaces(): array{return $this->textPlaces;}public function setTextPlaces(array $textPlaces): static{$this->textPlaces = $textPlaces;return $this;}public function getType(): ?string{return $this->type;}public function setType(string $type): static{$this->type = $type;return $this;}public function getFile(): ?Attachment{return $this->file;}public function setFile(?Attachment $file): static{$this->file = $file;return $this;}public function getFileBack(): ?Attachment{return $this->fileBack;}public function setFileBack(?Attachment $fileBack): static{$this->fileBack = $fileBack;return $this;}public function isWithBack(): ?bool{return $this->withBack;}public function setWithBack(bool $withBack): static{$this->withBack = $withBack;return $this;}public function getIdentificators(): ?array{return $this->identificators;}public function setIdentificators(?array $identificators): static{$this->identificators = $identificators;return $this;}public function isWithWallet(): ?bool{return $this->withWallet;}public function setWithWallet(bool $withWallet): static{$this->withWallet = $withWallet;return $this;}/*** @return Collection<int, Currency>*/public function getCurrencySupport(): Collection{return $this->currencySupport;}public function addCurrencySupport(Currency $currencySupport): static{if (!$this->currencySupport->contains($currencySupport)) {$this->currencySupport->add($currencySupport);}return $this;}public function removeCurrencySupport(Currency $currencySupport): static{$this->currencySupport->removeElement($currencySupport);return $this;}public function getArticle(): ?ArticleDepartment{return $this->article;}public function setArticle(?ArticleDepartment $article): static{$this->article = $article;return $this;}public function getQrAttachment(): ?Attachment{return $this->qrAttachment;}public function setQrAttachment(?Attachment $attachment): self{$this->qrAttachment = $attachment;return $this;}public function getSizeWidth(): ?int{return $this->sizeWidth;}public function setSizeWidth(?int $sizeWidth): static{$this->sizeWidth = $sizeWidth;return $this;}public function getSizeHeight(): ?int{return $this->sizeHeight;}public function setSizeHeight(?int $sizeHeight): static{$this->sizeHeight = $sizeHeight;return $this;}}