src/Entity/Slave/InterventionOutcome.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_outcome")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Slave\InterventionOutcomeRepository")
  10.  */
  11. class InterventionOutcome
  12. {    
  13.     public function __toString(){
  14.         return $this->getValue();
  15.     }
  16.     
  17.     public function getCanDelete(){
  18.         if(sizeof($this->interventions) > 0) return false;
  19.         return true;
  20.     }
  21.     /**
  22.      * @ORM\Column(name="id", type="bigint")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     protected $id;
  27.     
  28.     /**
  29.      * @ORM\Column(name="slug", type="string", length=191, unique=true)
  30.      */
  31.     protected $slug;
  32.     
  33.     /**
  34.      * @ORM\Column(name="value", type="string", length=191)
  35.      */
  36.     protected $value;
  37.     
  38.     /**
  39.      * @ORM\Column(name="is_motivation_required", type="boolean")
  40.      */
  41.     protected $motivationRequired;
  42.     
  43.     /**
  44.      * @ORM\Column(name="is_referent_required", type="boolean")
  45.      */
  46.     protected $referentRequired;
  47.     
  48.     /**
  49.      * @ORM\Column(name="phone_required", type="boolean")
  50.      */
  51.     protected $phoneRequired;
  52.     
  53.     /**
  54.      * @ORM\Column(name="photo_required", type="boolean")
  55.      */
  56.     protected $photoRequired;
  57.     
  58.     /**
  59.      * @ORM\Column(name="suspension_to_required", type="boolean")
  60.      */
  61.     protected $suspensionToRequired;
  62.     
  63.     /**
  64.      * @ORM\Column(name="is_alarm_material", type="boolean")
  65.      */
  66.     protected $alarmMaterial false;
  67.     
  68.     /**
  69.      * @ORM\Column(name="is_visible", type="boolean")
  70.      */
  71.     protected $visible true;
  72.     // ManyToOne
  73.         /**
  74.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\InterventionOutcomeType", inversedBy="outcomes")
  75.          * @ORM\JoinColumn(name="type_id", referencedColumnName="id")
  76.          */
  77.         private $type;
  78.     //
  79.     // OneToMany
  80.         /**
  81.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\Intervention", mappedBy="outcome")
  82.          */
  83.         private $interventions;
  84.         public function __construct()
  85.         {
  86.             $this->interventions = new ArrayCollection();
  87.         }
  88.     //
  89.     public function getId(): ?string
  90.     {
  91.         return $this->id;
  92.     }
  93.     public function getSlug(): ?string
  94.     {
  95.         return $this->slug;
  96.     }
  97.     public function setSlug(string $slug): static
  98.     {
  99.         $this->slug $slug;
  100.         return $this;
  101.     }
  102.     public function getValue(): ?string
  103.     {
  104.         return $this->value;
  105.     }
  106.     public function setValue(string $value): static
  107.     {
  108.         $this->value $value;
  109.         return $this;
  110.     }
  111.     public function isMotivationRequired(): ?bool
  112.     {
  113.         return $this->motivationRequired;
  114.     }
  115.     public function setMotivationRequired(bool $motivationRequired): static
  116.     {
  117.         $this->motivationRequired $motivationRequired;
  118.         return $this;
  119.     }
  120.     public function isReferentRequired(): ?bool
  121.     {
  122.         return $this->referentRequired;
  123.     }
  124.     public function setReferentRequired(bool $referentRequired): static
  125.     {
  126.         $this->referentRequired $referentRequired;
  127.         return $this;
  128.     }
  129.     public function isPhoneRequired(): ?bool
  130.     {
  131.         return $this->phoneRequired;
  132.     }
  133.     public function setPhoneRequired(bool $phoneRequired): static
  134.     {
  135.         $this->phoneRequired $phoneRequired;
  136.         return $this;
  137.     }
  138.     public function isPhotoRequired(): ?bool
  139.     {
  140.         return $this->photoRequired;
  141.     }
  142.     public function setPhotoRequired(bool $photoRequired): static
  143.     {
  144.         $this->photoRequired $photoRequired;
  145.         return $this;
  146.     }
  147.     public function isSuspensionToRequired(): ?bool
  148.     {
  149.         return $this->suspensionToRequired;
  150.     }
  151.     public function setSuspensionToRequired(bool $suspensionToRequired): static
  152.     {
  153.         $this->suspensionToRequired $suspensionToRequired;
  154.         return $this;
  155.     }
  156.     public function isAlarmMaterial(): ?bool
  157.     {
  158.         return $this->alarmMaterial;
  159.     }
  160.     public function setAlarmMaterial(bool $alarmMaterial): static
  161.     {
  162.         $this->alarmMaterial $alarmMaterial;
  163.         return $this;
  164.     }
  165.     public function isVisible(): ?bool
  166.     {
  167.         return $this->visible;
  168.     }
  169.     public function setVisible(bool $visible): static
  170.     {
  171.         $this->visible $visible;
  172.         return $this;
  173.     }
  174.     public function getType(): ?InterventionOutcomeType
  175.     {
  176.         return $this->type;
  177.     }
  178.     public function setType(?InterventionOutcomeType $type): static
  179.     {
  180.         $this->type $type;
  181.         return $this;
  182.     }
  183.     /**
  184.      * @return Collection<int, Intervention>
  185.      */
  186.     public function getInterventions(): Collection
  187.     {
  188.         return $this->interventions;
  189.     }
  190.     public function addIntervention(Intervention $intervention): static
  191.     {
  192.         if (!$this->interventions->contains($intervention)) {
  193.             $this->interventions->add($intervention);
  194.             $intervention->setOutcome($this);
  195.         }
  196.         return $this;
  197.     }
  198.     public function removeIntervention(Intervention $intervention): static
  199.     {
  200.         if ($this->interventions->removeElement($intervention)) {
  201.             // set the owning side to null (unless already changed)
  202.             if ($intervention->getOutcome() === $this) {
  203.                 $intervention->setOutcome(null);
  204.             }
  205.         }
  206.         return $this;
  207.     }
  208. }