src/Entity/Ptf.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PtfRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. #[ORM\Entity(repositoryClassPtfRepository::class)]
  9. class Ptf
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length255nullabletrue)]
  16.     private $code;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $nom;
  19.     #[ORM\Column(type'string'length255nullabletrue)]
  20.     private $logo;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private $telephone;
  23.     #[ORM\Column(type'string'length255nullabletrue)]
  24.     private $email;
  25.     #[ORM\Column(type'text'nullabletrue)]
  26.     private $horaire;
  27.     #[ORM\Column(type'string'length255nullabletrue)]
  28.     private $url;
  29.     #[ORM\OneToMany(mappedBy'ptf'targetEntityUser::class)]
  30.     private $users;
  31.     #[ORM\ManyToMany(targetEntityGroupe::class, inversedBy'ptfs')]
  32.     private $groupe;
  33.     #[Gedmo\Timestampable(on'create')]
  34.     #[ORM\Column(type'datetime')]
  35.     private $created_at;
  36.     #[Gedmo\Timestampable(on'update')]
  37.     #[ORM\Column(type'datetime')]
  38.     private $updated_at;
  39.     #[ORM\Column(type'integer')]
  40.     private $created_by;
  41.     #[ORM\Column(type'integer')]
  42.     private $updated_by;
  43.     #[ORM\ManyToOne(targetEntityPays::class, inversedBy'ptfs')]
  44.     private $pays;
  45.     #[ORM\Column(length255nullabletrue)]
  46.     private ?string $type null;
  47.     #[ORM\OneToMany(mappedBy'ptf'targetEntityTroika::class)]
  48.     private Collection $troikas;
  49.     public function __construct()
  50.     {
  51.         $this->users = new ArrayCollection();
  52.         $this->groupe = new ArrayCollection();
  53.         $this->troikas = new ArrayCollection();
  54.     }
  55.     public function __toString()
  56.     {
  57.         return $this->getNom() . ' (' $this->getCode().')';
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getCode(): ?string
  64.     {
  65.         return $this->code;
  66.     }
  67.     public function setCode(?string $code): self
  68.     {
  69.         $this->code $code;
  70.         return $this;
  71.     }
  72.     public function getNom(): ?string
  73.     {
  74.         return $this->nom;
  75.     }
  76.     public function setNom(string $nom): self
  77.     {
  78.         $this->nom $nom;
  79.         return $this;
  80.     }
  81.     public function getLogo(): ?string
  82.     {
  83.         return $this->logo;
  84.     }
  85.     public function setLogo(?string $logo): self
  86.     {
  87.         $this->logo $logo;
  88.         return $this;
  89.     }
  90.     public function getTelephone(): ?string
  91.     {
  92.         return $this->telephone;
  93.     }
  94.     public function setTelephone(?string $telephone): self
  95.     {
  96.         $this->telephone $telephone;
  97.         return $this;
  98.     }
  99.     public function getEmail(): ?string
  100.     {
  101.         return $this->email;
  102.     }
  103.     public function setEmail(?string $email): self
  104.     {
  105.         $this->email $email;
  106.         return $this;
  107.     }
  108.     public function getHoraire(): ?string
  109.     {
  110.         return $this->horaire;
  111.     }
  112.     public function setHoraire(?string $horaire): self
  113.     {
  114.         $this->horaire $horaire;
  115.         return $this;
  116.     }
  117.     public function getUrl(): ?string
  118.     {
  119.         return $this->url;
  120.     }
  121.     public function setUrl(?string $url): self
  122.     {
  123.         $this->url $url;
  124.         return $this;
  125.     }
  126.     /**
  127.      * @return Collection<int, User>
  128.      */
  129.     public function getUsers(): Collection
  130.     {
  131.         return $this->users;
  132.     }
  133.     public function addUser(User $user): self
  134.     {
  135.         if (!$this->users->contains($user)) {
  136.             $this->users[] = $user;
  137.             $user->setPtf($this);
  138.         }
  139.         return $this;
  140.     }
  141.     public function removeUser(User $user): self
  142.     {
  143.         if ($this->users->removeElement($user)) {
  144.             // set the owning side to null (unless already changed)
  145.             if ($user->getPtf() === $this) {
  146.                 $user->setPtf(null);
  147.             }
  148.         }
  149.         return $this;
  150.     }
  151.     /**
  152.      * @return Collection<int, Groupe>
  153.      */
  154.     public function getGroupe(): Collection
  155.     {
  156.         return $this->groupe;
  157.     }
  158.     public function addGroupe(Groupe $groupe): self
  159.     {
  160.         if (!$this->groupe->contains($groupe)) {
  161.             $this->groupe[] = $groupe;
  162.         }
  163.         return $this;
  164.     }
  165.     public function removeGroupe(Groupe $groupe): self
  166.     {
  167.         $this->groupe->removeElement($groupe);
  168.         return $this;
  169.     }
  170.     public function getCreatedAt(): ?\DateTimeInterface
  171.     {
  172.         return $this->created_at;
  173.     }
  174.     public function setCreatedAt(\DateTimeInterface $created_at): self
  175.     {
  176.         $this->created_at $created_at;
  177.         return $this;
  178.     }
  179.     public function getUpdatedAt(): ?\DateTimeInterface
  180.     {
  181.         return $this->updated_at;
  182.     }
  183.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  184.     {
  185.         $this->updated_at $updated_at;
  186.         return $this;
  187.     }
  188.     public function getCreatedBy(): ?int
  189.     {
  190.         return $this->created_by;
  191.     }
  192.     public function setCreatedBy(int $created_by): self
  193.     {
  194.         $this->created_by $created_by;
  195.         return $this;
  196.     }
  197.     public function getUpdatedBy(): ?int
  198.     {
  199.         return $this->updated_by;
  200.     }
  201.     public function setUpdatedBy(int $updated_by): self
  202.     {
  203.         $this->updated_by $updated_by;
  204.         return $this;
  205.     }
  206.     public function getPays(): ?Pays
  207.     {
  208.         return $this->pays;
  209.     }
  210.     public function setPays(?Pays $pays): self
  211.     {
  212.         $this->pays $pays;
  213.         return $this;
  214.     }
  215.     public function getType(): ?string
  216.     {
  217.         return $this->type;
  218.     }
  219.     public function setType(?string $type): self
  220.     {
  221.         $this->type $type;
  222.         return $this;
  223.     }
  224.     /**
  225.      * @return Collection<int, Troika>
  226.      */
  227.     public function getTroikas(): Collection
  228.     {
  229.         return $this->troikas;
  230.     }
  231.     public function addTroika(Troika $troika): self
  232.     {
  233.         if (!$this->troikas->contains($troika)) {
  234.             $this->troikas->add($troika);
  235.             $troika->setPtf($this);
  236.         }
  237.         return $this;
  238.     }
  239.     public function removeTroika(Troika $troika): self
  240.     {
  241.         if ($this->troikas->removeElement($troika)) {
  242.             // set the owning side to null (unless already changed)
  243.             if ($troika->getPtf() === $this) {
  244.                 $troika->setPtf(null);
  245.             }
  246.         }
  247.         return $this;
  248.     }
  249. }