<?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 $name;
/**
* @ORM\Column(type="string", length=255)
*/
private $role;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $modUsers;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $modSales;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime")
*/
private $updatedAt;
/**
* @ORM\OneToMany(targetEntity=User::class, mappedBy="profile")
*/
private $UserId;
public function __construct()
{
$this->UserId = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getModUsers(): ?bool
{
return $this->modUsers;
}
public function setModUsers(?bool $modUsers): self
{
$this->modUsers = $modUsers;
return $this;
}
public function getModSales(): ?bool
{
return $this->modSales;
}
public function setModSales(?bool $modSales): self
{
$this->modSales = $modSales;
return $this;
}
public function getCreatedAt(): ?\DateTime
{
return $this->createdAt;
}
public function setCreatedAt(\DateTime $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTime
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTime $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @return Collection|User[]
*/
public function getUserId(): Collection
{
return $this->UserId;
}
public function addUserId(User $userId): self
{
if (!$this->UserId->contains($userId)) {
$this->UserId[] = $userId;
$userId->setProfile($this);
}
return $this;
}
public function removeUserId(User $userId): self
{
if ($this->UserId->removeElement($userId)) {
// set the owning side to null (unless already changed)
if ($userId->getProfile() === $this) {
$userId->setProfile(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
public function getRole(): ?string
{
return $this->role;
}
public function setRole(string $role): self
{
$this->role = $role;
return $this;
}
}