Sfdoctrineguard et profil
Bonsoir.
je possède deux tables sf_guard_user et sf_guard_user_profile.
Sur l'index du site j'affiche une liste des membres avec l'id,l'username,nom et prénom, tout marche nickel.
Un clic sur chaque membre permet d'avoir les détails (voic l'url de test /user/show/id/1).
Dans mon executeshow j'ai fais ceci
Code:
$this->sf_guard_user = Doctrine::getTable('sfGuardUser')->find($request->getParameter('id'));
Dans ma template j'essaye donc d'afficher les champs du profil mais je n'y arrive pas.
Le code présent dans mon executeshow est il suffisant ou alors il faudrait rajouter qq chose permettant de recuperer les infos du profil (j'avais cru comprendre que le plugin s'en chargeait implicitement)?
Code:
$this->sf_guard_user_profile = $this->sf_guard_user->getSfGuardUserProfile()
Car même en faisant ca si dans ma template je fais un
Code:
$sf_guard_user->getSfGuardUserProfile()->getNom()
Code:
$sf_guard_user_profile->getNom()
j'obtiens une jolie erreur.
Merci par avance
un
Code:
var_dump( $sf_guard_user->getSfGuardUserProfile())
donne ceci
Citation:
object(sfOutputEscaperIteratorDecorator)[84]
private 'iterator' =>
object(IteratorIterator)[86]
protected 'value' =>
object(Doctrine_Collection)[92]
protected 'data' =>
array
0 =>
object(sfGuardUserProfile)[94]
...
protected '_table' =>
object(sfGuardUserProfileTable)[64]
protected '_data' =>
array
...
protected '_identifier' => string 'id' (length=2)
protected '_identifierType' => int 1
protected '_conn' =>
object(Doctrine_Connection_Mysql)[18]
...
protected '_identityMap' =>
array
...
protected '_repository' =>
object(Doctrine_Table_Repository)[80]
...
protected '_columns' =>
array
...
protected '_fieldNames' =>
array
...
protected '_columnNames' =>
array
...
protected 'columnCount' => int 12
protected 'hasDefaultValues' => null
protected '_options' =>
array
...
protected '_tree' => null
protected '_parser' =>
object(Doctrine_Relation_Parser)[72]
...
protected '_templates' =>
array
...
protected '_filters' =>
array
...
protected '_generators' =>
array
...
protected '_invokedMethods' =>
array
...
protected 'record' =>
object(sfGuardUserProfile)[79]
...
protected 'attributes' =>
array
...
protected 'parent' =>
object(Doctrine_Connection_Mysql)[18]
...
protected '_impl' =>
array
...
protected '_params' =>
array
...
protected '_locator' => null
protected '_resources' =>
array
...
protected '_snapshot' =>
array
0 =>
object(sfGuardUserProfile)[94]
...
protected 'reference' =>
object(sfGuardUser)[74]
protected 'profile' => null
protected 'groups' => null
protected 'permissions' => null
protected 'allPermissions' => null
protected '_node' => null
protected '_id' =>
array
...
protected '_data' =>
array
...
protected '_values' =>
array
...
protected '_state' => int 3
protected '_modified' =>
array
...
protected '_errorStack' => null
protected '_references' =>
array
...
protected '_pendingDeletes' =>
array
...
protected '_serializeReferences' => boolean false
private '_oid' => int 1
protected '_table' =>
object(sfGuardUserTable)[49]
...
protected '_locator' => null
protected '_resources' =>
array
...
protected 'referenceField' => string 'sf_guard_user_id' (length=16)
protected 'relation' =>
object(Doctrine_Relation_ForeignKey)[83]
protected 'definition' =>
array
...
protected 'keyColumn' => null
protected '_locator' => null
protected '_resources' =>
array
empty
protected 'escapingMethod' => string 'esc_specialchars' (length=16)