Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ddb69d

Browse files
tbredilletjaviereguiluz
authored andcommitted
Add mandatory method and attribute
1 parent 326419c commit 9ddb69d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

doctrine/registration_form.rst

Lines 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)