src/Entity/TransfertStock.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TransfertStockRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassTransfertStockRepository::class)]
  7. class TransfertStock
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne]
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     private ?Produit $produit null;
  16.     #[ORM\Column]
  17.     private ?int $quantite null;
  18.     #[ORM\ManyToOne]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Boutique $boutiqueSource null;
  21.     #[ORM\ManyToOne]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private ?Boutique $boutiqueDestination null;
  24.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  25.     private ?\DateTimeInterface $dateTransfert null;
  26.     #[ORM\ManyToOne]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?User $utilisateur null;
  29.     #[ORM\Column(length50)]
  30.     private ?string $statut 'EN_ATTENTE'// EN_ATTENTE, VALIDE, ANNULE
  31.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  32.     private ?string $motif null;
  33.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  34.     private ?SortieStock $sortieStock null;
  35.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  36.     private ?EntreeStock $entreeStock null;
  37.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  38.     private ?\DateTimeInterface $createdAt null;
  39.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  40.     private ?\DateTimeInterface $validatedAt null;
  41.     public function __construct()
  42.     {
  43.         $this->createdAt = new \DateTime();
  44.         $this->dateTransfert = new \DateTime();
  45.         $this->statut 'EN_ATTENTE';
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getProduit(): ?Produit
  52.     {
  53.         return $this->produit;
  54.     }
  55.     public function setProduit(?Produit $produit): static
  56.     {
  57.         $this->produit $produit;
  58.         return $this;
  59.     }
  60.     public function getQuantite(): ?int
  61.     {
  62.         return $this->quantite;
  63.     }
  64.     public function setQuantite(int $quantite): static
  65.     {
  66.         $this->quantite $quantite;
  67.         return $this;
  68.     }
  69.     public function getBoutiqueSource(): ?Boutique
  70.     {
  71.         return $this->boutiqueSource;
  72.     }
  73.     public function setBoutiqueSource(?Boutique $boutiqueSource): static
  74.     {
  75.         $this->boutiqueSource $boutiqueSource;
  76.         return $this;
  77.     }
  78.     public function getBoutiqueDestination(): ?Boutique
  79.     {
  80.         return $this->boutiqueDestination;
  81.     }
  82.     public function setBoutiqueDestination(?Boutique $boutiqueDestination): static
  83.     {
  84.         $this->boutiqueDestination $boutiqueDestination;
  85.         return $this;
  86.     }
  87.     public function getDateTransfert(): ?\DateTimeInterface
  88.     {
  89.         return $this->dateTransfert;
  90.     }
  91.     public function setDateTransfert(\DateTimeInterface $dateTransfert): static
  92.     {
  93.         $this->dateTransfert $dateTransfert;
  94.         return $this;
  95.     }
  96.     public function getUtilisateur(): ?User
  97.     {
  98.         return $this->utilisateur;
  99.     }
  100.     public function setUtilisateur(?User $utilisateur): static
  101.     {
  102.         $this->utilisateur $utilisateur;
  103.         return $this;
  104.     }
  105.     public function getStatut(): ?string
  106.     {
  107.         return $this->statut;
  108.     }
  109.     public function setStatut(string $statut): static
  110.     {
  111.         $this->statut $statut;
  112.         return $this;
  113.     }
  114.     public function getMotif(): ?string
  115.     {
  116.         return $this->motif;
  117.     }
  118.     public function setMotif(?string $motif): static
  119.     {
  120.         $this->motif $motif;
  121.         return $this;
  122.     }
  123.     public function getSortieStock(): ?SortieStock
  124.     {
  125.         return $this->sortieStock;
  126.     }
  127.     public function setSortieStock(?SortieStock $sortieStock): static
  128.     {
  129.         $this->sortieStock $sortieStock;
  130.         return $this;
  131.     }
  132.     public function getEntreeStock(): ?EntreeStock
  133.     {
  134.         return $this->entreeStock;
  135.     }
  136.     public function setEntreeStock(?EntreeStock $entreeStock): static
  137.     {
  138.         $this->entreeStock $entreeStock;
  139.         return $this;
  140.     }
  141.     public function getCreatedAt(): ?\DateTimeInterface
  142.     {
  143.         return $this->createdAt;
  144.     }
  145.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  146.     {
  147.         $this->createdAt $createdAt;
  148.         return $this;
  149.     }
  150.     public function getValidatedAt(): ?\DateTimeInterface
  151.     {
  152.         return $this->validatedAt;
  153.     }
  154.     public function setValidatedAt(?\DateTimeInterface $validatedAt): static
  155.     {
  156.         $this->validatedAt $validatedAt;
  157.         return $this;
  158.     }
  159.     public function isEnAttente(): bool
  160.     {
  161.         return $this->statut === 'EN_ATTENTE';
  162.     }
  163.     public function isValide(): bool
  164.     {
  165.         return $this->statut === 'VALIDE';
  166.     }
  167.     public function isAnnule(): bool
  168.     {
  169.         return $this->statut === 'ANNULE';
  170.     }
  171. }