using setSfGuardUser() to save the current user in the model
Posted
by user334017
on Stack Overflow
See other posts from Stack Overflow
or by user334017
Published on 2010-05-19T23:17:11Z
Indexed on
2010/05/19
23:20 UTC
Read the original article
Hit count: 184
symfony
|symfony-1.4
My application makes use of the sfGuardUser plugin. One of my tables has a relation onto the sf_guard_user table so there is a corresponding setSfGuardUser() function in the base model. From Actions.class.php, I am attempting to set the current user into the object using this function, (Which I then save in the database).
my attempt:
->setSfGuardUser($this->getUser()); //called from inside Actions.class.php
this throws an error:
Couldn't call Doctrine_Core::set(), second argument should be an instance of Doctrine_Record or Doctrine_Null when setting one-to-one references.
...# at Doctrine_Record->coreSetRelated('sfGuardUser', object('myUser'))
Which makes me think that getUser() is not returning a sfGuardUser object, though I don't know how to check this. Can anyone offer any insight?
© Stack Overflow or respective owner