Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
3f460c17
Commit
3f460c17
authored
May 30, 2018
by
Bertrand Gauthier
Browse files
AbstractRole: ajout intialisation indispensable de la collection users + ajout méthode removeUser
parent
c81dccb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Entity/Db/AbstractRole.php
View file @
3f460c17
...
...
@@ -2,6 +2,7 @@
namespace
UnicaenAuth\Entity\Db
;
use
Doctrine\Common\Collections\ArrayCollection
;
use
Doctrine\ORM\Mapping
as
ORM
;
/**
...
...
@@ -53,6 +54,14 @@ abstract class AbstractRole implements RoleInterface
*/
protected
$users
;
/**
* AbstractRole constructor.
*/
public
function
__construct
()
{
$this
->
users
=
new
ArrayCollection
();
}
/**
* Get the id.
*
...
...
@@ -191,6 +200,14 @@ abstract class AbstractRole implements RoleInterface
$this
->
users
[]
=
$user
;
}
/**
* @param UserInterface $user
*/
public
function
removeUser
(
UserInterface
$user
)
{
$this
->
users
->
removeElement
(
$user
);
}
/**
*
* @return string
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment