src/Entity/Currency.php line 14
<?phpnamespace App\Entity;use App\Repository\CurrencyRepository;use App\Trait\DateTrait;use DateTimeImmutable;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: CurrencyRepository::class)]class Currency{use DateTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['article:list', 'establishment:list', 'order:list'])]private ?int $id = null;#[ORM\Column(length: 255)]#[Groups(['article:list', 'establishment:list', 'order:list'])]private ?string $name = null;#[ORM\Column(length: 3)]#[Groups(['article:list', 'establishment:list', 'order:list'])]private ?string $min = null;#[ORM\Column(length: 10)]#[Groups(['article:list', 'establishment:list', 'order:list'])]private ?string $symbol = null;#[ORM\Column]private ?bool $isDefault = false;#[ORM\ManyToOne(inversedBy: 'currencies')]#[ORM\JoinColumn(nullable: true)]private ?Establishment $establishment = null;#[ORM\OneToMany(mappedBy: 'currency', targetEntity: WalletOperation::class, orphanRemoval: true)]private Collection $walletOperations;#[ORM\Column(options: ['default' => true])]private ?bool $onFacturation = true;public function __construct(){if (is_null($this->createdAt)) $this->createdAt = new DateTimeImmutable();$this->updatedAt = new DateTimeImmutable();$this->walletOperations = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getMin(): ?string{return $this->min;}public function setMin(string $min): self{$this->min = $min;return $this;}public function getSymbol(): ?string{return $this->symbol;}public function setSymbol(string $symbol): self{$this->symbol = $symbol;return $this;}public function __toString(): string{return $this->min;}public function isIsDefault(): ?bool{return $this->isDefault;}public function setIsDefault(bool $isDefault): self{$this->isDefault = $isDefault;return $this;}public function getEstablishment(): ?Establishment{return $this->establishment;}public function setEstablishment(?Establishment $establishment): static{$this->establishment = $establishment;return $this;}/*** @return Collection<int, WalletOperation>*/public function getWalletOperations(): Collection{return $this->walletOperations;}public function addWalletOperation(WalletOperation $walletOperation): static{if (!$this->walletOperations->contains($walletOperation)) {$this->walletOperations->add($walletOperation);$walletOperation->setCurrency($this);}return $this;}public function removeWalletOperation(WalletOperation $walletOperation): static{if ($this->walletOperations->removeElement($walletOperation)) {// set the owning side to null (unless already changed)if ($walletOperation->getCurrency() === $this) {$walletOperation->setCurrency(null);}}return $this;}public function isOnFacturation(): ?bool{return $this->onFacturation;}public function setOnFacturation(bool $onFacturation): static{$this->onFacturation = $onFacturation;return $this;}}