src/Entity/OrderFabrication.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\Collection;
  6. use App\Repository\OrderFabricationRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. #[ORM\Entity(repositoryClass: OrderFabricationRepository::class)]
  10. class OrderFabrication
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     #[Groups(['show_search'])]
  16.     private ?int $id = null;
  17.     #[ORM\Column(length: 255)]
  18.     #[Groups(['show_search'])]
  19.     private ?string $numero_devis = null;
  20.     #[ORM\Column(length: 255)]
  21.     #[Groups(['show_search'])]
  22.     private ?string $status = null;
  23.     #[ORM\Column(length: 255, nullable: true)]
  24.     #[Groups(['show_search'])]
  25.     private ?string $status_odoo = null;
  26.     #[ORM\Column(length: 255)]
  27.     #[Groups(['show_search'])]
  28.     private ?float $prix_total = null;
  29.     #[ORM\ManyToOne(inversedBy: 'orderFabrications', fetch: 'EXTRA_LAZY')]
  30.     #[ORM\JoinColumn(nullable: false)]
  31.     private ?FamilleProduits $famille_produits = null;
  32.     #[ORM\Column(type: Types::TEXT)]
  33.     #[Groups(['show_search'])]
  34.     private ?string $data = null;
  35.     #[ORM\Column(type: Types::TEXT)]
  36.     #[Groups(['show_search'])]
  37.     private ?string $data_prix_qty = null;
  38.     #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  39.     #[Groups(['show_search'])]
  40.     private ?\DateTimeInterface $date_creation = null;
  41.     #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  42.     #[Groups(['show_search'])]
  43.     private ?\DateTimeInterface $date_modification = null;
  44.     #[ORM\ManyToOne(inversedBy: 'orderFabrications', fetch: 'EXTRA_LAZY')]
  45.     #[ORM\JoinColumn(nullable: false)]
  46.     #[Groups(['show_search'])]
  47.     private ?User $creer_par = null;
  48.     #[ORM\OneToMany(mappedBy: 'orderFabrication', targetEntity: OrderHistory::class, fetch: 'EXTRA_LAZY')]
  49.     #[Groups(['show_search'])]
  50.     private Collection $update_by;
  51.     #[ORM\ManyToOne(inversedBy: 'orderFabrications')]
  52.     #[Groups(['show_search'])]
  53.     private ?Clients $clients = null;
  54.     #[ORM\ManyToMany(targetEntity: OrderFabricationTypes::class, mappedBy: 'order_fabrication', fetch: 'EXTRA_LAZY')]
  55.     #[Groups(['show_search'])]
  56.     private Collection $orderFabricationTypes;
  57.     #[ORM\OneToMany(mappedBy: 'order_fabrication', targetEntity: OrderFabricationComponentStatus::class, fetch: 'EXTRA_LAZY')]
  58.     #[Groups(['show_search'])]
  59.     private Collection $orderFabricationComponentStatuses;
  60.     #[Groups(['show_search'])]
  61.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  62.     private ?\DateTimeInterface $date_de_fabrication = null;
  63.     #[Groups(['show_search'])]
  64.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  65.     private ?\DateTimeInterface $date_de_livraison = null;
  66.     #[Groups(['show_search'])]
  67.     #[ORM\ManyToOne(inversedBy: 'orderFabrications', fetch: 'EXTRA_LAZY')]
  68.     #[ORM\JoinColumn(nullable: false)]
  69.     private ?Company $socite_de_fabrication = null;
  70.     #[ORM\Column(nullable: true)]
  71.     private ?int $priority = null;
  72.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  73.     private ?string $suivis_produits = null;
  74.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  75.     #[Groups(['show_search'])]
  76.     private ?string $stocks_detail = null;
  77.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  78.     private ?string $cycle_de_vie = null;
  79.     
  80.     public function __construct()
  81.     {
  82.         $this->update_by = new ArrayCollection();
  83.         $this->orderFabricationTypes = new ArrayCollection();
  84.         $this->orderFabricationComponentStatuses = new ArrayCollection();
  85.     }
  86.     public function getId(): ?int
  87.     {
  88.         return $this->id;
  89.     }
  90.     public function getNumeroDevis(): ?string
  91.     {
  92.         return $this->numero_devis;
  93.     }
  94.     public function setNumeroDevis(string $numero_devis): self
  95.     {
  96.         $this->numero_devis = $numero_devis;
  97.         return $this;
  98.     }
  99.     public function getStatus(): ?string
  100.     {
  101.         return $this->status;
  102.     }
  103.     public function setStatus(string $status): self
  104.     {
  105.         $this->status = $status;
  106.         return $this;
  107.     }
  108.     public function getStatusOdoo(): ?string
  109.     {
  110.         return $this->status_odoo;
  111.     }
  112.     public function setStatusOdoo(?string $status_odoo): self
  113.     {
  114.         $this->status_odoo = $status_odoo;
  115.         return $this;
  116.     }
  117.     public function getPrixTotal(): ?float
  118.     {
  119.         return (float)$this->prix_total;
  120.     }
  121.     public function setPrixTotal(float $prix_total): self
  122.     {
  123.         $this->prix_total = $prix_total;
  124.         return $this;
  125.     }
  126.     public function getFamilleProduits(): ?FamilleProduits
  127.     {
  128.         return $this->famille_produits;
  129.     }
  130.     public function setFamilleProduits(?FamilleProduits $famille_produits): self
  131.     {
  132.         $this->famille_produits = $famille_produits;
  133.         return $this;
  134.     }
  135.     public function getData(): ?string
  136.     {
  137.         return $this->data;
  138.     }
  139.     public function setData(string $data): self
  140.     {
  141.         $this->data = $data;
  142.         return $this;
  143.     }
  144.     public function getDataPrixQty(): ?string
  145.     {
  146.         return $this->data_prix_qty;
  147.     }
  148.     public function setDataPrixQty(string $data_prix_qty): self
  149.     {
  150.         $this->data_prix_qty = $data_prix_qty;
  151.         return $this;
  152.     }
  153.     public function getDateCreation(): ?\DateTimeInterface
  154.     {
  155.         return $this->date_creation;
  156.     }
  157.     public function setDateCreation(\DateTimeInterface $date_creation): self
  158.     {
  159.         $this->date_creation = $date_creation;
  160.         return $this;
  161.     }
  162.     public function getDateModification(): ?\DateTimeInterface
  163.     {
  164.         return $this->date_modification;
  165.     }
  166.     public function setDateModification(\DateTimeInterface $date_modification): self
  167.     {
  168.         $this->date_modification = $date_modification;
  169.         return $this;
  170.     }
  171.     public function getCreerPar(): ?User
  172.     {
  173.         return $this->creer_par;
  174.     }
  175.     public function setCreerPar(?User $creer_par): self
  176.     {
  177.         $this->creer_par = $creer_par;
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return Collection<int, OrderHistory>
  182.      */
  183.     public function getUpdateBy(): Collection
  184.     {
  185.         return $this->update_by;
  186.     }
  187.     public function addUpdateBy(OrderHistory $updateBy): self
  188.     {
  189.         if (!$this->update_by->contains($updateBy)) {
  190.             $this->update_by->add($updateBy);
  191.             $updateBy->setOrderFabrication($this);
  192.         }
  193.         return $this;
  194.     }
  195.     public function removeUpdateBy(OrderHistory $updateBy): self
  196.     {
  197.         if ($this->update_by->removeElement($updateBy)) {
  198.             // set the owning side to null (unless already changed)
  199.             if ($updateBy->getOrderFabrication() === $this) {
  200.                 $updateBy->setOrderFabrication(null);
  201.             }
  202.         }
  203.         return $this;
  204.     }
  205.     public function getClients(): ?Clients
  206.     {
  207.         return $this->clients;
  208.     }
  209.     public function setClients(?Clients $clients): self
  210.     {
  211.         $this->clients = $clients;
  212.         return $this;
  213.     }
  214.     /**
  215.      * @return Collection<int, OrderFabricationTypes>
  216.      */
  217.     public function getOrderFabricationTypes(): Collection
  218.     {
  219.         return $this->orderFabricationTypes;
  220.     }
  221.     public function addOrderFabricationType(OrderFabricationTypes $orderFabricationType): self
  222.     {
  223.         if (!$this->orderFabricationTypes->contains($orderFabricationType)) {
  224.             $this->orderFabricationTypes->add($orderFabricationType);
  225.             $orderFabricationType->addOrderFabrication($this);
  226.         }
  227.         return $this;
  228.     }
  229.     public function removeOrderFabricationType(OrderFabricationTypes $orderFabricationType): self
  230.     {
  231.         if ($this->orderFabricationTypes->removeElement($orderFabricationType)) {
  232.             $orderFabricationType->removeOrderFabrication($this);
  233.         }
  234.         return $this;
  235.     }
  236.     /**
  237.      * @return Collection<int, OrderFabricationComponentStatus>
  238.      */
  239.     public function getOrderFabricationComponentStatuses(): Collection
  240.     {
  241.         return $this->orderFabricationComponentStatuses;
  242.     }
  243.     public function addOrderFabricationComponentStatus(OrderFabricationComponentStatus $orderFabricationComponentStatus): self
  244.     {
  245.         if (!$this->orderFabricationComponentStatuses->contains($orderFabricationComponentStatus)) {
  246.             $this->orderFabricationComponentStatuses->add($orderFabricationComponentStatus);
  247.             $orderFabricationComponentStatus->setOrderFabrication($this);
  248.         }
  249.         return $this;
  250.     }
  251.     public function removeOrderFabricationComponentStatus(OrderFabricationComponentStatus $orderFabricationComponentStatus): self
  252.     {
  253.         if ($this->orderFabricationComponentStatuses->removeElement($orderFabricationComponentStatus)) {
  254.             // set the owning side to null (unless already changed)
  255.             if ($orderFabricationComponentStatus->getOrderFabrication() === $this) {
  256.                 $orderFabricationComponentStatus->setOrderFabrication(null);
  257.             }
  258.         }
  259.         return $this;
  260.     }
  261.     public function getDateDeFabrication(): ?\DateTimeInterface
  262.     {
  263.         return $this->date_de_fabrication;
  264.     }
  265.     public function setDateDeFabrication(?\DateTimeInterface $date_de_fabrication): self
  266.     {
  267.         $this->date_de_fabrication = $date_de_fabrication;
  268.         return $this;
  269.     }
  270.     public function getDateDeLivraison(): ?\DateTimeInterface
  271.     {
  272.         return $this->date_de_livraison;
  273.     }
  274.     public function setDateDeLivraison(?\DateTimeInterface $date_de_livraison): self
  275.     {
  276.         $this->date_de_livraison = $date_de_livraison;
  277.         return $this;
  278.     }
  279.     public function getSociteDeFabrication(): ?Company
  280.     {
  281.         return $this->socite_de_fabrication;
  282.     }
  283.     public function setSociteDeFabrication(?Company $socite_de_fabrication): self
  284.     {
  285.         $this->socite_de_fabrication = $socite_de_fabrication;
  286.         return $this;
  287.     }
  288.     public function getPriority(): ?int
  289.     {
  290.         return $this->priority;
  291.     }
  292.     public function setPriority(?int $priority): self
  293.     {
  294.         $this->priority = $priority;
  295.         return $this;
  296.     }
  297.     public function getSuivisProduits(): ?string
  298.     {
  299.         return $this->suivis_produits;
  300.     }
  301.     public function setSuivisProduits(?string $suivis_produits): self
  302.     {
  303.         $this->suivis_produits = $suivis_produits;
  304.         return $this;
  305.     }
  306.     public function getStocksDetail(): ?array
  307.     {
  308.         return json_decode($this->stocks_detail,true);
  309.     }
  310.     public function setStocksDetail(?string $stocks_detail): self
  311.     {
  312.         $this->stocks_detail = $stocks_detail;
  313.         return $this;
  314.     }
  315.     public function getCycleDeVie(): ?array
  316.     {
  317.         return $this->cycle_de_vie!=null?json_decode($this->cycle_de_vie,true):[];
  318.     }
  319.     public function setCycleDeVie(?array $cycle_de_vie): self
  320.     {
  321.         $this->cycle_de_vie = json_encode($cycle_de_vie);
  322.         return $this;
  323.     }
  324. }