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.     //
  124.     public function getId(): ?string
  125.     {
  126.         return $this->id;
  127.     }
  128.     public function getSlug(): ?string
  129.     {
  130.         return $this->slug;
  131.     }
  132.     public function setSlug(string $slug): static
  133.     {
  134.         $this->slug $slug;
  135.         return $this;
  136.     }
  137.     public function getValue(): ?string
  138.     {
  139.         return $this->value;
  140.     }
  141.     public function setValue(string $value): static
  142.     {
  143.         $this->value $value;
  144.         return $this;
  145.     }
  146.     public function getAdvice(): ?string
  147.     {
  148.         return $this->advice;
  149.     }
  150.     public function setAdvice(string $advice): static
  151.     {
  152.         $this->advice $advice;
  153.         return $this;
  154.     }
  155.     public function isPos(): ?bool
  156.     {
  157.         return $this->pos;
  158.     }
  159.     public function setPos(bool $pos): static
  160.     {
  161.         $this->pos $pos;
  162.         return $this;
  163.     }
  164.     public function isOnlyBackoffice(): ?bool
  165.     {
  166.         return $this->onlyBackoffice;
  167.     }
  168.     public function setOnlyBackoffice(bool $onlyBackoffice): static
  169.     {
  170.         $this->onlyBackoffice $onlyBackoffice;
  171.         return $this;
  172.     }
  173.     public function isProducerWithdrawMandatory(): ?bool
  174.     {
  175.         return $this->producerWithdrawMandatory;
  176.     }
  177.     public function setProducerWithdrawMandatory(bool $producerWithdrawMandatory): static
  178.     {
  179.         $this->producerWithdrawMandatory $producerWithdrawMandatory;
  180.         return $this;
  181.     }
  182.     public function isProducerInstallationMandatory(): ?bool
  183.     {
  184.         return $this->producerInstallationMandatory;
  185.     }
  186.     public function setProducerInstallationMandatory(bool $producerInstallationMandatory): static
  187.     {
  188.         $this->producerInstallationMandatory $producerInstallationMandatory;
  189.         return $this;
  190.     }
  191.     public function isProducerActualMandatory(): ?bool
  192.     {
  193.         return $this->producerActualMandatory;
  194.     }
  195.     public function setProducerActualMandatory(bool $producerActualMandatory): static
  196.     {
  197.         $this->producerActualMandatory $producerActualMandatory;
  198.         return $this;
  199.     }
  200.     public function isSupplierWithdrawMandatory(): ?bool
  201.     {
  202.         return $this->supplierWithdrawMandatory;
  203.     }
  204.     public function setSupplierWithdrawMandatory(bool $supplierWithdrawMandatory): static
  205.     {
  206.         $this->supplierWithdrawMandatory $supplierWithdrawMandatory;
  207.         return $this;
  208.     }
  209.     public function isSupplierInstallationMandatory(): ?bool
  210.     {
  211.         return $this->supplierInstallationMandatory;
  212.     }
  213.     public function setSupplierInstallationMandatory(bool $supplierInstallationMandatory): static
  214.     {
  215.         $this->supplierInstallationMandatory $supplierInstallationMandatory;
  216.         return $this;
  217.     }
  218.     public function isSupplierActualMandatory(): ?bool
  219.     {
  220.         return $this->supplierActualMandatory;
  221.     }
  222.     public function setSupplierActualMandatory(bool $supplierActualMandatory): static
  223.     {
  224.         $this->supplierActualMandatory $supplierActualMandatory;
  225.         return $this;
  226.     }
  227.     public function isVisible(): ?bool
  228.     {
  229.         return $this->visible;
  230.     }
  231.     public function setVisible(bool $visible): static
  232.     {
  233.         $this->visible $visible;
  234.         return $this;
  235.     }
  236.     /**
  237.      * @return Collection<int, InterventionActivity>
  238.      */
  239.     public function getActivities(): Collection
  240.     {
  241.         return $this->activities;
  242.     }
  243.     public function addActivity(InterventionActivity $activity): static
  244.     {
  245.         if (!$this->activities->contains($activity)) {
  246.             $this->activities->add($activity);
  247.             $activity->setType($this);
  248.         }
  249.         return $this;
  250.     }
  251.     public function removeActivity(InterventionActivity $activity): static
  252.     {
  253.         if ($this->activities->removeElement($activity)) {
  254.             // set the owning side to null (unless already changed)
  255.             if ($activity->getType() === $this) {
  256.                 $activity->setType(null);
  257.             }
  258.         }
  259.         return $this;
  260.     }
  261.     /**
  262.      * @return Collection<int, OperationGroup>
  263.      */
  264.     public function getOperationGroups(): Collection
  265.     {
  266.         return $this->operationGroups;
  267.     }
  268.     public function addOperationGroup(OperationGroup $operationGroup): static
  269.     {
  270.         if (!$this->operationGroups->contains($operationGroup)) {
  271.             $this->operationGroups->add($operationGroup);
  272.         }
  273.         return $this;
  274.     }
  275.     public function removeOperationGroup(OperationGroup $operationGroup): static
  276.     {
  277.         $this->operationGroups->removeElement($operationGroup);
  278.         return $this;
  279.     }
  280. }