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