3 // src/Rapsys/UserBundle/Entity/Group.php
4 namespace Rapsys\UserBundle\Entity
;
28 * @var \Doctrine\Common\Collections\Collection
35 * @param string $title The group name
37 public function __construct(string $title) {
38 $this->title
= (string) $title;
39 $this->users
= new \Doctrine\Common\Collections\
ArrayCollection();
47 public function getId() {
54 * @param string $title The group name
58 public function setTitle($title) {
59 $this->title
= $title;
69 public function getTitle() {
76 * @param \DateTime $created
80 public function setCreated($created) {
81 $this->created
= $created;
91 public function getCreated() {
92 return $this->created
;
98 * @param \DateTime $updated
102 public function setUpdated($updated) {
103 $this->updated
= $updated;
113 public function getUpdated() {
114 return $this->updated
;
120 * @param \Rapsys\UserBundle\Entity\User $user
124 public function addUser(\Rapsys\UserBundle\Entity\User
$user) {
125 $this->users
[] = $user;
133 * @param \Rapsys\UserBundle\Entity\User $user
135 public function removeUser(\Rapsys\UserBundle\Entity\User
$user) {
136 $this->users
->removeElement($user);
142 * @return \Doctrine\Common\Collections\Collection
144 public function getUsers() {
149 * Returns a string representation of the group
153 public function __toString(): string {
162 public function getRole() {
163 return 'ROLE_'.strtoupper($this->title
);