<?php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection;
use App\Repository\OrderFabricationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: OrderFabricationRepository::class)]
class OrderFabrication
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['show_search'])]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Groups(['show_search'])]
private ?string $numero_devis = null;
#[ORM\Column(length: 255)]
#[Groups(['show_search'])]
private ?string $status = null;
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['show_search'])]
private ?string $status_odoo = null;
#[ORM\Column(length: 255)]
#[Groups(['show_search'])]
private ?float $prix_total = null;
#[ORM\ManyToOne(inversedBy: 'orderFabrications', fetch: 'EXTRA_LAZY')]
#[ORM\JoinColumn(nullable: false)]
private ?FamilleProduits $famille_produits = null;
#[ORM\Column(type: Types::TEXT)]
#[Groups(['show_search'])]
private ?string $data = null;
#[ORM\Column(type: Types::TEXT)]
#[Groups(['show_search'])]
private ?string $data_prix_qty = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
#[Groups(['show_search'])]
private ?\DateTimeInterface $date_creation = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
#[Groups(['show_search'])]
private ?\DateTimeInterface $date_modification = null;
#[ORM\ManyToOne(inversedBy: 'orderFabrications', fetch: 'EXTRA_LAZY')]
#[ORM\JoinColumn(nullable: false)]
#[Groups(['show_search'])]
private ?User $creer_par = null;
#[ORM\OneToMany(mappedBy: 'orderFabrication', targetEntity: OrderHistory::class, fetch: 'EXTRA_LAZY')]
#[Groups(['show_search'])]
private Collection $update_by;
#[ORM\ManyToOne(inversedBy: 'orderFabrications')]
#[Groups(['show_search'])]
private ?Clients $clients = null;
#[ORM\ManyToMany(targetEntity: OrderFabricationTypes::class, mappedBy: 'order_fabrication', fetch: 'EXTRA_LAZY')]
#[Groups(['show_search'])]
private Collection $orderFabricationTypes;
#[ORM\OneToMany(mappedBy: 'order_fabrication', targetEntity: OrderFabricationComponentStatus::class, fetch: 'EXTRA_LAZY')]
#[Groups(['show_search'])]
private Collection $orderFabricationComponentStatuses;
#[Groups(['show_search'])]
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $date_de_fabrication = null;
#[Groups(['show_search'])]
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $date_de_livraison = null;
#[Groups(['show_search'])]
#[ORM\ManyToOne(inversedBy: 'orderFabrications', fetch: 'EXTRA_LAZY')]
#[ORM\JoinColumn(nullable: false)]
private ?Company $socite_de_fabrication = null;
#[ORM\Column(nullable: true)]
private ?int $priority = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $suivis_produits = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['show_search'])]
private ?string $stocks_detail = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $cycle_de_vie = null;
public function __construct()
{
$this->update_by = new ArrayCollection();
$this->orderFabricationTypes = new ArrayCollection();
$this->orderFabricationComponentStatuses = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNumeroDevis(): ?string
{
return $this->numero_devis;
}
public function setNumeroDevis(string $numero_devis): self
{
$this->numero_devis = $numero_devis;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
public function getStatusOdoo(): ?string
{
return $this->status_odoo;
}
public function setStatusOdoo(?string $status_odoo): self
{
$this->status_odoo = $status_odoo;
return $this;
}
public function getPrixTotal(): ?float
{
return (float)$this->prix_total;
}
public function setPrixTotal(float $prix_total): self
{
$this->prix_total = $prix_total;
return $this;
}
public function getFamilleProduits(): ?FamilleProduits
{
return $this->famille_produits;
}
public function setFamilleProduits(?FamilleProduits $famille_produits): self
{
$this->famille_produits = $famille_produits;
return $this;
}
public function getData(): ?string
{
return $this->data;
}
public function setData(string $data): self
{
$this->data = $data;
return $this;
}
public function getDataPrixQty(): ?string
{
return $this->data_prix_qty;
}
public function setDataPrixQty(string $data_prix_qty): self
{
$this->data_prix_qty = $data_prix_qty;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->date_creation;
}
public function setDateCreation(\DateTimeInterface $date_creation): self
{
$this->date_creation = $date_creation;
return $this;
}
public function getDateModification(): ?\DateTimeInterface
{
return $this->date_modification;
}
public function setDateModification(\DateTimeInterface $date_modification): self
{
$this->date_modification = $date_modification;
return $this;
}
public function getCreerPar(): ?User
{
return $this->creer_par;
}
public function setCreerPar(?User $creer_par): self
{
$this->creer_par = $creer_par;
return $this;
}
/**
* @return Collection<int, OrderHistory>
*/
public function getUpdateBy(): Collection
{
return $this->update_by;
}
public function addUpdateBy(OrderHistory $updateBy): self
{
if (!$this->update_by->contains($updateBy)) {
$this->update_by->add($updateBy);
$updateBy->setOrderFabrication($this);
}
return $this;
}
public function removeUpdateBy(OrderHistory $updateBy): self
{
if ($this->update_by->removeElement($updateBy)) {
// set the owning side to null (unless already changed)
if ($updateBy->getOrderFabrication() === $this) {
$updateBy->setOrderFabrication(null);
}
}
return $this;
}
public function getClients(): ?Clients
{
return $this->clients;
}
public function setClients(?Clients $clients): self
{
$this->clients = $clients;
return $this;
}
/**
* @return Collection<int, OrderFabricationTypes>
*/
public function getOrderFabricationTypes(): Collection
{
return $this->orderFabricationTypes;
}
public function addOrderFabricationType(OrderFabricationTypes $orderFabricationType): self
{
if (!$this->orderFabricationTypes->contains($orderFabricationType)) {
$this->orderFabricationTypes->add($orderFabricationType);
$orderFabricationType->addOrderFabrication($this);
}
return $this;
}
public function removeOrderFabricationType(OrderFabricationTypes $orderFabricationType): self
{
if ($this->orderFabricationTypes->removeElement($orderFabricationType)) {
$orderFabricationType->removeOrderFabrication($this);
}
return $this;
}
/**
* @return Collection<int, OrderFabricationComponentStatus>
*/
public function getOrderFabricationComponentStatuses(): Collection
{
return $this->orderFabricationComponentStatuses;
}
public function addOrderFabricationComponentStatus(OrderFabricationComponentStatus $orderFabricationComponentStatus): self
{
if (!$this->orderFabricationComponentStatuses->contains($orderFabricationComponentStatus)) {
$this->orderFabricationComponentStatuses->add($orderFabricationComponentStatus);
$orderFabricationComponentStatus->setOrderFabrication($this);
}
return $this;
}
public function removeOrderFabricationComponentStatus(OrderFabricationComponentStatus $orderFabricationComponentStatus): self
{
if ($this->orderFabricationComponentStatuses->removeElement($orderFabricationComponentStatus)) {
// set the owning side to null (unless already changed)
if ($orderFabricationComponentStatus->getOrderFabrication() === $this) {
$orderFabricationComponentStatus->setOrderFabrication(null);
}
}
return $this;
}
public function getDateDeFabrication(): ?\DateTimeInterface
{
return $this->date_de_fabrication;
}
public function setDateDeFabrication(?\DateTimeInterface $date_de_fabrication): self
{
$this->date_de_fabrication = $date_de_fabrication;
return $this;
}
public function getDateDeLivraison(): ?\DateTimeInterface
{
return $this->date_de_livraison;
}
public function setDateDeLivraison(?\DateTimeInterface $date_de_livraison): self
{
$this->date_de_livraison = $date_de_livraison;
return $this;
}
public function getSociteDeFabrication(): ?Company
{
return $this->socite_de_fabrication;
}
public function setSociteDeFabrication(?Company $socite_de_fabrication): self
{
$this->socite_de_fabrication = $socite_de_fabrication;
return $this;
}
public function getPriority(): ?int
{
return $this->priority;
}
public function setPriority(?int $priority): self
{
$this->priority = $priority;
return $this;
}
public function getSuivisProduits(): ?string
{
return $this->suivis_produits;
}
public function setSuivisProduits(?string $suivis_produits): self
{
$this->suivis_produits = $suivis_produits;
return $this;
}
public function getStocksDetail(): ?array
{
return json_decode($this->stocks_detail,true);
}
public function setStocksDetail(?string $stocks_detail): self
{
$this->stocks_detail = $stocks_detail;
return $this;
}
public function getCycleDeVie(): ?array
{
return $this->cycle_de_vie!=null?json_decode($this->cycle_de_vie,true):[];
}
public function setCycleDeVie(?array $cycle_de_vie): self
{
$this->cycle_de_vie = json_encode($cycle_de_vie);
return $this;
}
}