Esempio n. 1
0
 /**
  * Sets the item as a favorite for the user.
  *
  * @param int $iid the item id.
  * @param int $lid optional - the list the favorite should be added to, otherwise the default list
  * @param int $alid optional - the list the favorite should be added to, otherwise the default list for the app
  */
 public function execute()
 {
     $ret = Api_Bo_Favorites::setFavorite($this->getAppId(), $this->getUserId(), $this->iid, $this->alid, $this->lid, $this->fbml);
     $response = array();
     $response['result'] = $ret === false ? '0' : '1';
     return $response;
 }
Esempio n. 2
0
 /**
  * Helper method to create a favorite
  *
  * @param unknown_type $app_id
  * @param unknown_type $uid
  * @param unknown_type $item_id
  * @param unknown_type $alid
  * @param unknown_type $lid
  */
 public static function createFavorite($app_id, $uid, $item_id, $alid, $lid)
 {
     return Api_Bo_Favorites::setFavorite($app_id, $uid, $item_id, $alid, $lid, '');
 }