I'm implementing FOSUserBundle (with propel) on my Symfony 2.4 installation.
I'm getting this error:
This user instance is not supported by the Propel UserManager implementation
This is my User.php
namespace g9\BoBundle\Model;
use FOS\UserBundle\Model\User as MyUser;
class User extends MyUser{
# .. no code here yet
}
What am I doing wrong? Thanks in advance
EDIT:
If I edit FOS/UserBundle/Propel/UserManager.php and comment the following lines:
public function updateUser(UserInterface $user)
{
#if (!$user instanceof \Persistent) {
# throw new \InvalidArgumentException('This user instance is not supported by the Propel UserManager implementation');
#}
$this->updateCanonicalFields($user);
$this->updatePassword($user);
$user->save();
}
And add this function to my Model:
public function save() {
# No code at all
}
I stop getting erros. And sure, I get nothing into my users table since save() implementation is empty. I think this is NOT the solution, If i have to implement something like save() I shouldnt get a Bundle to manager users, i should implement everything myself.
Please, I need some clarity here..i know nothing of symfony.
On my custom save() function i did var_dump($this); exit; as sugested in comments:
object(g9\BoBundle\Model\User)#546 (19) {
["id":protected]=>
NULL
["username":protected]=>
string(9) "asdasdasd"
["usernameCanonical":protected]=>
string(9) "asdasdasd"
["email":protected]=>
string(17) "asdasd@asdasd.com"
["emailCanonical":protected]=>
string(17) "asdasd@asdasd.com"
["enabled":protected]=>
bool(true)
["salt":protected]=>
string(31) "1vnor8tdykcgs004080c8gskgcso8oc"
["password":protected]=>
string(88) "ItcyRBZDjaua9EIZ050/mfp35vhag0lrumUSTcahaIWW6AQyhxG9JgA4kMVOX4WCRsyDa3rbOqmZmCaDbxi3KA=="
["plainPassword":protected]=>
NULL
["lastLogin":protected]=>
NULL
["confirmationToken":protected]=>
NULL
["passwordRequestedAt":protected]=>
NULL
["groups":protected]=>
NULL
["locked":protected]=>
bool(false)
["expired":protected]=>
bool(false)
["expiresAt":protected]=>
NULL
["roles":protected]=>
array(0) {
}
["credentialsExpired":protected]=>
bool(false)
["credentialsExpireAt":protected]=>
NULL
}