I'm following the symofny documentation to creating the login system but when I try to create a a form to create a new user I get this error, I've been looking for a solution for nothing seems to work.
FatalErrorException: Error: Call to a member function toArray() on a non-object in var/www/Frigorifico/src/Frigorifico/FrigorificoBundle/Entity/Users.php line 90
private $roles;
public function ___construct()
{
$this->roles = new ArrayCollection();
}
public function getRoles()
{
return $this->roles->toArray();
}