Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
auth
Commits
5d012b69
Commit
5d012b69
authored
Apr 21, 2016
by
Bertrand Gauthier
Browse files
Options
Downloads
Patches
Plain Diff
AbstractUser::$roles est une Collection, pas un array.
parent
cd715162
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/UnicaenAuth/Entity/Db/AbstractUser.php
+6
-5
6 additions, 5 deletions
src/UnicaenAuth/Entity/Db/AbstractUser.php
with
6 additions
and
5 deletions
src/UnicaenAuth/Entity/Db/AbstractUser.php
+
6
−
5
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
)
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment