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 $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $role;
  26.     /**
  27.      * @ORM\Column(type="boolean", nullable=true)
  28.      */
  29.     private $modUsers;
  30.     /**
  31.      * @ORM\Column(type="boolean", nullable=true)
  32.      */
  33.     private $modSales;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      */
  37.     private $createdAt;
  38.     /**
  39.      * @ORM\Column(type="datetime")
  40.      */
  41.     private $updatedAt;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="profile")
  44.      */
  45.     private $UserId;
  46.     public function __construct()
  47.     {
  48.         $this->UserId = new ArrayCollection();
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getName(): ?string
  55.     {
  56.         return $this->name;
  57.     }
  58.     public function setName(string $name): self
  59.     {
  60.         $this->name $name;
  61.         return $this;
  62.     }
  63.     public function getModUsers(): ?bool
  64.     {
  65.         return $this->modUsers;
  66.     }
  67.     public function setModUsers(?bool $modUsers): self
  68.     {
  69.         $this->modUsers $modUsers;
  70.         return $this;
  71.     }
  72.     public function getModSales(): ?bool
  73.     {
  74.         return $this->modSales;
  75.     }
  76.     public function setModSales(?bool $modSales): self
  77.     {
  78.         $this->modSales $modSales;
  79.         return $this;
  80.     }
  81.     public function getCreatedAt(): ?\DateTime
  82.     {
  83.         return $this->createdAt;
  84.     }
  85.     public function setCreatedAt(\DateTime $createdAt): self
  86.     {
  87.         $this->createdAt $createdAt;
  88.         return $this;
  89.     }
  90.     public function getUpdatedAt(): ?\DateTime
  91.     {
  92.         return $this->updatedAt;
  93.     }
  94.     public function setUpdatedAt(\DateTime $updatedAt): self
  95.     {
  96.         $this->updatedAt $updatedAt;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection|User[]
  101.      */
  102.     public function getUserId(): Collection
  103.     {
  104.         return $this->UserId;
  105.     }
  106.     public function addUserId(User $userId): self
  107.     {
  108.         if (!$this->UserId->contains($userId)) {
  109.             $this->UserId[] = $userId;
  110.             $userId->setProfile($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeUserId(User $userId): self
  115.     {
  116.         if ($this->UserId->removeElement($userId)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($userId->getProfile() === $this) {
  119.                 $userId->setProfile(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124.     public function __toString()
  125.     {
  126.         return $this->name;
  127.     }
  128.     public function getRole(): ?string
  129.     {
  130.         return $this->role;
  131.     }
  132.     public function setRole(string $role): self
  133.     {
  134.         $this->role $role;
  135.         return $this;
  136.     }
  137. }