src/Entity/Operation.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\OperationRepository")
  6.  */
  7. class Operation
  8. {
  9.     /**
  10.      * @ORM\Id()
  11.      * @ORM\GeneratedValue()
  12.      * @ORM\Column(type="integer")
  13.      */
  14.     private $id;
  15.     /**
  16.      * @ORM\Column(type="datetime")
  17.      */
  18.     private $date_operation;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=true)
  21.      */
  22.     private $ref_op;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\SousJacent", inversedBy="operations")
  25.      * @ORM\JoinColumn(onDelete="CASCADE")
  26.      */
  27.     private $sous_jacent;
  28.     /**
  29.      * @ORM\Column(type="integer", nullable=true)
  30.      */
  31.     private $vol_op;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity="App\Entity\Unite", inversedBy="operations")
  34.      * @ORM\JoinColumn(onDelete="CASCADE")
  35.      */
  36.     private $unite;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private $destinantion;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $delai;
  45.     /**
  46.      * @ORM\Column(type="integer", nullable=true)
  47.      */
  48.     private $montant_transaction;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\Devise", inversedBy="operations")
  51.      * @ORM\JoinColumn(onDelete="CASCADE")
  52.      */
  53.     private $devise;
  54.     /**
  55.      * @ORM\Column(type="datetime")
  56.      */
  57.     private $created_at;
  58.     /**
  59.      * @ORM\ManyToOne(targetEntity="App\Entity\AdminDonneurOrdre", inversedBy="operations")
  60.      * @ORM\JoinColumn(onDelete="CASCADE")
  61.      */
  62.     private $vendeur;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity="App\Entity\Status", inversedBy="operations")
  65.      * @ORM\JoinColumn(onDelete="CASCADE")
  66.      */
  67.     private $status;
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity="App\Entity\Incoterm", inversedBy="operations")
  70.      * @ORM\JoinColumn(onDelete="CASCADE")
  71.      */
  72.     private $base;
  73.     /**
  74.      * @ORM\ManyToOne(targetEntity="App\Entity\ModeDeTransport", inversedBy="operations")
  75.      * @ORM\JoinColumn(onDelete="CASCADE")
  76.      */
  77.     private $mode_de_transport;
  78.     /**
  79.      * @ORM\ManyToOne(targetEntity="App\Entity\AdminDonneurOrdre", inversedBy="operationAcheteur")
  80.      */
  81.     private $acheteur;
  82.     /**
  83.      * @ORM\Column(type="datetime", nullable=true)
  84.      */
  85.     private $date_execution;
  86.     /**
  87.      * @ORM\Column(type="string", length=255, nullable=true)
  88.      */
  89.     private $lia;
  90.     /**
  91.      * @ORM\ManyToOne(targetEntity="App\Entity\Products", inversedBy="operations")
  92.      */
  93.     private $filiere;
  94.     public function __construct()
  95.     {
  96.         $this->created_at = new \DateTime('now');
  97.         if (!isset($this->ref_op)) {
  98.             $this->ref_op 'OP' random_int(1900) . date('s');
  99.         } else {
  100.             $this->ref_op 'OP' random_int(1900) . date('s');
  101.         }
  102.     }
  103.     public function getId(): ?int
  104.     {
  105.         return $this->id;
  106.     }
  107.     public function getDateOperation(): ?\DateTimeInterface
  108.     {
  109.         return $this->date_operation;
  110.     }
  111.     public function setDateOperation(\DateTimeInterface $date_operation): self
  112.     {
  113.         $this->date_operation $date_operation;
  114.         return $this;
  115.     }
  116.     public function getRefOp(): ?string
  117.     {
  118.         return $this->ref_op;
  119.     }
  120.     public function setRefOp(?string $ref_op): self
  121.     {
  122.         $this->ref_op $ref_op;
  123.         return $this;
  124.     }
  125.     public function getSousJacent(): ?SousJacent
  126.     {
  127.         return $this->sous_jacent;
  128.     }
  129.     public function setSousJacent(?SousJacent $sous_jacent): self
  130.     {
  131.         $this->sous_jacent $sous_jacent;
  132.         return $this;
  133.     }
  134.     public function getVolOp(): ?int
  135.     {
  136.         return $this->vol_op;
  137.     }
  138.     public function setVolOp(?int $vol_op): self
  139.     {
  140.         $this->vol_op $vol_op;
  141.         return $this;
  142.     }
  143.     public function getUnite(): ?Unite
  144.     {
  145.         return $this->unite;
  146.     }
  147.     public function setUnite(?Unite $unite): self
  148.     {
  149.         $this->unite $unite;
  150.         return $this;
  151.     }
  152.     public function getDestinantion(): ?string
  153.     {
  154.         return $this->destinantion;
  155.     }
  156.     public function setDestinantion(?string $destinantion): self
  157.     {
  158.         $this->destinantion $destinantion;
  159.         return $this;
  160.     }
  161.     public function getDelai(): ?string
  162.     {
  163.         return $this->delai;
  164.     }
  165.     public function setDelai(?string $delai): self
  166.     {
  167.         $this->delai $delai;
  168.         return $this;
  169.     }
  170.     public function getMontantTransaction(): ?int
  171.     {
  172.         return $this->montant_transaction;
  173.     }
  174.     public function setMontantTransaction(?int $montant_transaction): self
  175.     {
  176.         $this->montant_transaction $montant_transaction;
  177.         return $this;
  178.     }
  179.     public function getDevise(): ?Devise
  180.     {
  181.         return $this->devise;
  182.     }
  183.     public function setDevise(?Devise $devise): self
  184.     {
  185.         $this->devise $devise;
  186.         return $this;
  187.     }
  188.     public function getCreatedAt(): ?\DateTimeInterface
  189.     {
  190.         return $this->created_at;
  191.     }
  192.     public function setCreatedAt(\DateTimeInterface $created_at): self
  193.     {
  194.         $this->created_at $created_at;
  195.         return $this;
  196.     }
  197.     public function getVendeur(): ?AdminDonneurOrdre
  198.     {
  199.         return $this->vendeur;
  200.     }
  201.     public function setVendeur(?AdminDonneurOrdre $vendeur): self
  202.     {
  203.         $this->vendeur $vendeur;
  204.         return $this;
  205.     }
  206.     public function getStatus(): ?Status
  207.     {
  208.         return $this->status;
  209.     }
  210.     public function setStatus(?Status $status): self
  211.     {
  212.         $this->status $status;
  213.         return $this;
  214.     }
  215.     public function getBase(): ?Incoterm
  216.     {
  217.         return $this->base;
  218.     }
  219.     public function setBase(?Incoterm $base): self
  220.     {
  221.         $this->base $base;
  222.         return $this;
  223.     }
  224.     public function getModeDeTransport(): ?ModeDeTransport
  225.     {
  226.         return $this->mode_de_transport;
  227.     }
  228.     public function setModeDeTransport(?ModeDeTransport $mode_de_transport): self
  229.     {
  230.         $this->mode_de_transport $mode_de_transport;
  231.         return $this;
  232.     }
  233.     public function __toString(): string
  234.     {
  235.         return $this->ref_op;
  236.     }
  237.     public function getAcheteur(): ?AdminDonneurOrdre
  238.     {
  239.         return $this->acheteur;
  240.     }
  241.     public function setAcheteur(?AdminDonneurOrdre $acheteur): self
  242.     {
  243.         $this->acheteur $acheteur;
  244.         return $this;
  245.     }
  246.     public function getDateExecution(): ?\DateTimeInterface
  247.     {
  248.         return $this->date_execution;
  249.     }
  250.     public function setDateExecution(?\DateTimeInterface $date_execution): self
  251.     {
  252.         $this->date_execution $date_execution;
  253.         return $this;
  254.     }
  255.     public function getLia(): ?string
  256.     {
  257.         return $this->lia;
  258.     }
  259.     public function setLia(?string $lia): self
  260.     {
  261.         $this->lia $lia;
  262.         return $this;
  263.     }
  264.     public function getFiliere(): ?Products
  265.     {
  266.         return $this->filiere;
  267.     }
  268.     public function setFiliere(?Products $filiere): self
  269.     {
  270.         $this->filiere $filiere;
  271.         return $this;
  272.     }
  273. }