Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
5d012b69
Commit
5d012b69
authored
Apr 21, 2016
by
Bertrand Gauthier
Browse files
AbstractUser::$roles est une Collection, pas un array.
parent
cd715162
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Entity/Db/AbstractUser.php
View file @
5d012b69
...
...
@@ -4,6 +4,7 @@ namespace UnicaenAuth\Entity\Db;
use
BjyAuthorize\Provider\Role\ProviderInterface
;
use
Doctrine\Common\Collections\ArrayCollection
;
use
Doctrine\Common\Collections\Collection
;
use
Doctrine\ORM\Mapping
as
ORM
;
use
ZfcUser\Entity\UserInterface
;
...
...
@@ -53,7 +54,7 @@ abstract class AbstractUser implements UserInterface, ProviderInterface
protected
$state
;
/**
* @var
\Doctrine\Common\Collections\
Collection
* @var Collection
* @ORM\ManyToMany(targetEntity="UnicaenAuth\Entity\Db\Role")
* @ORM\JoinTable(name="user_role_linker",
* joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
...
...
@@ -205,11 +206,11 @@ abstract class AbstractUser implements UserInterface, ProviderInterface
/**
* Get role.
*
* @return
array
* @return
Collection
*/
public
function
getRoles
()
{
return
$this
->
roles
->
getValues
()
;
return
$this
->
roles
;
}
/**
...
...
@@ -219,9 +220,9 @@ abstract class AbstractUser implements UserInterface, ProviderInterface
*
* @return void
*/
public
function
addRole
(
$role
)
public
function
addRole
(
Role
$role
)
{
$this
->
roles
[]
=
$role
;
$this
->
roles
->
add
(
$role
)
;
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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