Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
FriendsListWidget.php
1 <?php
2 /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  *
11  * Show current user friends. Allows accept/cancel friendship. Shows current friendship status
12  */
14 {
15  public function run()
16  {
17  $friendships = Friendship::model()
18  ->with(array(
19  'user1' => array('with' => array('profile' => array('alias' => 'p1'))),
20  'user2' => array('with' => 'profile'))
21  )
22  ->findAll('user1_id = :user_id or user2_id = :user_id', array(':user_id' => Yii::app()->user->id));
23 
24  $this->render('FriendsListWidget', array('friendships' => $friendships));
25 
26  }
27 }