src/Entity/Slave/InterventionActivityType.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_activity_type")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Slave\InterventionActivityTypeRepository")
  10.  */
  11. class InterventionActivityType
  12. {    
  13.     public function __toString(){
  14.         return $this->getValue();
  15.     }
  16.     
  17.     public function getCanDelete(){
  18.         if(sizeof($this->activities) > 0) return false;
  19.         return true;
  20.     }
  21.     public function displayOGIds(){
  22.         $first true;
  23.         $ids "";
  24.         foreach($this->operationGroups as $og){
  25.             if($first$first false; else $ids.= ",";
  26.             $ids.= $og->getId();
  27.         }
  28.         return $ids;
  29.     }
  30.     
  31.     public function displayOperationGroups()
  32.                                                                                                                                                                                                                                      {
  33.                                                                                                                                                                                                                                          $html '<table class="m_b_none"><tbody>';
  34.                                                                                                                                                                                                                                          foreach($this->operationGroups as $og){
  35.                                                                                                                                                                                                                                              $html.= '<tr><td>'.$og->getValue().'</td></tr>';
  36.                                                                                                                                                                                                                                          }
  37.                                                                                                                                                                                                                                          $html.= '</tbody></table>';
  38.                                                                                                                                                                                                                                          return $html;
  39.                                                                                                                                                                                                                                      }
  40.     
  41.     /**
  42.      * @ORM\Column(name="id", type="bigint")
  43.      * @ORM\Id
  44.      * @ORM\GeneratedValue(strategy="AUTO")
  45.      */
  46.     protected $id;
  47.     
  48.     /**
  49.      * @ORM\Column(name="slug", type="string", length=191, unique=true)
  50.      */
  51.     protected $slug;
  52.     
  53.     /**
  54.      * @ORM\Column(name="value", type="string", length=191)
  55.      */
  56.     protected $value;
  57.     
  58.     /**
  59.      * @ORM\Column(name="advice", type="string", length=191)
  60.      */
  61.     protected $advice;
  62.     /**
  63.      * @ORM\Column(name="pos", type="boolean")
  64.      */
  65.     protected $pos false;
  66.     /**
  67.      * @ORM\Column(name="is_only_backoffice", type="boolean")
  68.      */
  69.     protected $onlyBackoffice false;
  70.         
  71.     /**
  72.      * @ORM\Column(name="producer_withdraw_mandatory", type="boolean")
  73.      */
  74.     protected $producerWithdrawMandatory false;
  75.     
  76.     /**
  77.      * @ORM\Column(name="producer_installation_mandatory", type="boolean")
  78.      */
  79.     protected $producerInstallationMandatory false;
  80.     
  81.     /**
  82.      * @ORM\Column(name="producer_actual_mandatory", type="boolean")
  83.      */
  84.     protected $producerActualMandatory false;
  85.     
  86.     /**
  87.      * @ORM\Column(name="supplier_withdraw_mandatory", type="boolean")
  88.      */
  89.     protected $supplierWithdrawMandatory false;
  90.     
  91.     /**
  92.      * @ORM\Column(name="supplier_installation_mandatory", type="boolean")
  93.      */
  94.     protected $supplierInstallationMandatory false;
  95.     
  96.     /**
  97.      * @ORM\Column(name="supplier_actual_mandatory", type="boolean")
  98.      */
  99.     protected $supplierActualMandatory false;
  100.     
  101.     /**
  102.      * @ORM\Column(name="is_visible", type="boolean")
  103.      */
  104.     protected $visible true;
  105.     // OneToMany
  106.         /**
  107.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\InterventionActivity", mappedBy="type")
  108.          */
  109.         private $activities;
  110.     //
  111.     
  112.     // ManyToMany
  113.         /**
  114.          * @ORM\ManyToMany(targetEntity="App\Entity\Slave\OperationGroup", inversedBy="activityTypes")
  115.          * @ORM\JoinTable(name="eposm_s_join_table_operation_group_activity_type")
  116.          */
  117.         private $operationGroups;
  118.         public function __construct()
  119.         {
  120.             $this->activities = new ArrayCollection();
  121.             $this->operationGroups = new ArrayCollection();
  122.         }
  123.         public function getId(): ?string
  124.         {
  125.             return $this->id;
  126.         }
  127.         public function getSlug(): ?string
  128.         {
  129.             return $this->slug;
  130.         }
  131.         public function setSlug(string $slug): static
  132.         {
  133.             $this->slug $slug;
  134.             return $this;
  135.         }
  136.         public function getValue(): ?string
  137.         {
  138.             return $this->value;
  139.         }
  140.         public function setValue(string $value): static
  141.         {
  142.             $this->value $value;
  143.             return $this;
  144.         }
  145.         public function getAdvice(): ?string
  146.         {
  147.             return $this->advice;
  148.         }
  149.         public function setAdvice(string $advice): static
  150.         {
  151.             $this->advice $advice;
  152.             return $this;
  153.         }
  154.         public function isPos(): ?bool
  155.         {
  156.             return $this->pos;
  157.         }
  158.         public function setPos(bool $pos): static
  159.         {
  160.             $this->pos $pos;
  161.             return $this;
  162.         }
  163.         public function isOnlyBackoffice(): ?bool
  164.         {
  165.             return $this->onlyBackoffice;
  166.         }
  167.         public function setOnlyBackoffice(bool $onlyBackoffice): static
  168.         {
  169.             $this->onlyBackoffice $onlyBackoffice;
  170.             return $this;
  171.         }
  172.         public function isProducerWithdrawMandatory(): ?bool
  173.         {
  174.             return $this->producerWithdrawMandatory;
  175.         }
  176.         public function setProducerWithdrawMandatory(bool $producerWithdrawMandatory): static
  177.         {
  178.             $this->producerWithdrawMandatory $producerWithdrawMandatory;
  179.             return $this;
  180.         }
  181.         public function isProducerInstallationMandatory(): ?bool
  182.         {
  183.             return $this->producerInstallationMandatory;
  184.         }
  185.         public function setProducerInstallationMandatory(bool $producerInstallationMandatory): static
  186.         {
  187.             $this->producerInstallationMandatory $producerInstallationMandatory;
  188.             return $this;
  189.         }
  190.         public function isProducerActualMandatory(): ?bool
  191.         {
  192.             return $this->producerActualMandatory;
  193.         }
  194.         public function setProducerActualMandatory(bool $producerActualMandatory): static
  195.         {
  196.             $this->producerActualMandatory $producerActualMandatory;
  197.             return $this;
  198.         }
  199.         public function isSupplierWithdrawMandatory(): ?bool
  200.         {
  201.             return $this->supplierWithdrawMandatory;
  202.         }
  203.         public function setSupplierWithdrawMandatory(bool $supplierWithdrawMandatory): static
  204.         {
  205.             $this->supplierWithdrawMandatory $supplierWithdrawMandatory;
  206.             return $this;
  207.         }
  208.         public function isSupplierInstallationMandatory(): ?bool
  209.         {
  210.             return $this->supplierInstallationMandatory;
  211.         }
  212.         public function setSupplierInstallationMandatory(bool $supplierInstallationMandatory): static
  213.         {
  214.             $this->supplierInstallationMandatory $supplierInstallationMandatory;
  215.             return $this;
  216.         }
  217.         public function isSupplierActualMandatory(): ?bool
  218.         {
  219.             return $this->supplierActualMandatory;
  220.         }
  221.         public function setSupplierActualMandatory(bool $supplierActualMandatory): static
  222.         {
  223.             $this->supplierActualMandatory $supplierActualMandatory;
  224.             return $this;
  225.         }
  226.         public function isVisible(): ?bool
  227.         {
  228.             return $this->visible;
  229.         }
  230.         public function setVisible(bool $visible): static
  231.         {
  232.             $this->visible $visible;
  233.             return $this;
  234.         }
  235.         /**
  236.          * @return Collection<int, InterventionActivity>
  237.          */
  238.         public function getActivities(): Collection
  239.         {
  240.             return $this->activities;
  241.         }
  242.         public function addActivity(InterventionActivity $activity): static
  243.         {
  244.             if (!$this->activities->contains($activity)) {
  245.                 $this->activities->add($activity);
  246.                 $activity->setType($this);
  247.             }
  248.             return $this;
  249.         }
  250.         public function removeActivity(InterventionActivity $activity): static
  251.         {
  252.             if ($this->activities->removeElement($activity)) {
  253.                 // set the owning side to null (unless already changed)
  254.                 if ($activity->getType() === $this) {
  255.                     $activity->setType(null);
  256.                 }
  257.             }
  258.             return $this;
  259.         }
  260.         /**
  261.          * @return Collection<int, OperationGroup>
  262.          */
  263.         public function getOperationGroups(): Collection
  264.         {
  265.             return $this->operationGroups;
  266.         }
  267.         public function addOperationGroup(OperationGroup $operationGroup): static
  268.         {
  269.             if (!$this->operationGroups->contains($operationGroup)) {
  270.                 $this->operationGroups->add($operationGroup);
  271.             }
  272.             return $this;
  273.         }
  274.         public function removeOperationGroup(OperationGroup $operationGroup): static
  275.         {
  276.             $this->operationGroups->removeElement($operationGroup);
  277.             return $this;
  278.         }
  279. }