src/Entity/Profile.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProfileRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ProfileRepository::class)
  9.  */
  10. class Profile
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $label;
  22.     /**
  23.      * @ORM\Column(type="datetime")
  24.      */
  25.     private $creation_date;
  26.     /**
  27.      * @ORM\Column(type="datetime", nullable=true)
  28.      */
  29.     private $edition_date;
  30.     /**
  31.      * @ORM\ManyToMany(targetEntity="Permission", fetch="EAGER")
  32.      * @ORM\JoinTable(name="profile_permissions",
  33.      *      joinColumns={@ORM\JoinColumn(name="profile_id", referencedColumnName="id")},
  34.      *      inverseJoinColumns={@ORM\JoinColumn(name="permission_id", referencedColumnName="id")}
  35.      *      )
  36.      */
  37.     private $profilePermissions;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="profile")
  40.      */
  41.     private $users;
  42.     /**
  43.      * @ORM\Column(type="string", length=255)
  44.      */
  45.     private $target;
  46.     /**
  47.      * @ORM\Column(type="boolean")
  48.      */
  49.     private $isSynch;
  50.     /**
  51.      * @ORM\Column(type="boolean")
  52.      */
  53.     private $deleted 0;
  54.     public function __construct()
  55.     {
  56.         $this->profilePermissions = new ArrayCollection();
  57.         $this->users = new ArrayCollection();
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getLabel(): ?string
  64.     {
  65.         return $this->label;
  66.     }
  67.     public function setLabel(string $label): self
  68.     {
  69.         $this->label $label;
  70.         return $this;
  71.     }
  72.     public function getCreationDate(): ?\DateTimeInterface
  73.     {
  74.         return $this->creation_date;
  75.     }
  76.     public function setCreationDate(\DateTimeInterface $creation_date): self
  77.     {
  78.         $this->creation_date $creation_date;
  79.         return $this;
  80.     }
  81.     public function getEditionDate(): ?\DateTimeInterface
  82.     {
  83.         return $this->edition_date;
  84.     }
  85.     public function setEditionDate(?\DateTimeInterface $edition_date): self
  86.     {
  87.         $this->edition_date $edition_date;
  88.         return $this;
  89.     }
  90.     /**
  91.      * @return Collection<int, ProfilePermissions>
  92.      */
  93.     public function getProfilePermissions(): Collection
  94.     {
  95.         return $this->profilePermissions;
  96.     }
  97.     public function addProfilePermission(ProfilePermissions $profilePermission): self
  98.     {
  99.         if (!$this->profilePermissions->contains($profilePermission)) {
  100.             $this->profilePermissions[] = $profilePermission;
  101.             $profilePermission->setProfile($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeProfilePermission(ProfilePermissions $profilePermission): self
  106.     {
  107.         if ($this->profilePermissions->removeElement($profilePermission)) {
  108.             // set the owning side to null (unless already changed)
  109.             if ($profilePermission->getProfile() === $this) {
  110.                 $profilePermission->setProfile(null);
  111.             }
  112.         }
  113.         return $this;
  114.     }
  115.     /**
  116.      * @return Collection<int, User>
  117.      */
  118.     public function getUsers(): Collection
  119.     {
  120.         return $this->users;
  121.     }
  122.     public function addUser(User $user): self
  123.     {
  124.         if (!$this->users->contains($user)) {
  125.             $this->users[] = $user;
  126.             $user->setProfile($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeUser(User $user): self
  131.     {
  132.         if ($this->users->removeElement($user)) {
  133.             // set the owning side to null (unless already changed)
  134.             if ($user->getProfile() === $this) {
  135.                 $user->setProfile(null);
  136.             }
  137.         }
  138.         return $this;
  139.     }
  140.     /**
  141.      * @return mixed
  142.      */
  143.     public function getTarget()
  144.     {
  145.         return $this->target;
  146.     }
  147.     /**
  148.      * @param mixed $target
  149.      */
  150.     public function setTarget($target): void
  151.     {
  152.         $this->target $target;
  153.     }
  154.     /**
  155.      * @return mixed
  156.      */
  157.     public function getisSynch()
  158.     {
  159.         return $this->isSynch;
  160.     }
  161.     /**
  162.      * @param mixed $isSynch
  163.      */
  164.     public function setisSynch($isSynch): void
  165.     {
  166.         $this->isSynch $isSynch;
  167.     }
  168.     /**
  169.      * @return mixed
  170.      */
  171.     public function getDeleted()
  172.     {
  173.         return $this->deleted;
  174.     }
  175.     /**
  176.      * @param mixed $deleted
  177.      */
  178.     public function setDeleted($deleted): void
  179.     {
  180.         $this->deleted $deleted;
  181.     }
  182. }