I have in file action.class.php - this site is only for log in
persons:
$id = $this->getUser()->getGuardUser()->getId();
$this->friends = Doctrine_Query::create()
->select('s1.*, s2.username as username')
->from('SfGuardUserProfile s1')
->innerJoin('s1.SfGuardUser s2')
->innerJoin('s2.Friends z ON s2.id=z.id_friend')
->where('z.id_user = ?', $id)
->execute();
I have an error: "Unknown relation alias Friends".
If I make:
$id = 2;
$this->friends = Doctrine_Query::create()
->select('s1.*, s2.username as username')
->from('SfGuardUserProfile s1')
->innerJoin('s1.SfGuardUser s2')
->innerJoin('s2.Friends z ON s2.id=z.id_friend')
->where('z.id_user = ?', $id)
->execute();
$id = $this->getUser()->getGuardUser()->getId();
Everything is ok !! I displayed $this->getUser()->getGuardUser()->getId
() and it shows id log in person, for example '2'. What is going on ?
Why can't I use $this->getUser()->getGuardUser()->getId() before my
query ??