src/Entity/StockProduct.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StockProductRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10.  * @ORM\Entity(repositoryClass=StockProductRepository::class)
  11.  * @Vich\Uploadable
  12.  */
  13. class StockProduct
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=128)
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\Column(type="float", nullable=true)
  27.     */
  28.     private $sale_price;
  29.     /**
  30.      * @ORM\Column(type="float", nullable=true)
  31.     */
  32.     private $purchase_price;
  33.     /**
  34.      * @ORM\Column(type="float", nullable=true)
  35.     */
  36.     private $quantity_available_for_kit;
  37.     /**
  38.      * @ORM\Column(type="float", nullable=true)
  39.     */
  40.     private $quantity_available_for_out;
  41.     /**
  42.      * @ORM\Column(type="boolean", options={"default": false})
  43.      */
  44.     private $is_available_for_restaurant false;
  45.     /**
  46.      * @ORM\Column(type="float", nullable=true)
  47.      */
  48.     private $restaurant_price;
  49.     /**
  50.      * @ORM\Column(type="float", nullable=true)
  51.      */
  52.     private $quantity_available_for_restaurant;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      */
  56.     private $image;
  57.     /**
  58.      * NOTE: This is not a mapped field of entity metadata, just a simple property.
  59.      * @Vich\UploadableField(mapping="stock_products", fileNameProperty="image")
  60.      * @var File|null
  61.      */
  62.     private $imageFile;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="stockProducts")
  65.      * @ORM\JoinColumn(nullable=false)
  66.      */
  67.     private $establishment;
  68.     /**
  69.      * @ORM\Column(type="datetime_immutable")
  70.     */
  71.     private $created_at;
  72.     /**
  73.      * @ORM\Column(type="datetime_immutable")
  74.      */
  75.     private $updated_at;
  76.     /**
  77.      * @ORM\Column(type="integer")
  78.      */
  79.     private $created_by;
  80.     /**
  81.      * @ORM\Column(type="integer")
  82.      */
  83.     private $updated_by;
  84.     /**
  85.      * @ORM\OneToMany(targetEntity=StockKitProduct::class, mappedBy="product")
  86.      */
  87.     private $stockKitProducts;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity=StockProductEntryLine::class, mappedBy="product")
  90.      */
  91.     private $stockProductEntryLines;
  92.     /**
  93.      * @ORM\OneToMany(targetEntity=StockProviderKitEntryLine::class, mappedBy="product")
  94.      */
  95.     private $stockProviderKitEntryLines;
  96.     /**
  97.      * @ORM\OneToMany(targetEntity=StockStudentKitEntryLine::class, mappedBy="product")
  98.      */
  99.     private $stockStudentKitEntryLines;
  100.     /**
  101.      * @ORM\OneToMany(targetEntity=StockKitOutLine::class, mappedBy="product")
  102.      */
  103.     private $stockKitOutLines;
  104.     /**
  105.      * @ORM\OneToMany(targetEntity=StockProductOut::class, mappedBy="product")
  106.      */
  107.     private $stockProductOuts;
  108.     /**
  109.      * @ORM\OneToMany(targetEntity=StockMovement::class, mappedBy="stockProduct")
  110.      */
  111.     private $stockMovements;
  112.     /**
  113.      * @ORM\OneToMany(targetEntity=StockDeliveryNoteLine::class, mappedBy="stockProduct")
  114.      */
  115.     private $stockDeliveryNoteLines;
  116.     /**
  117.      * @ORM\OneToMany(targetEntity=StockReceptionVoucherLine::class, mappedBy="stockProduct")
  118.      */
  119.     private $stockReceptionVoucherLines;
  120.     /**
  121.      * @ORM\OneToMany(targetEntity=StockExitSlip::class, mappedBy="stockProduct")
  122.      */
  123.     private $stockExitSlips;
  124.     /**
  125.      * @ORM\OneToMany(targetEntity=StockinventoryLine::class, mappedBy="stockProduct")
  126.      */
  127.     private $stockinventoryLines;
  128.     /**
  129.      * @ORM\OneToMany(targetEntity=StocktransferLine::class, mappedBy="stockProduct")
  130.      */
  131.     private $stocktransferLines;
  132.     public function __construct()
  133.     {
  134.         $this->stockKitProducts = new ArrayCollection();
  135.         $this->stockProductEntryLines = new ArrayCollection();
  136.         $this->stockProviderKitEntryLines = new ArrayCollection();
  137.         $this->stockStudentKitEntryLines = new ArrayCollection();
  138.         $this->stockKitOutLines = new ArrayCollection();
  139.         $this->stockProductOuts = new ArrayCollection();
  140.         $this->stockMovements = new ArrayCollection();
  141.         $this->stockDeliveryNoteLines = new ArrayCollection();
  142.         $this->stockReceptionVoucherLines = new ArrayCollection();
  143.         $this->stockExitSlips = new ArrayCollection();
  144.         $this->stockinventoryLines = new ArrayCollection();
  145.         $this->stocktransferLines = new ArrayCollection();
  146.     }
  147.     public function __toString()
  148.     {
  149.         return $this->name;
  150.     }
  151.     public function getId(): ?int
  152.     {
  153.         return $this->id;
  154.     }
  155.     public function getName(): ?string
  156.     {
  157.         return $this->name;
  158.     }
  159.     public function setName(string $name): self
  160.     {
  161.         $this->name $name;
  162.         return $this;
  163.     }
  164.     public function getEstablishment(): ?Establishment
  165.     {
  166.         return $this->establishment;
  167.     }
  168.     public function setEstablishment(?Establishment $establishment): self
  169.     {
  170.         $this->establishment $establishment;
  171.         return $this;
  172.     }
  173.     public function getCreatedAt(): ?\DateTimeImmutable
  174.     {
  175.         return $this->created_at;
  176.     }
  177.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  178.     {
  179.         $this->created_at $created_at;
  180.         return $this;
  181.     }
  182.     public function getUpdatedAt(): ?\DateTimeImmutable
  183.     {
  184.         return $this->updated_at;
  185.     }
  186.     public function setUpdatedAt(\DateTimeImmutable $updated_at): self
  187.     {
  188.         $this->updated_at $updated_at;
  189.         return $this;
  190.     }
  191.     public function getCreatedBy(): ?int
  192.     {
  193.         return $this->created_by;
  194.     }
  195.     public function setCreatedBy(int $created_by): self
  196.     {
  197.         $this->created_by $created_by;
  198.         return $this;
  199.     }
  200.     public function getUpdatedBy(): ?int
  201.     {
  202.         return $this->updated_by;
  203.     }
  204.     public function setUpdatedBy(int $updated_by): self
  205.     {
  206.         $this->updated_by $updated_by;
  207.         return $this;
  208.     }
  209.     /**
  210.      * @return Collection|StockKitProduct[]
  211.      */
  212.     public function getStockKitProducts(): Collection
  213.     {
  214.         return $this->stockKitProducts;
  215.     }
  216.     public function addStockKitProduct(StockKitProduct $stockKitProduct): self
  217.     {
  218.         if (!$this->stockKitProducts->contains($stockKitProduct)) {
  219.             $this->stockKitProducts[] = $stockKitProduct;
  220.             $stockKitProduct->setProduct($this);
  221.         }
  222.         return $this;
  223.     }
  224.     public function removeStockKitProduct(StockKitProduct $stockKitProduct): self
  225.     {
  226.         if ($this->stockKitProducts->removeElement($stockKitProduct)) {
  227.             // set the owning side to null (unless already changed)
  228.             if ($stockKitProduct->getProduct() === $this) {
  229.                 $stockKitProduct->setProduct(null);
  230.             }
  231.         }
  232.         return $this;
  233.     }
  234.     /**
  235.      * @return Collection|StockProductEntryLine[]
  236.      */
  237.     public function getStockProductEntryLines(): Collection
  238.     {
  239.         return $this->stockProductEntryLines;
  240.     }
  241.     public function addStockProductEntryLine(StockProductEntryLine $stockProductEntryLine): self
  242.     {
  243.         if (!$this->stockProductEntryLines->contains($stockProductEntryLine)) {
  244.             $this->stockProductEntryLines[] = $stockProductEntryLine;
  245.             $stockProductEntryLine->setProduct($this);
  246.         }
  247.         return $this;
  248.     }
  249.     public function removeStockProductEntryLine(StockProductEntryLine $stockProductEntryLine): self
  250.     {
  251.         if ($this->stockProductEntryLines->removeElement($stockProductEntryLine)) {
  252.             // set the owning side to null (unless already changed)
  253.             if ($stockProductEntryLine->getProduct() === $this) {
  254.                 $stockProductEntryLine->setProduct(null);
  255.             }
  256.         }
  257.         return $this;
  258.     }
  259.     /**
  260.      * @return Collection|StockProviderKitEntryLine[]
  261.      */
  262.     public function getStockProviderKitEntryLines(): Collection
  263.     {
  264.         return $this->stockProviderKitEntryLines;
  265.     }
  266.     public function addStockProviderKitEntryLine(StockProviderKitEntryLine $stockProviderKitEntryLine): self
  267.     {
  268.         if (!$this->stockProviderKitEntryLines->contains($stockProviderKitEntryLine)) {
  269.             $this->stockProviderKitEntryLines[] = $stockProviderKitEntryLine;
  270.             $stockProviderKitEntryLine->setProduct($this);
  271.         }
  272.         return $this;
  273.     }
  274.     public function removeStockProviderKitEntryLine(StockProviderKitEntryLine $stockProviderKitEntryLine): self
  275.     {
  276.         if ($this->stockProviderKitEntryLines->removeElement($stockProviderKitEntryLine)) {
  277.             // set the owning side to null (unless already changed)
  278.             if ($stockProviderKitEntryLine->getProduct() === $this) {
  279.                 $stockProviderKitEntryLine->setProduct(null);
  280.             }
  281.         }
  282.         return $this;
  283.     }
  284.     /**
  285.      * @return Collection|StockStudentKitEntryLine[]
  286.      */
  287.     public function getStockStudentKitEntryLines(): Collection
  288.     {
  289.         return $this->stockStudentKitEntryLines;
  290.     }
  291.     public function addStockStudentKitEntryLine(StockStudentKitEntryLine $stockStudentKitEntryLine): self
  292.     {
  293.         if (!$this->stockStudentKitEntryLines->contains($stockStudentKitEntryLine)) {
  294.             $this->stockStudentKitEntryLines[] = $stockStudentKitEntryLine;
  295.             $stockStudentKitEntryLine->setProduct($this);
  296.         }
  297.         return $this;
  298.     }
  299.     public function removeStockStudentKitEntryLine(StockStudentKitEntryLine $stockStudentKitEntryLine): self
  300.     {
  301.         if ($this->stockStudentKitEntryLines->removeElement($stockStudentKitEntryLine)) {
  302.             // set the owning side to null (unless already changed)
  303.             if ($stockStudentKitEntryLine->getProduct() === $this) {
  304.                 $stockStudentKitEntryLine->setProduct(null);
  305.             }
  306.         }
  307.         return $this;
  308.     }
  309.     /**
  310.      * @return Collection|StockKitOutLine[]
  311.      */
  312.     public function getStockKitOutLines(): Collection
  313.     {
  314.         return $this->stockKitOutLines;
  315.     }
  316.     public function addStockKitOutLine(StockKitOutLine $stockKitOutLine): self
  317.     {
  318.         if (!$this->stockKitOutLines->contains($stockKitOutLine)) {
  319.             $this->stockKitOutLines[] = $stockKitOutLine;
  320.             $stockKitOutLine->setProduct($this);
  321.         }
  322.         return $this;
  323.     }
  324.     public function removeStockKitOutLine(StockKitOutLine $stockKitOutLine): self
  325.     {
  326.         if ($this->stockKitOutLines->removeElement($stockKitOutLine)) {
  327.             // set the owning side to null (unless already changed)
  328.             if ($stockKitOutLine->getProduct() === $this) {
  329.                 $stockKitOutLine->setProduct(null);
  330.             }
  331.         }
  332.         return $this;
  333.     }
  334.     /**
  335.      * @return Collection|StockProductOut[]
  336.      */
  337.     public function getStockProductOuts(): Collection
  338.     {
  339.         return $this->stockProductOuts;
  340.     }
  341.     public function addStockProductOut(StockProductOut $stockProductOut): self
  342.     {
  343.         if (!$this->stockProductOuts->contains($stockProductOut)) {
  344.             $this->stockProductOuts[] = $stockProductOut;
  345.             $stockProductOut->setProduct($this);
  346.         }
  347.         return $this;
  348.     }
  349.     public function removeStockProductOut(StockProductOut $stockProductOut): self
  350.     {
  351.         if ($this->stockProductOuts->removeElement($stockProductOut)) {
  352.             // set the owning side to null (unless already changed)
  353.             if ($stockProductOut->getProduct() === $this) {
  354.                 $stockProductOut->setProduct(null);
  355.             }
  356.         }
  357.         return $this;
  358.     }
  359.     public function getQuantityAvailableForKit(): ?float
  360.     {
  361.         return $this->quantity_available_for_kit;
  362.     }
  363.     public function setQuantityAvailableForKit(?float $quantity_available_for_kit): self
  364.     {
  365.         $this->quantity_available_for_kit $quantity_available_for_kit;
  366.         return $this;
  367.     }
  368.     public function getQuantityAvailableForOut(): ?float
  369.     {
  370.         return $this->quantity_available_for_out;
  371.     }
  372.     public function setQuantityAvailableForOut(?float $quantity_available_for_out): self
  373.     {
  374.         $this->quantity_available_for_out $quantity_available_for_out;
  375.         return $this;
  376.     }
  377.     public function getSalePrice(): ?float
  378.     {
  379.         return $this->sale_price;
  380.     }
  381.     public function setSalePrice(?float $sale_price): self
  382.     {
  383.         $this->sale_price $sale_price;
  384.         return $this;
  385.     }
  386.     public function getPurchasePrice(): ?float
  387.     {
  388.         return $this->purchase_price;
  389.     }
  390.     public function setPurchasePrice(?float $purchase_price): self
  391.     {
  392.         $this->purchase_price $purchase_price;
  393.         return $this;
  394.     }
  395.     /**
  396.      * @return Collection|StockMovement[]
  397.      */
  398.     public function getStockMovements(): Collection
  399.     {
  400.         return $this->stockMovements;
  401.     }
  402.     public function addStockMovement(StockMovement $stockMovement): self
  403.     {
  404.         if (!$this->stockMovements->contains($stockMovement)) {
  405.             $this->stockMovements[] = $stockMovement;
  406.             $stockMovement->setStockProduct($this);
  407.         }
  408.         return $this;
  409.     }
  410.     public function removeStockMovement(StockMovement $stockMovement): self
  411.     {
  412.         if ($this->stockMovements->removeElement($stockMovement)) {
  413.             // set the owning side to null (unless already changed)
  414.             if ($stockMovement->getStockProduct() === $this) {
  415.                 $stockMovement->setStockProduct(null);
  416.             }
  417.         }
  418.         return $this;
  419.     }
  420.     /**
  421.      * @return Collection|StockDeliveryNoteLine[]
  422.      */
  423.     public function getStockDeliveryNoteLines(): Collection
  424.     {
  425.         return $this->stockDeliveryNoteLines;
  426.     }
  427.     public function addStockDeliveryNoteLine(StockDeliveryNoteLine $stockDeliveryNoteLine): self
  428.     {
  429.         if (!$this->stockDeliveryNoteLines->contains($stockDeliveryNoteLine)) {
  430.             $this->stockDeliveryNoteLines[] = $stockDeliveryNoteLine;
  431.             $stockDeliveryNoteLine->setStockProduct($this);
  432.         }
  433.         return $this;
  434.     }
  435.     public function removeStockDeliveryNoteLine(StockDeliveryNoteLine $stockDeliveryNoteLine): self
  436.     {
  437.         if ($this->stockDeliveryNoteLines->removeElement($stockDeliveryNoteLine)) {
  438.             // set the owning side to null (unless already changed)
  439.             if ($stockDeliveryNoteLine->getStockProduct() === $this) {
  440.                 $stockDeliveryNoteLine->setStockProduct(null);
  441.             }
  442.         }
  443.         return $this;
  444.     }
  445.     /**
  446.      * @return Collection|StockReceptionVoucherLine[]
  447.      */
  448.     public function getStockReceptionVoucherLines(): Collection
  449.     {
  450.         return $this->stockReceptionVoucherLines;
  451.     }
  452.     public function addStockReceptionVoucherLine(StockReceptionVoucherLine $stockReceptionVoucherLine): self
  453.     {
  454.         if (!$this->stockReceptionVoucherLines->contains($stockReceptionVoucherLine)) {
  455.             $this->stockReceptionVoucherLines[] = $stockReceptionVoucherLine;
  456.             $stockReceptionVoucherLine->setStockProduct($this);
  457.         }
  458.         return $this;
  459.     }
  460.     public function removeStockReceptionVoucherLine(StockReceptionVoucherLine $stockReceptionVoucherLine): self
  461.     {
  462.         if ($this->stockReceptionVoucherLines->removeElement($stockReceptionVoucherLine)) {
  463.             // set the owning side to null (unless already changed)
  464.             if ($stockReceptionVoucherLine->getStockProduct() === $this) {
  465.                 $stockReceptionVoucherLine->setStockProduct(null);
  466.             }
  467.         }
  468.         return $this;
  469.     }
  470.     /**
  471.      * @return Collection|StockExitSlip[]
  472.      */
  473.     public function getStockExitSlips(): Collection
  474.     {
  475.         return $this->stockExitSlips;
  476.     }
  477.     public function addStockExitSlip(StockExitSlip $stockExitSlip): self
  478.     {
  479.         if (!$this->stockExitSlips->contains($stockExitSlip)) {
  480.             $this->stockExitSlips[] = $stockExitSlip;
  481.             $stockExitSlip->setStockProduct($this);
  482.         }
  483.         return $this;
  484.     }
  485.     public function removeStockExitSlip(StockExitSlip $stockExitSlip): self
  486.     {
  487.         if ($this->stockExitSlips->removeElement($stockExitSlip)) {
  488.             // set the owning side to null (unless already changed)
  489.             if ($stockExitSlip->getStockProduct() === $this) {
  490.                 $stockExitSlip->setStockProduct(null);
  491.             }
  492.         }
  493.         return $this;
  494.     }
  495.     /**
  496.      * @return Collection|StockinventoryLine[]
  497.      */
  498.     public function getStockinventoryLines(): Collection
  499.     {
  500.         return $this->stockinventoryLines;
  501.     }
  502.     public function addStockinventoryLine(StockinventoryLine $stockinventoryLine): self
  503.     {
  504.         if (!$this->stockinventoryLines->contains($stockinventoryLine)) {
  505.             $this->stockinventoryLines[] = $stockinventoryLine;
  506.             $stockinventoryLine->setStockProduct($this);
  507.         }
  508.         return $this;
  509.     }
  510.     public function removeStockinventoryLine(StockinventoryLine $stockinventoryLine): self
  511.     {
  512.         if ($this->stockinventoryLines->removeElement($stockinventoryLine)) {
  513.             // set the owning side to null (unless already changed)
  514.             if ($stockinventoryLine->getStockProduct() === $this) {
  515.                 $stockinventoryLine->setStockProduct(null);
  516.             }
  517.         }
  518.         return $this;
  519.     }
  520.     /**
  521.      * @return Collection|StocktransferLine[]
  522.      */
  523.     public function getStocktransferLines(): Collection
  524.     {
  525.         return $this->stocktransferLines;
  526.     }
  527.     public function addStocktransferLine(StocktransferLine $stocktransferLine): self
  528.     {
  529.         if (!$this->stocktransferLines->contains($stocktransferLine)) {
  530.             $this->stocktransferLines[] = $stocktransferLine;
  531.             $stocktransferLine->setStockProduct($this);
  532.         }
  533.         return $this;
  534.     }
  535.     public function removeStocktransferLine(StocktransferLine $stocktransferLine): self
  536.     {
  537.         if ($this->stocktransferLines->removeElement($stocktransferLine)) {
  538.             // set the owning side to null (unless already changed)
  539.             if ($stocktransferLine->getStockProduct() === $this) {
  540.                 $stocktransferLine->setStockProduct(null);
  541.             }
  542.         }
  543.         return $this;
  544.     }
  545.     public function computeQuantityInStock(): ?float
  546.     {
  547.         $quantity_in_stock 0;
  548.         foreach ($this->getStockMovements() as $stockMovement) {
  549.             if($stockMovement->getType() === StockMovement::TYPE_ENTREE) {
  550.                 $quantity_in_stock += $stockMovement->getQuantity();
  551.             } 
  552.         }
  553.         return $quantity_in_stock;
  554.     }
  555.     public function computeQuantityOutStock(): ?float
  556.     {
  557.         $quantity_out_stock 0;
  558.         foreach ($this->getStockMovements() as $stockMovement) {
  559.             if($stockMovement->getType() === StockMovement::TYPE_SORTIE) {
  560.                 $quantity_out_stock += $stockMovement->getQuantity();
  561.             } 
  562.         }
  563.         return $quantity_out_stock;
  564.     }
  565.     public function computeQuantityAvailable(): ?float
  566.     {
  567.         $quantity_available $this->computeQuantityInStock() - $this->computeQuantityOutStock();
  568.         return $quantity_available;
  569.     }
  570.     public function computeQuantityInStockByWarehouse(StockWarehouse $stockWarehouse): ?float
  571.     {
  572.         $quantity_in_stock 0;
  573.         foreach ($this->getStockMovements() as $stockMovement) {
  574.             if($stockMovement->getType() === StockMovement::TYPE_ENTREE && $stockMovement->getStockWarehouse()->getId() === $stockWarehouse->getId()) {
  575.                 $quantity_in_stock += $stockMovement->getQuantity();
  576.             } 
  577.         }
  578.         return $quantity_in_stock;
  579.     }
  580.     public function computeQuantityOutStockByWarehouse(StockWarehouse $stockWarehouse): ?float
  581.     {
  582.         $quantity_out_stock 0;
  583.         foreach ($this->getStockMovements() as $stockMovement) {
  584.             if($stockMovement->getType() === StockMovement::TYPE_SORTIE && $stockMovement->getStockWarehouse()->getId() === $stockWarehouse->getId()) {
  585.                 $quantity_out_stock += $stockMovement->getQuantity();
  586.             } 
  587.         }
  588.         return $quantity_out_stock;
  589.     }
  590.     public function computeQuantityAvailableByWarehouse(StockWarehouse $stockWarehouse): ?float
  591.     {
  592.         $quantity_available $this->computeQuantityInStockByWarehouse($stockWarehouse) - $this->computeQuantityOutStockByWarehouse($stockWarehouse);
  593.         return $quantity_available;
  594.     }
  595.     // Restaurant fields getters and setters
  596.     public function getIsAvailableForRestaurant(): ?bool
  597.     {
  598.         return $this->is_available_for_restaurant;
  599.     }
  600.     public function setIsAvailableForRestaurant(bool $is_available_for_restaurant): self
  601.     {
  602.         $this->is_available_for_restaurant $is_available_for_restaurant;
  603.         return $this;
  604.     }
  605.     public function getRestaurantPrice(): ?float
  606.     {
  607.         return $this->restaurant_price;
  608.     }
  609.     public function setRestaurantPrice(?float $restaurant_price): self
  610.     {
  611.         $this->restaurant_price $restaurant_price;
  612.         return $this;
  613.     }
  614.     public function getQuantityAvailableForRestaurant(): ?float
  615.     {
  616.         return $this->quantity_available_for_restaurant;
  617.     }
  618.     public function setQuantityAvailableForRestaurant(?float $quantity_available_for_restaurant): self
  619.     {
  620.         $this->quantity_available_for_restaurant $quantity_available_for_restaurant;
  621.         return $this;
  622.     }
  623.     public function getImage(): ?string
  624.     {
  625.         return $this->image;
  626.     }
  627.     public function setImage(?string $image): self
  628.     {
  629.         $this->image $image;
  630.         return $this;
  631.     }
  632.     public function getImageFile(): ?File
  633.     {
  634.         return $this->imageFile;
  635.     }
  636.     public function setImageFile(?File $imageFile null): self
  637.     {
  638.         $this->imageFile $imageFile;
  639.         // VERY IMPORTANT: It is required that at least one field changes if you are using Doctrine,
  640.         // otherwise the event listeners won't be called and the file is lost
  641.         if ($imageFile) {
  642.             // if 'updatedAt' is not defined in your entity, use another field
  643.             $this->updated_at = new \DateTimeImmutable();
  644.         }
  645.         return $this;
  646.     }
  647.     
  648. }