src/Entity/StockExitSlip.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StockExitSlipRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=StockExitSlipRepository::class)
  9.  */
  10. class StockExitSlip
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=60)
  20.      */
  21.     private $code;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=StockWarehouse::class, inversedBy="stockExitSlips")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $stockWarehouse;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="stockExitSlips")
  29.      * @ORM\JoinColumn(nullable=false)
  30.      */
  31.     private $establishment;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity=StockProduct::class, inversedBy="stockExitSlips")
  34.      * @ORM\JoinColumn(nullable=false)
  35.      */
  36.     private $stockProduct;
  37.     /**
  38.      * @ORM\Column(type="float")
  39.      */
  40.     private $quantity;
  41.     /**
  42.      * @ORM\Column(type="text", nullable=true)
  43.      */
  44.     private $reason;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity=RegistrationStudentRegistration::class, inversedBy="stockExitSlips")
  47.      */
  48.     private $registrationStudentRegistration;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity=RhSalary::class, inversedBy="stockExitSlips")
  51.      */
  52.     private $rhSalary;
  53.     /**
  54.      * @ORM\Column(type="boolean")
  55.      */
  56.     private $is_validated;
  57.     /**
  58.      * @ORM\Column(type="date_immutable")
  59.      */
  60.     private $create_date;
  61.     /**
  62.      * @ORM\Column(type="datetime_immutable")
  63.     */
  64.     private $created_at;
  65.     /**
  66.      * @ORM\Column(type="datetime_immutable")
  67.      */
  68.     private $updated_at;
  69.     /**
  70.      * @ORM\Column(type="integer")
  71.      */
  72.     private $created_by;
  73.     /**
  74.      * @ORM\Column(type="integer")
  75.      */
  76.     private $updated_by;
  77.     /**
  78.      * @ORM\OneToMany(targetEntity=StockMovement::class, mappedBy="stockExitSlip")
  79.      */
  80.     private $stockMovements;
  81.     public function __construct()
  82.     {
  83.         $this->is_validated false;
  84.         $this->create_date = new \DateTimeImmutable();
  85.         $this->quantity 1;
  86.         $this->stockMovements = new ArrayCollection();
  87.     }
  88.     public function getId(): ?int
  89.     {
  90.         return $this->id;
  91.     }
  92.     public function getStockWarehouse(): ?StockWarehouse
  93.     {
  94.         return $this->stockWarehouse;
  95.     }
  96.     public function setStockWarehouse(?StockWarehouse $stockWarehouse): self
  97.     {
  98.         $this->stockWarehouse $stockWarehouse;
  99.         return $this;
  100.     }
  101.     public function getEstablishment(): ?Establishment
  102.     {
  103.         return $this->establishment;
  104.     }
  105.     public function setEstablishment(?Establishment $establishment): self
  106.     {
  107.         $this->establishment $establishment;
  108.         return $this;
  109.     }
  110.     public function getStockProduct(): ?StockProduct
  111.     {
  112.         return $this->stockProduct;
  113.     }
  114.     public function setStockProduct(?StockProduct $stockProduct): self
  115.     {
  116.         $this->stockProduct $stockProduct;
  117.         return $this;
  118.     }
  119.     public function getReason(): ?string
  120.     {
  121.         return $this->reason;
  122.     }
  123.     public function setReason(?string $reason): self
  124.     {
  125.         $this->reason $reason;
  126.         return $this;
  127.     }
  128.     public function getRegistrationStudentRegistration(): ?RegistrationStudentRegistration
  129.     {
  130.         return $this->registrationStudentRegistration;
  131.     }
  132.     public function setRegistrationStudentRegistration(?RegistrationStudentRegistration $registrationStudentRegistration): self
  133.     {
  134.         $this->registrationStudentRegistration $registrationStudentRegistration;
  135.         return $this;
  136.     }
  137.     public function getRhSalary(): ?RhSalary
  138.     {
  139.         return $this->rhSalary;
  140.     }
  141.     public function setRhSalary(?RhSalary $rhSalary): self
  142.     {
  143.         $this->rhSalary $rhSalary;
  144.         return $this;
  145.     }
  146.     public function getIsValidated(): ?bool
  147.     {
  148.         return $this->is_validated;
  149.     }
  150.     public function setIsValidated(bool $is_validated): self
  151.     {
  152.         $this->is_validated $is_validated;
  153.         return $this;
  154.     }
  155.     public function getCreateDate(): ?\DateTimeImmutable
  156.     {
  157.         return $this->create_date;
  158.     }
  159.     public function setCreateDate(\DateTimeImmutable $create_date): self
  160.     {
  161.         $this->create_date $create_date;
  162.         return $this;
  163.     }
  164.     public function getCreatedAt(): ?\DateTimeImmutable
  165.     {
  166.         return $this->created_at;
  167.     }
  168.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  169.     {
  170.         $this->created_at $created_at;
  171.         return $this;
  172.     }
  173.     public function getUpdatedAt(): ?\DateTimeImmutable
  174.     {
  175.         return $this->updated_at;
  176.     }
  177.     public function setUpdatedAt(\DateTimeImmutable $updated_at): self
  178.     {
  179.         $this->updated_at $updated_at;
  180.         return $this;
  181.     }
  182.     public function getCreatedBy(): ?int
  183.     {
  184.         return $this->created_by;
  185.     }
  186.     public function setCreatedBy(int $created_by): self
  187.     {
  188.         $this->created_by $created_by;
  189.         return $this;
  190.     }
  191.     public function getUpdatedBy(): ?int
  192.     {
  193.         return $this->updated_by;
  194.     }
  195.     public function setUpdatedBy(int $updated_by): self
  196.     {
  197.         $this->updated_by $updated_by;
  198.         return $this;
  199.     }
  200.     public function getCode(): ?string
  201.     {
  202.         return $this->code;
  203.     }
  204.     public function setCode(string $code): self
  205.     {
  206.         $this->code $code;
  207.         return $this;
  208.     }
  209.     public function getQuantity(): ?float
  210.     {
  211.         return $this->quantity;
  212.     }
  213.     public function setQuantity(float $quantity): self
  214.     {
  215.         $this->quantity $quantity;
  216.         return $this;
  217.     }
  218.     /**
  219.      * @return Collection|StockMovement[]
  220.      */
  221.     public function getStockMovements(): Collection
  222.     {
  223.         return $this->stockMovements;
  224.     }
  225.     public function addStockMovement(StockMovement $stockMovement): self
  226.     {
  227.         if (!$this->stockMovements->contains($stockMovement)) {
  228.             $this->stockMovements[] = $stockMovement;
  229.             $stockMovement->setStockExitSlip($this);
  230.         }
  231.         return $this;
  232.     }
  233.     public function removeStockMovement(StockMovement $stockMovement): self
  234.     {
  235.         if ($this->stockMovements->removeElement($stockMovement)) {
  236.             // set the owning side to null (unless already changed)
  237.             if ($stockMovement->getStockExitSlip() === $this) {
  238.                 $stockMovement->setStockExitSlip(null);
  239.             }
  240.         }
  241.         return $this;
  242.     }
  243. }