Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9ddb69d

Browse filesBrowse files
tbredilletjaviereguiluz
authored andcommitted
Add mandatory method and attribute
1 parent 326419c commit 9ddb69d
Copy full SHA for 9ddb69d

File tree

Expand file treeCollapse file tree

1 file changed

+17
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-1
lines changed

‎doctrine/registration_form.rst

Copy file name to clipboardExpand all lines: doctrine/registration_form.rst
+17-1Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ With some validation added, your class may look something like this::
8787
* @ORM\Column(type="string", length=64)
8888
*/
8989
private $password;
90+
91+
/**
92+
* @ORM\Column(type="array")
93+
*/
94+
private $roles;
95+
96+
public function __construct() {
97+
$this->roles = array('ROLE_USER');
98+
}
9099

91100
// other properties and methods
92101

@@ -136,8 +145,15 @@ With some validation added, your class may look something like this::
136145
// You *may* need a real salt if you choose a different encoder.
137146
return null;
138147
}
148+
149+
public function getRoles()
150+
{
151+
return $this->roles;
152+
}
139153

140-
// other methods, including security methods like getRoles()
154+
public function eraseCredentials()
155+
{
156+
}
141157
}
142158

143159
The :class:`Symfony\\Component\\Security\\Core\\User\\UserInterface` requires

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.