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