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.         public function getId(): ?string
  95.         {
  96.             return $this->id;
  97.         }
  98.         public function getType(): ?string
  99.         {
  100.             return $this->type;
  101.         }
  102.         public function setType(string $type): static
  103.         {
  104.             $this->type $type;
  105.             return $this;
  106.         }
  107.         public function getCost(): ?string
  108.         {
  109.             return $this->cost;
  110.         }
  111.         public function setCost(?string $cost): static
  112.         {
  113.             $this->cost $cost;
  114.             return $this;
  115.         }
  116.         public function getHours(): ?string
  117.         {
  118.             return $this->hours;
  119.         }
  120.         public function setHours(?string $hours): static
  121.         {
  122.             $this->hours $hours;
  123.             return $this;
  124.         }
  125.         public function getFilePath(): ?string
  126.         {
  127.             return $this->filePath;
  128.         }
  129.         public function setFilePath(?string $filePath): static
  130.         {
  131.             $this->filePath $filePath;
  132.             return $this;
  133.         }
  134.         public function getNotes(): ?string
  135.         {
  136.             return $this->notes;
  137.         }
  138.         public function setNotes(?string $notes): static
  139.         {
  140.             $this->notes $notes;
  141.             return $this;
  142.         }
  143.         public function isApproved(): ?bool
  144.         {
  145.             return $this->approved;
  146.         }
  147.         public function setApproved(?bool $approved): static
  148.         {
  149.             $this->approved $approved;
  150.             return $this;
  151.         }
  152.         public function isManaged(): ?bool
  153.         {
  154.             return $this->managed;
  155.         }
  156.         public function setManaged(bool $managed): static
  157.         {
  158.             $this->managed $managed;
  159.             return $this;
  160.         }
  161.         public function getIntervention(): ?Intervention
  162.         {
  163.             return $this->intervention;
  164.         }
  165.         public function setIntervention(?Intervention $intervention): static
  166.         {
  167.             $this->intervention $intervention;
  168.             return $this;
  169.         }
  170.     public function isTariffOut(): ?bool
  171.     {
  172.         return $this->tariffOut;
  173.     }
  174.     public function setTariffOut(bool $tariffOut): static
  175.     {
  176.         $this->tariffOut $tariffOut;
  177.         return $this;
  178.     }
  179. }