示例#1
0
 /**
  * Enter description here...
  *
  * @param unknown_type $userId
  * @param unknown_type $appId
  * @param unknown_type $api_key
  * @param unknown_type $status
  * @param unknown_type $cleared
  * @return unknown
  */
 public static function setStatus($userId, $appId, $api_key, $networkId, $status, $cleared)
 {
     $hasPermissionResult = Api_Dao_UsersApp::checkUserHasPermission($api_key, $userId, 'status_update', $networkId);
     if ($hasPermissionResult != true) {
         throw new Exception(FB_ERROR_MSG_REQUIRES_PERMISSION, FB_ERROR_CODE_REQUIRES_PERMISSION);
     }
     $ret = false;
     if (Api_Dao_User::isStatus($userId, $appId)) {
         $ret = Api_Dao_User::updateStatus($userId, $appId, $status);
     } else {
         $ret = Api_Dao_User::createStatus($userId, $appId, $status);
     }
     Api_Dao_User::createStatusHistory($userId, $appId, $status, $cleared);
     return $ret;
 }