Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

src/Entity/Secteur.php line 414

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SecteurRepository;
  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. use JsonSerializable;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. /**
  11.  * @ORM\Entity(repositoryClass=SecteurRepository::class)
  12.  */
  13. class Secteur implements JsonSerializable
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $nom;
  25.     /**
  26.      * @ORM\Column(type="text", nullable=true)
  27.      */
  28.     
  29.     private $description;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     
  34.     private $title;
  35.     /**
  36.      * @ORM\Column(type="text", nullable=true)
  37.      */
  38.     
  39.     private $longDescription;
  40.     /**
  41.      * @ORM\Column(type="string", length=255, nullable=true)
  42.      */
  43.     private $couverture;
  44.      /**
  45.      * @ORM\Column(type="string", length=255, nullable=true)
  46.      */
  47.     private $affiche;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $liens;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $googleForms;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=true)
  58.      */
  59.     private $googleFormsResponse;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=AgentSecteur::class, mappedBy="secteur")
  62.      */
  63.     private $agentSecteurs;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity=CoachSecteur::class, mappedBy="secteur")
  66.      */
  67.     private $coachSecteurs;
  68.     /**
  69.      * @var array
  70.      */
  71.     private $agents;
  72.     /**
  73.      * @ORM\OneToMany(targetEntity=Formation::class, mappedBy="secteur")
  74.      */
  75.     private $formations;
  76.     /**
  77.      * @ORM\OneToMany(targetEntity=Contact::class, mappedBy="secteur")
  78.      */
  79.     private $contacts_agent;
  80.     /**
  81.      * @ORM\OneToMany(targetEntity=LiveChatVideo::class, mappedBy="secteur")
  82.      */
  83.     private $liveChatVideos;
  84.     /**
  85.      * @ORM\Column(type="integer", nullable=true, options={"default" : 1})
  86.      */
  87.     private $active;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity=Produit::class, mappedBy="secteur")
  90.      */
  91.     private $produits;
  92.     /**
  93.      * @ORM\ManyToOne(targetEntity=TypeSecteur::class)
  94.      */
  95.     private $type;
  96.     /**
  97.      * @ORM\OneToOne(targetEntity=ContratSecu::class, mappedBy="secteur", cascade={"persist", "remove"})
  98.      */
  99.     private $contratSecu;
  100.     public function __construct()
  101.     {
  102.         $this->agentSecteurs = new ArrayCollection();
  103.         $this->coachSecteurs = new ArrayCollection();
  104.         $this->formations = new ArrayCollection();
  105.         $this->contacts_agent = new ArrayCollection();
  106.         $this->liveChatVideos = new ArrayCollection();
  107.         $this->produits = new ArrayCollection();
  108.         $this->active 1;
  109.     }
  110.     public function getId(): ?int
  111.     {
  112.         return $this->id;
  113.     }
  114.     public function getNom(): ?string
  115.     {
  116.         return $this->nom;
  117.     }
  118.     public function setNom(?string $nom): self
  119.     {
  120.         $this->nom $nom;
  121.         return $this;
  122.     }
  123.     public function getDescription(): ?string
  124.     {
  125.         return $this->description;
  126.     }
  127.     public function setDescription(?string $description): self
  128.     {
  129.         $this->description $description;
  130.         return $this;
  131.     }
  132.     public function getTitle(): ?string
  133.     {
  134.         return $this->title;
  135.     }
  136.     public function setTitle(?string $title): self
  137.     {
  138.         $this->title $title;
  139.         return $this;
  140.     }
  141.     public function getLongDescription(): ?string
  142.     {
  143.         return $this->longDescription;
  144.     }
  145.     public function setLongDescription(?string $longDescription): self
  146.     {
  147.         $this->longDescription $longDescription;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @return Collection<int, AgentSecteur>
  152.      */
  153.     public function getAgentSecteurs(): Collection
  154.     {
  155.         return $this->agentSecteurs;
  156.     }
  157.     public function addAgentSecteur(AgentSecteur $agentSecteur): self
  158.     {
  159.         if (!$this->agentSecteurs->contains($agentSecteur)) {
  160.             $this->agentSecteurs[] = $agentSecteur;
  161.             $agentSecteur->setSecteur($this);
  162.         }
  163.         return $this;
  164.     }
  165.     public function removeAgentSecteur(AgentSecteur $agentSecteur): self
  166.     {
  167.         if ($this->agentSecteurs->removeElement($agentSecteur)) {
  168.             // set the owning side to null (unless already changed)
  169.             if ($agentSecteur->getSecteur() === $this) {
  170.                 $agentSecteur->setSecteur(null);
  171.             }
  172.         }
  173.         return $this;
  174.     }
  175.     /**
  176.      * @return Collection<int, CoachSecteur>
  177.      */
  178.     public function getCoachSecteurs(): Collection
  179.     {
  180.         return $this->coachSecteurs;
  181.     }
  182.     public function addCoachSecteur(CoachSecteur $coachSecteur): self
  183.     {
  184.         if (!$this->coachSecteurs->contains($coachSecteur)) {
  185.             $this->coachSecteurs[] = $coachSecteur;
  186.             $coachSecteur->setSecteur($this);
  187.         }
  188.         return $this;
  189.     }
  190.     public function removeCoachSecteur(CoachSecteur $coachSecteur): self
  191.     {
  192.         if ($this->coachSecteurs->removeElement($coachSecteur)) {
  193.             // set the owning side to null (unless already changed)
  194.             if ($coachSecteur->getSecteur() === $this) {
  195.                 $coachSecteur->setSecteur(null);
  196.             }
  197.         }
  198.         return $this;
  199.     }
  200.     public function getAgents()
  201.     {
  202.         /** @var  $agentSecteur AgentSecteur */
  203.        $agentSecteurs $this->agentSecteurs->toArray();
  204.        foreach($agentSecteurs as $agentSecteur) {
  205.            $this->agents[] = $agentSecteur->getAgent();
  206.        }
  207.        return $this->agents;
  208.     }
  209.     /**
  210.      * @return Collection<int, Formation>
  211.      */
  212.     public function getFormations(): Collection
  213.     {
  214.         return $this->formations;
  215.     }
  216.     public function addFormation(Formation $formation): self
  217.     {
  218.         if (!$this->formations->contains($formation)) {
  219.             $this->formations[] = $formation;
  220.             $formation->setSecteur($this);
  221.         }
  222.         return $this;
  223.     }
  224.     public function removeFormation(Formation $formation): self
  225.     {
  226.         if ($this->formations->removeElement($formation)) {
  227.             // set the owning side to null (unless already changed)
  228.             if ($formation->getSecteur() === $this) {
  229.                 $formation->setSecteur(null);
  230.             }
  231.         }
  232.         return $this;
  233.     }
  234.     /**
  235.      * @return Collection<int, Contact>
  236.      */
  237.     public function getContactsAgent(): Collection
  238.     {
  239.         return $this->contacts_agent;
  240.     }
  241.     public function addContactsAgent(Contact $contactsAgent): self
  242.     {
  243.         if (!$this->contacts_agent->contains($contactsAgent)) {
  244.             $this->contacts_agent[] = $contactsAgent;
  245.             $contactsAgent->setSecteur($this);
  246.         }
  247.         return $this;
  248.     }
  249.     public function removeContactsAgent(Contact $contactsAgent): self
  250.     {
  251.         if ($this->contacts_agent->removeElement($contactsAgent)) {
  252.             // set the owning side to null (unless already changed)
  253.             if ($contactsAgent->getSecteur() === $this) {
  254.                 $contactsAgent->setSecteur(null);
  255.             }
  256.         }
  257.         return $this;
  258.     }
  259.     /**
  260.      * @return Collection<int, LiveChatVideo>
  261.      */
  262.     public function getLiveChatVideos(): Collection
  263.     {
  264.         return $this->liveChatVideos;
  265.     }
  266.     public function addLiveChatVideo(LiveChatVideo $liveChatVideo): self
  267.     {
  268.         if (!$this->liveChatVideos->contains($liveChatVideo)) {
  269.             $this->liveChatVideos[] = $liveChatVideo;
  270.             $liveChatVideo->setSecteur($this);
  271.         }
  272.         return $this;
  273.     }
  274.     public function removeLiveChatVideo(LiveChatVideo $liveChatVideo): self
  275.     {
  276.         if ($this->liveChatVideos->removeElement($liveChatVideo)) {
  277.             // set the owning side to null (unless already changed)
  278.             if ($liveChatVideo->getSecteur() === $this) {
  279.                 $liveChatVideo->setSecteur(null);
  280.             }
  281.         }
  282.         return $this;
  283.     }
  284.     public function getCoachs()
  285.     {
  286.        $coachs = [];
  287.        $coachSecteurs $this->coachSecteurs->toArray();
  288.         /** @var CoachSecteur $coachSecteur */
  289.         foreach($coachSecteurs as $coachSecteur) {
  290.            $coachs[] = $coachSecteur->getCoach();
  291.        }
  292.         return $coachs;
  293.     }
  294.     public function getActive(): ?int
  295.     {
  296.         return !is_null($this->active) ? $this->active 1;
  297.     }
  298.     public function setActive(?int $active): self
  299.     {
  300.         $this->active $active;
  301.         return $this;
  302.     }
  303.     /**
  304.      * @return Collection<int, Produit>
  305.      */
  306.     public function getProduits(): Collection
  307.     {
  308.         return $this->produits;
  309.     }
  310.     public function addProduit(Produit $produit): self
  311.     {
  312.         if (!$this->produits->contains($produit)) {
  313.             $this->produits[] = $produit;
  314.             $produit->setSecteur($this);
  315.         }
  316.         return $this;
  317.     }
  318.     public function removeProduit(Produit $produit): self
  319.     {
  320.         if ($this->produits->removeElement($produit)) {
  321.             // set the owning side to null (unless already changed)
  322.             if ($produit->getSecteur() === $this) {
  323.                 $produit->setSecteur(null);
  324.             }
  325.         }
  326.         return $this;
  327.     }
  328.     public function getType(): ?TypeSecteur
  329.     {
  330.         return $this->type;
  331.     }
  332.     public function setType(?TypeSecteur $type): self
  333.     {
  334.         $this->type $type;
  335.         return $this;
  336.     }
  337.     public function jsonSerialize()
  338.     {
  339.         $vars get_object_vars($this);
  340.         return $vars;
  341.     }
  342.     public function getContratSecu(): ?ContratSecu
  343.     {
  344.         return $this->contratSecu;
  345.     }
  346.     public function setContratSecu(ContratSecu $contratSecu): self
  347.     {
  348.         // set the owning side of the relation if necessary
  349.         if ($contratSecu->getSecteur() !== $this) {
  350.             $contratSecu->setSecteur($this);
  351.         }
  352.         $this->contratSecu $contratSecu;
  353.         return $this;
  354.     }
  355.     public function getCouverture(): ?string
  356.     {
  357.         return $this->couverture;
  358.     }
  359.     public function setCouverture(?string $couverture): static
  360.     {
  361.         $this->couverture $couverture;
  362.         return $this;
  363.     }
  364.     public function getLiens(): ?string
  365.     {
  366.         return $this->liens;
  367.     }
  368.     public function getStructuredLiens(): ?string
  369.     {
  370.         return $this->ensureHttpPrefix($this->liens);
  371.     }
  372.     public function getStructuredGoogleForms(): ?string
  373.     {
  374.         return $this->ensureHttpPrefix($this->googleForms);
  375.     }
  376.     private function ensureHttpPrefix(string $url): string
  377.     {
  378.         // Vérifier si le lien commence par http:// ou https://
  379.         if (!preg_match("~^(?:f|ht)tps?://~i"$url)) {
  380.             // Si le lien ne commence pas par http:// ou https://, ajouter le préfixe http://
  381.             $url 'http://' $url;
  382.         }
  383.         return $url;
  384.     }
  385.     public function setLiens(?string $liens): static
  386.     {
  387.         $this->liens $liens;
  388.         return $this;
  389.     }
  390.     public function getAffiche(): ?string
  391.     {
  392.         return $this->affiche;
  393.     }
  394.     public function setAffiche(?string $affiche): static
  395.     {
  396.         $this->affiche $affiche;
  397.         return $this;
  398.     }
  399.     public function getGoogleForms(): ?string
  400.     {
  401.         return $this->googleForms;
  402.     }
  403.     public function setGoogleForms(?string $googleForms): static
  404.     {
  405.         $this->googleForms $googleForms;
  406.         return $this;
  407.     }
  408.     public function getGoogleFormsResponse(): ?string
  409.     {
  410.         return $this->googleFormsResponse;
  411.     }
  412.     public function setGoogleFormsResponse(?string $googleFormsResponse): static
  413.     {
  414.         $this->googleFormsResponse $googleFormsResponse;
  415.         return $this;
  416.     }
  417.     
  418. }