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.         $html '<table class="m_b_none"><tbody>';
  33.         
  34.         foreach($this->operationGroups as $og){
  35.             $html.= '<tr><td>'.$og->getValue().'</td></tr>';
  36.         }
  37.         
  38.         $html.= '</tbody></table>';
  39.         return $html;    
  40.     }
  41.     
  42.     /**
  43.      * @ORM\Column(name="id", type="bigint")
  44.      * @ORM\Id
  45.      * @ORM\GeneratedValue(strategy="AUTO")
  46.      */
  47.     protected $id;
  48.     
  49.     /**
  50.      * @ORM\Column(name="slug", type="string", length=191, unique=true)
  51.      */
  52.     protected $slug;
  53.     
  54.     /**
  55.      * @ORM\Column(name="value", type="string", length=191)
  56.      */
  57.     protected $value;
  58.     
  59.     /**
  60.      * @ORM\Column(name="advice", type="text")
  61.      */
  62.     protected $advice;
  63.     /**
  64.      * @ORM\Column(name="pos", type="boolean")
  65.      */
  66.     protected $pos false;
  67.     /**
  68.      * @ORM\Column(name="is_only_backoffice", type="boolean")
  69.      */
  70.     protected $onlyBackoffice false;
  71.         
  72.     /**
  73.      * @ORM\Column(name="producer_withdraw_mandatory", type="boolean")
  74.      */
  75.     protected $producerWithdrawMandatory false;
  76.     
  77.     /**
  78.      * @ORM\Column(name="producer_installation_mandatory", type="boolean")
  79.      */
  80.     protected $producerInstallationMandatory false;
  81.     
  82.     /**
  83.      * @ORM\Column(name="producer_actual_mandatory", type="boolean")
  84.      */
  85.     protected $producerActualMandatory false;
  86.     
  87.     /**
  88.      * @ORM\Column(name="supplier_withdraw_mandatory", type="boolean")
  89.      */
  90.     protected $supplierWithdrawMandatory false;
  91.     
  92.     /**
  93.      * @ORM\Column(name="supplier_installation_mandatory", type="boolean")
  94.      */
  95.     protected $supplierInstallationMandatory false;
  96.     
  97.     /**
  98.      * @ORM\Column(name="supplier_actual_mandatory", type="boolean")
  99.      */
  100.     protected $supplierActualMandatory false;
  101.     
  102.     /**
  103.      * @ORM\Column(name="is_visible", type="boolean")
  104.      */
  105.     protected $visible true;
  106.     // OneToMany
  107.         /**
  108.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\InterventionActivity", mappedBy="type")
  109.          */
  110.         private $activities;
  111.     //
  112.     
  113.     // ManyToMany
  114.         /**
  115.          * @ORM\ManyToMany(targetEntity="App\Entity\Slave\OperationGroup", inversedBy="activityTypes")
  116.          * @ORM\JoinTable(name="eposm_s_join_table_operation_group_activity_type")
  117.          */
  118.         private $operationGroups;
  119.         public function __construct()
  120.         {
  121.             $this->activities = new ArrayCollection();
  122.             $this->operationGroups = new ArrayCollection();
  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. }