. * * @category API * @package StatusNet * @author Dan Moore * @author Evan Prodromou * @author Zach Copley * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ if (!defined('STATUSNET')) { exit(1); } /** * Ouputs the authenticating user's friends (subscriptions), each with * current Twitter-style status inline. They are ordered by the date * in which the user subscribed to them, 100 at a time. * * @category API * @package StatusNet * @author Dan Moore * @author Evan Prodromou * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ class ApiUserFriendsAction extends ApiSubscriptionsAction { /** * Get the user's subscriptions (friends) as an array of profiles * * @return array Profiles */ function getProfiles() { $offset = ($this->page - 1) * $this->count; $limit = $this->count + 1; $subs = null; if (isset($this->tag)) { $subs = $this->user->getTaggedSubscriptions( $this->tag, $offset, $limit ); } else { $subs = $this->user->getSubscriptions( $offset, $limit ); } $profiles = array(); if (!empty($subs)) { while ($subs->fetch()) { $profiles[] = clone($subs); } } return $profiles; } }