src/Entity/WalletOperation.php line 13
<?phpnamespace App\Entity;use App\Repository\WalletOperationRepository;use App\Trait\ArrayableTrait;use App\Trait\AuthorTrait;use App\Trait\DateTrait;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: WalletOperationRepository::class)]class WalletOperation{use ArrayableTrait;use DateTrait {DateTrait::__construct as private dateConstruct;}use AuthorTrait;const CREDITE = "wallet.operation.type.credite";const DEBITE = "wallet.operation.type.debite";const TRANSFERT = "wallet.operation.type.transfer";const WALLET_CARD = "wallet.operation.for.card";const WALLET_MEMBER = "wallet.operation.for.member";const WALLET_DEPARTMENT = "wallet.operation.for.department";const WALLET_CLIENT = "wallet.operation.for.client";const WALLET_EMPLOYEE = "wallet.operation.for.employee";const STATUS_SUCCESS = "wallet.operation.status.success";const STATUS_ERROR = "wallet.operation.status.error";const STATUS_CANCEL = "wallet.operation.status.cancel";#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]#[Assert\NotBlank]#[Assert\Choice(callback: [self::class, 'getOperations'])]private ?string $type = null;#[ORM\Column(length: 255, nullable: true)]private ?string $fromEntity = null;#[ORM\Column(nullable: true)]private ?int $fromId = null;#[ORM\Column(length: 255)]private ?string $toEntity = null;#[ORM\Column]private ?int $toId = null;#[ORM\Column(length: 255)]private ?string $status = null;#[ORM\Column]#[Assert\NotBlank]private ?float $amount = null;#[ORM\ManyToOne(inversedBy: 'walletOperations')]#[ORM\JoinColumn(nullable: false)]#[Assert\NotBlank]private ?Currency $currency = null;#[ORM\Column(length: 255, nullable: true)]private ?string $motif = null;#[ORM\ManyToOne(inversedBy: 'walletOperations')]private ?Establishment $establishment = null;public static function getOperations(): array{return [self::CREDITE,self::DEBITE,self::TRANSFERT,];}public static function getWalletable(): array{return [self::WALLET_CARD => 'Card',self::WALLET_EMPLOYEE => 'Employee',self::WALLET_MEMBER => 'Mutuality',self::WALLET_CLIENT => 'Client',self::WALLET_DEPARTMENT => 'Department',];}public function getId(): ?int{return $this->id;}public function getType(): ?string{return $this->type;}public function setType(string $type): static{$this->type = $type;return $this;}public function getFromEntity(): ?string{return $this->fromEntity;}public function setFromEntity(?string $fromEntity): static{$this->fromEntity = $fromEntity;return $this;}public function getFromId(): ?int{return $this->fromId;}public function setFromId(?int $fromId): static{$this->fromId = $fromId;return $this;}public function getToEntity(): ?string{return $this->toEntity;}public function setToEntity(string $toEntity): static{$this->toEntity = $toEntity;return $this;}public function getToId(): ?int{return $this->toId;}public function setToId(int $toId): static{$this->toId = $toId;return $this;}public function getStatus(): ?string{return $this->status;}public function setStatus(string $status): static{$this->status = $status;return $this;}public function getAmount(): ?float{return $this->amount;}public function setAmount(float $amount): static{$this->amount = $amount;return $this;}public function getCurrency(): ?Currency{return $this->currency;}public function setCurrency(?Currency $currency): static{$this->currency = $currency;return $this;}public function getMotif(): ?string{return $this->motif;}public function setMotif(?string $motif): static{$this->motif = $motif;return $this;}public function getEstablishment(): ?Establishment{return $this->establishment;}public function setEstablishment(?Establishment $establishment): static{$this->establishment = $establishment;return $this;}}