Gentics Portal.Node PHP API
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
All
Classes
Namespaces
Functions
Variables
Pages
common
modules
friends
widgets
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
*/
13
class
FriendsListWidget
extends
BaseWidget
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
}
Generated on Thu Jun 20 2013 14:45:15 for Gentics Portal.Node PHP API by
1.8.1.2