/** * Helper method to check if something is a favorite of ONE of the users passed in * * @param unknown_type $app_id * @param unknown_type $item_id * @param unknown_type $alid * @param unknown_type $lid * @param unknown_type $uids * @return unknown */ public static function isFavorite($app_id, $item_id, $alid, $lid, $uids) { $result = Api_Bo_Favorites::getUsers($app_id, $item_id, $alid, $lid, $uids); if (count($result) > 0) { return true; } return false; }
/** * Checks whether the user (or users) has (have) marked this item as a favorite. * * @param string $iid the item to check * @param array $uids optional - the uids to check, otherwise the logged in user * @param int $lids optional - the array of lists to check, otherwise the default list * * @return array users who have the item marked favorite. */ public function execute() { $users = Api_Bo_Favorites::getUsers($this->getAppId(), $this->iid, $this->alid, $this->lid, $this->uids); $retVal = array(); if (count($users) > 0) { foreach ($users as $user) { $retVal['user'][] = $user['user_id']; } } return $retVal; }