src/Entity/Operation.php line 12
<?phpnamespace App\Entity;use App\Repository\OperationRepository;use DateTime;use DateTimeInterface;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: OperationRepository::class)]class Operation{public const ENTRANCE = 'ENTRANCE';public const EXIT = 'EXIT';#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $type = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $motif = null;#[ORM\ManyToOne]#[ORM\JoinColumn(nullable: false)]private ?User $author = null;#[ORM\ManyToOne(inversedBy: 'operations')]#[ORM\JoinColumn(nullable: false)]private ?Establishment $establishment = null;#[ORM\Column]private ?float $amount = null;#[ORM\ManyToOne]#[ORM\JoinColumn(nullable: false)]private ?Currency $currency = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?DateTimeInterface $createdAt;public function __construct(){$this->createdAt = new DateTime();}public function getId(): ?int{return $this->id;}public function getType(): ?string{return $this->type;}public function setType(string $type): self{$this->type = $type;return $this;}public static function getTypeList(){return ["Entrée" => self::ENTRANCE,"Sortie" => self::EXIT,];}public function getMotif(): ?string{return $this->motif;}public function setMotif(?string $motif): self{$this->motif = $motif;return $this;}public function getAuthor(): ?User{return $this->author;}public function setAuthor(?User $author): self{$this->author = $author;return $this;}public function getEstablishment(): ?Establishment{return $this->establishment;}public function setEstablishment(?Establishment $establishment): self{$this->establishment = $establishment;return $this;}public function getAmount(): ?float{return $this->amount;}public function setAmount(float $amount): self{$this->amount = $amount;return $this;}public function getCurrency(): ?Currency{return $this->currency;}public function setCurrency(?Currency $currency): self{$this->currency = $currency;return $this;}public function getCreatedAt(): ?DateTimeInterface{return $this->createdAt;}public function setCreatedAt(DateTimeInterface $createdAt): self{$this->createdAt = $createdAt;return $this;}}