<?php
namespace App\Entity;
use App\Repository\ProfileRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ProfileRepository::class)
*/
class Profile
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $label;
/**
* @ORM\Column(type="datetime")
*/
private $creation_date;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $edition_date;
/**
* @ORM\ManyToMany(targetEntity="Permission", fetch="EAGER")
* @ORM\JoinTable(name="profile_permissions",
* joinColumns={@ORM\JoinColumn(name="profile_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="permission_id", referencedColumnName="id")}
* )
*/
private $profilePermissions;
/**
* @ORM\OneToMany(targetEntity=User::class, mappedBy="profile")
*/
private $users;
/**
* @ORM\Column(type="string", length=255)
*/
private $target;
/**
* @ORM\Column(type="boolean")
*/
private $isSynch;
/**
* @ORM\Column(type="boolean")
*/
private $deleted = 0;
public function __construct()
{
$this->profilePermissions = new ArrayCollection();
$this->users = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getCreationDate(): ?\DateTimeInterface
{
return $this->creation_date;
}
public function setCreationDate(\DateTimeInterface $creation_date): self
{
$this->creation_date = $creation_date;
return $this;
}
public function getEditionDate(): ?\DateTimeInterface
{
return $this->edition_date;
}
public function setEditionDate(?\DateTimeInterface $edition_date): self
{
$this->edition_date = $edition_date;
return $this;
}
/**
* @return Collection<int, ProfilePermissions>
*/
public function getProfilePermissions(): Collection
{
return $this->profilePermissions;
}
public function addProfilePermission(ProfilePermissions $profilePermission): self
{
if (!$this->profilePermissions->contains($profilePermission)) {
$this->profilePermissions[] = $profilePermission;
$profilePermission->setProfile($this);
}
return $this;
}
public function removeProfilePermission(ProfilePermissions $profilePermission): self
{
if ($this->profilePermissions->removeElement($profilePermission)) {
// set the owning side to null (unless already changed)
if ($profilePermission->getProfile() === $this) {
$profilePermission->setProfile(null);
}
}
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setProfile($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getProfile() === $this) {
$user->setProfile(null);
}
}
return $this;
}
/**
* @return mixed
*/
public function getTarget()
{
return $this->target;
}
/**
* @param mixed $target
*/
public function setTarget($target): void
{
$this->target = $target;
}
/**
* @return mixed
*/
public function getisSynch()
{
return $this->isSynch;
}
/**
* @param mixed $isSynch
*/
public function setisSynch($isSynch): void
{
$this->isSynch = $isSynch;
}
/**
* @return mixed
*/
public function getDeleted()
{
return $this->deleted;
}
/**
* @param mixed $deleted
*/
public function setDeleted($deleted): void
{
$this->deleted = $deleted;
}
}