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.         public function getId(): ?string
  134.         {
  135.             return $this->id;
  136.         }
  137.         public function getProducerWithdraw(): ?string
  138.         {
  139.             return $this->producerWithdraw;
  140.         }
  141.         public function setProducerWithdraw(?string $producerWithdraw): static
  142.         {
  143.             $this->producerWithdraw $producerWithdraw;
  144.             return $this;
  145.         }
  146.         public function getProducerInstallation(): ?string
  147.         {
  148.             return $this->producerInstallation;
  149.         }
  150.         public function setProducerInstallation(?string $producerInstallation): static
  151.         {
  152.             $this->producerInstallation $producerInstallation;
  153.             return $this;
  154.         }
  155.         public function getProducerActual(): ?string
  156.         {
  157.             return $this->producerActual;
  158.         }
  159.         public function setProducerActual(?string $producerActual): static
  160.         {
  161.             $this->producerActual $producerActual;
  162.             return $this;
  163.         }
  164.         public function getSupplierWithdraw(): ?string
  165.         {
  166.             return $this->supplierWithdraw;
  167.         }
  168.         public function setSupplierWithdraw(?string $supplierWithdraw): static
  169.         {
  170.             $this->supplierWithdraw $supplierWithdraw;
  171.             return $this;
  172.         }
  173.         public function getSupplierInstallation(): ?string
  174.         {
  175.             return $this->supplierInstallation;
  176.         }
  177.         public function setSupplierInstallation(?string $supplierInstallation): static
  178.         {
  179.             $this->supplierInstallation $supplierInstallation;
  180.             return $this;
  181.         }
  182.         public function getSupplierActual(): ?string
  183.         {
  184.             return $this->supplierActual;
  185.         }
  186.         public function setSupplierActual(?string $supplierActual): static
  187.         {
  188.             $this->supplierActual $supplierActual;
  189.             return $this;
  190.         }
  191.         public function getComponents(): ?array
  192.         {
  193.             return $this->components;
  194.         }
  195.         public function setComponents(?array $components): static
  196.         {
  197.             $this->components $components;
  198.             return $this;
  199.         }
  200.         public function getType(): ?InterventionActivityType
  201.         {
  202.             return $this->type;
  203.         }
  204.         public function setType(?InterventionActivityType $type): static
  205.         {
  206.             $this->type $type;
  207.             return $this;
  208.         }
  209.         public function getProductWithdraw(): ?Product
  210.         {
  211.             return $this->productWithdraw;
  212.         }
  213.         public function setProductWithdraw(?Product $productWithdraw): static
  214.         {
  215.             $this->productWithdraw $productWithdraw;
  216.             return $this;
  217.         }
  218.         public function getProductActual(): ?Product
  219.         {
  220.             return $this->productActual;
  221.         }
  222.         public function setProductActual(?Product $productActual): static
  223.         {
  224.             $this->productActual $productActual;
  225.             return $this;
  226.         }
  227.         public function getProductInstallation(): ?Product
  228.         {
  229.             return $this->productInstallation;
  230.         }
  231.         public function setProductInstallation(?Product $productInstallation): static
  232.         {
  233.             $this->productInstallation $productInstallation;
  234.             return $this;
  235.         }
  236.         public function getIntervention(): ?Intervention
  237.         {
  238.             return $this->intervention;
  239.         }
  240.         public function setIntervention(?Intervention $intervention): static
  241.         {
  242.             $this->intervention $intervention;
  243.             return $this;
  244.         }
  245. }