src/Entity/Slave/InterventionExtra.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use App\Twig\Extension\AppExtension;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Table(name="eposm_s_intervention_extra")
  10.  * @ORM\Entity
  11.  */
  12. class InterventionExtra
  13. {    
  14.     public function displayType()
  15.     {
  16.         switch($this->getType()){
  17.             case 'hours': return 'Ore'; break;
  18.             case 'cost': return 'Spesa'; break;
  19.             case 'tariff_extra': return 'Integrazione tariffa'; break;
  20.             case 'tariff_out': return 'Tariffa fuori copertura'; break;
  21.             case 'nexi_business': return 'App. Nexi Business'; break;
  22.             case 'softpos': return 'Softpos'; break;
  23.             case 'nbd_installation': return 'Installazioni NBD'; break;
  24.             case 'wrong_release': return 'Release sbagliata'; break;
  25.             default: break;
  26.         }
  27.     }
  28.     public function displayResume(){
  29.         $string "";
  30.         switch($this->getType()){
  31.             case 'hours'$string.= $this->hours.' Ore'; break;
  32.             case 'cost'$string.= 'Spesa'; break;
  33.             case 'tariff_extra':$string.= 'Integrazione tariffa'; break;
  34.             case 'tariff_out'$string.= 'Tariffa fuori copertura'; break;
  35.             case 'nexi_business'$string.= 'App. Nexi Business'; break;
  36.             case 'softpos'$string.= 'Softpos'; break;
  37.             case 'nbd_installation'$string.= 'Installazioni NBD'; break;
  38.             case 'wrong_release'$string.= 'Release sbagliata'; break;
  39.             default: break;
  40.         }
  41.         $string.= " - ".$this->cost." € - ";
  42.         if(!$this->managed)
  43.             $string.=" Da gestire";
  44.         else{
  45.             if($this->approved)
  46.                 $string.=" Approvata";
  47.             else
  48.                 $string.=" Non approvata";
  49.         }
  50.         return $string;
  51.     }
  52.     /**
  53.      * @ORM\Column(name="id", type="bigint")
  54.      * @ORM\Id
  55.      * @ORM\GeneratedValue(strategy="AUTO")
  56.      */
  57.     protected $id;
  58.     
  59.     /**
  60.      * @ORM\Column(name="type", type="string", length=191)
  61.      */
  62.     protected $type;
  63.     
  64.     /**
  65.      * @ORM\Column(name="cost", type="decimal", scale=2, nullable=true)
  66.      */
  67.     protected $cost;
  68.     /**
  69.      * @ORM\Column(name="revenue", type="decimal", scale=2, nullable=true)
  70.      */
  71.     protected $revenue;
  72.     /**
  73.      * @ORM\Column(name="hours", type="string", length=191, nullable=true)
  74.      */
  75.     protected $hours;
  76.     /**
  77.      * @ORM\Column(name="file_path", type="string", length=191, nullable=true)
  78.      */
  79.     protected $filePath;
  80.     
  81.     /**
  82.      * @ORM\Column(name="notes", type="text", nullable=true)
  83.      */
  84.     protected $notes;
  85.     
  86.     /**
  87.      * @ORM\Column(name="is_tariff_out", type="boolean")
  88.      */
  89.     protected $tariffOut false;
  90.     
  91.     /**
  92.      * @ORM\Column(name="is_approved", type="boolean", nullable=true)
  93.      */
  94.     protected $approved;
  95.     
  96.     /**
  97.      * @ORM\Column(name="is_managed", type="boolean")
  98.      */
  99.     protected $managed false;
  100.     
  101.     // ManyToOne
  102.         /**
  103.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Intervention", inversedBy="extras")
  104.          * @ORM\JoinColumn(name="intervention_id", referencedColumnName="id")
  105.          */
  106.         private $intervention;
  107.     public function getId(): ?string
  108.     {
  109.         return $this->id;
  110.     }
  111.     public function getType(): ?string
  112.     {
  113.         return $this->type;
  114.     }
  115.     public function setType(string $type): static
  116.     {
  117.         $this->type $type;
  118.         return $this;
  119.     }
  120.     public function getCost(): ?string
  121.     {
  122.         return $this->cost;
  123.     }
  124.     public function setCost(?string $cost): static
  125.     {
  126.         $this->cost $cost;
  127.         return $this;
  128.     }
  129.     public function getHours(): ?string
  130.     {
  131.         return $this->hours;
  132.     }
  133.     public function setHours(?string $hours): static
  134.     {
  135.         $this->hours $hours;
  136.         return $this;
  137.     }
  138.     public function getFilePath(): ?string
  139.     {
  140.         return $this->filePath;
  141.     }
  142.     public function setFilePath(?string $filePath): static
  143.     {
  144.         $this->filePath $filePath;
  145.         return $this;
  146.     }
  147.     public function getNotes(): ?string
  148.     {
  149.         return $this->notes;
  150.     }
  151.     public function setNotes(?string $notes): static
  152.     {
  153.         $this->notes $notes;
  154.         return $this;
  155.     }
  156.     public function isApproved(): ?bool
  157.     {
  158.         return $this->approved;
  159.     }
  160.     public function setApproved(?bool $approved): static
  161.     {
  162.         $this->approved $approved;
  163.         return $this;
  164.     }
  165.     public function isManaged(): ?bool
  166.     {
  167.         return $this->managed;
  168.     }
  169.     public function setManaged(bool $managed): static
  170.     {
  171.         $this->managed $managed;
  172.         return $this;
  173.     }
  174.     public function getIntervention(): ?Intervention
  175.     {
  176.         return $this->intervention;
  177.     }
  178.     public function setIntervention(?Intervention $intervention): static
  179.     {
  180.         $this->intervention $intervention;
  181.         return $this;
  182.     }
  183.     public function isTariffOut(): ?bool
  184.     {
  185.         return $this->tariffOut;
  186.     }
  187.     public function setTariffOut(bool $tariffOut): static
  188.     {
  189.         $this->tariffOut $tariffOut;
  190.         return $this;
  191.     }
  192.     public function getRevenue(): ?string
  193.     {
  194.         return $this->revenue;
  195.     }
  196.     public function setRevenue(?string $revenue): static
  197.     {
  198.         $this->revenue $revenue;
  199.         return $this;
  200.     }
  201. }