src/Entity/Slave/InterventionActivity.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_s_intervention_activity")
  9.  * @ORM\Entity
  10.  */
  11. class InterventionActivity
  12. {    
  13.     public function exportCSVSummary(){
  14.         $entered false;
  15.         $html $this->getType().': ';
  16.         if($this->getType()->isProducerWithdrawMandatory()){
  17.             if($entered$html.= ' --- ';
  18.             if($this->getProductWithdraw() == null)
  19.                 $html.= 'Ritiro (Prod. '.$this->getProducerWithdraw().')';
  20.             else
  21.                 $html.= 'Ritiro ('.$this->getProductWithdraw()->getModel()->getName().' - Prod. '.$this->getProductWithdraw()->getCodeProducer().')';
  22.             $entered true;
  23.         }
  24.         if($this->getType()->isProducerInstallationMandatory()){
  25.             if($entered$html.= ' --- ';
  26.             if($this->getProductInstallation() == null)
  27.                 $html.= 'Installazione (Prod. '.$this->getProducerInstallation().')';
  28.             else
  29.                 $html.= 'Installazione ('.$this->getProductInstallation()->getModel()->getName().' - Prod. '.$this->getProductInstallation()->getCodeProducer().')';
  30.             $entered true;
  31.         }
  32.         if($this->getType()->isProducerActualMandatory()){
  33.             if($entered$html.= ' --- ';
  34.             if($this->getProductActual() == null)
  35.                 $html.= 'Attuale (Prod. '.$this->getProducerActual().')';
  36.             else
  37.                 $html.= 'Attuale ('.$this->getProductActual()->getModel()->getName().' - Prod. '.$this->getProductActual()->getCodeProducer().')';
  38.             $entered true;
  39.         }
  40.         if($this->getType()->isSupplierWithdrawMandatory()){
  41.             if($entered$html.= ' --- ';
  42.             if($this->getProductWithdraw() == null)
  43.                 $html.= 'Ritiro (Forn. '.$this->getSupplierWithdraw().')';
  44.             else
  45.                 $html.= 'Ritiro ('.$this->getProductWithdraw()->getModel()->getName().' - Forn. '.$this->getProductWithdraw()->getCodeSupplier().')';
  46.             $entered true;
  47.         }
  48.         if($this->getType()->isSupplierInstallationMandatory()){
  49.             if($entered$html.= ' --- ';
  50.             if($this->getProductInstallation() == null)
  51.                 $html.= 'Installazione (Forn. '.$this->getSupplierInstallation().')';
  52.             else
  53.                 $html.= 'Installazione ('.$this->getProductInstallation()->getModel()->getName().' - Forn. '.$this->getProductInstallation()->getCodeSupplier().')';
  54.             $entered true;
  55.         }
  56.         if($this->getType()->isSupplierActualMandatory()){
  57.             if($entered$html.= ' --- ';
  58.             if($this->getProductActual() == null)
  59.                 $html.= 'Attuale (Forn. '.$this->getSupplierActual().')';
  60.             else
  61.                 $html.= 'Attuale ('.$this->getProductActual()->getModel()->getName().' - Forn. '.$this->getProductActual()->getCodeSupplier().')';
  62.             $entered true;
  63.         }
  64.         return $html;
  65.     }
  66.     /**
  67.      * @ORM\Column(name="id", type="bigint")
  68.      * @ORM\Id
  69.      * @ORM\GeneratedValue(strategy="AUTO")
  70.      */
  71.     protected $id;
  72.         
  73.     /**
  74.      * @ORM\Column(name="producer_withdraw", type="string", nullable=true)
  75.      */
  76.     protected $producerWithdraw;
  77.     
  78.     /**
  79.      * @ORM\Column(name="producer_installation", type="string", nullable=true)
  80.      */
  81.     protected $producerInstallation;
  82.     
  83.     /**
  84.      * @ORM\Column(name="producer_actual", type="string", nullable=true)
  85.      */
  86.     protected $producerActual;
  87.     
  88.     /**
  89.      * @ORM\Column(name="supplier_withdraw", type="string", nullable=true)
  90.      */
  91.     protected $supplierWithdraw;
  92.     
  93.     /**
  94.      * @ORM\Column(name="supplier_installation", type="string", nullable=true)
  95.      */
  96.     protected $supplierInstallation;
  97.     
  98.     /**
  99.      * @ORM\Column(name="supplier_actual", type="string", nullable=true)
  100.      */
  101.     protected $supplierActual;
  102.     
  103.     /**
  104.      * @ORM\Column(name="components", type="array", nullable=true)
  105.      */
  106.     protected $components;
  107.     // ManyToOne
  108.         /**
  109.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\InterventionActivityType", inversedBy="activities")
  110.          * @ORM\JoinColumn(name="type_id", referencedColumnName="id")
  111.          */
  112.         private $type;
  113.         /**
  114.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Product", inversedBy="withdrawActivities")
  115.          * @ORM\JoinColumn(name="product_withdraw_id", referencedColumnName="id")
  116.          */
  117.         private $productWithdraw;
  118.         /**
  119.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Product", inversedBy="actualActivities")
  120.          * @ORM\JoinColumn(name="product_actual_id", referencedColumnName="id")
  121.          */
  122.         private $productActual;
  123.         /**
  124.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Product", inversedBy="installationActivities")
  125.          * @ORM\JoinColumn(name="product_installation_id", referencedColumnName="id")
  126.          */
  127.         private $productInstallation;
  128.         /**
  129.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Intervention", inversedBy="activities")
  130.          * @ORM\JoinColumn(name="intervention_id", referencedColumnName="id")
  131.          */
  132.         private $intervention;
  133.     //
  134.     public function getId(): ?string
  135.     {
  136.         return $this->id;
  137.     }
  138.     public function getProducerWithdraw(): ?string
  139.     {
  140.         return $this->producerWithdraw;
  141.     }
  142.     public function setProducerWithdraw(?string $producerWithdraw): static
  143.     {
  144.         $this->producerWithdraw $producerWithdraw;
  145.         return $this;
  146.     }
  147.     public function getProducerInstallation(): ?string
  148.     {
  149.         return $this->producerInstallation;
  150.     }
  151.     public function setProducerInstallation(?string $producerInstallation): static
  152.     {
  153.         $this->producerInstallation $producerInstallation;
  154.         return $this;
  155.     }
  156.     public function getProducerActual(): ?string
  157.     {
  158.         return $this->producerActual;
  159.     }
  160.     public function setProducerActual(?string $producerActual): static
  161.     {
  162.         $this->producerActual $producerActual;
  163.         return $this;
  164.     }
  165.     public function getSupplierWithdraw(): ?string
  166.     {
  167.         return $this->supplierWithdraw;
  168.     }
  169.     public function setSupplierWithdraw(?string $supplierWithdraw): static
  170.     {
  171.         $this->supplierWithdraw $supplierWithdraw;
  172.         return $this;
  173.     }
  174.     public function getSupplierInstallation(): ?string
  175.     {
  176.         return $this->supplierInstallation;
  177.     }
  178.     public function setSupplierInstallation(?string $supplierInstallation): static
  179.     {
  180.         $this->supplierInstallation $supplierInstallation;
  181.         return $this;
  182.     }
  183.     public function getSupplierActual(): ?string
  184.     {
  185.         return $this->supplierActual;
  186.     }
  187.     public function setSupplierActual(?string $supplierActual): static
  188.     {
  189.         $this->supplierActual $supplierActual;
  190.         return $this;
  191.     }
  192.     public function getComponents(): ?array
  193.     {
  194.         return $this->components;
  195.     }
  196.     public function setComponents(?array $components): static
  197.     {
  198.         $this->components $components;
  199.         return $this;
  200.     }
  201.     public function getType(): ?InterventionActivityType
  202.     {
  203.         return $this->type;
  204.     }
  205.     public function setType(?InterventionActivityType $type): static
  206.     {
  207.         $this->type $type;
  208.         return $this;
  209.     }
  210.     public function getProductWithdraw(): ?Product
  211.     {
  212.         return $this->productWithdraw;
  213.     }
  214.     public function setProductWithdraw(?Product $productWithdraw): static
  215.     {
  216.         $this->productWithdraw $productWithdraw;
  217.         return $this;
  218.     }
  219.     public function getProductActual(): ?Product
  220.     {
  221.         return $this->productActual;
  222.     }
  223.     public function setProductActual(?Product $productActual): static
  224.     {
  225.         $this->productActual $productActual;
  226.         return $this;
  227.     }
  228.     public function getProductInstallation(): ?Product
  229.     {
  230.         return $this->productInstallation;
  231.     }
  232.     public function setProductInstallation(?Product $productInstallation): static
  233.     {
  234.         $this->productInstallation $productInstallation;
  235.         return $this;
  236.     }
  237.     public function getIntervention(): ?Intervention
  238.     {
  239.         return $this->intervention;
  240.     }
  241.     public function setIntervention(?Intervention $intervention): static
  242.     {
  243.         $this->intervention $intervention;
  244.         return $this;
  245.     }
  246. }