On 23 nov, 06:51, Gareth McCumskey <[email protected]> wrote:
> Does it matter?
Maybe yes...
I need an array to search on it in the view. For that, i have written
this code in the action:
// This fetches the friends of the user with the ID '1'.
$this->friend_list = Doctrine::getTable('FriendReference')
->createQuery('a')
->select('a.user2')
->where("a.user1 LIKE ?", '1')
->execute();
// "data" stores the friends of the user with the ID '1'.
$this->data = $this->friend_list->toArray();
And this is my code of the view:
// "in_array" search if a user is in the friends array.
$a = (int)in_array($member->getId(), $data);
Javi
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=.