/**
  * Query the Facebook Graph Api
  *
  * @param Model $model
  * @param $path
  * @param string $method GET/POST/DELETE
  * @param array $params
  * @return mixed
  */
 public function query(Model $model, $path, $method = 'GET', $params = array())
 {
     if ($method === 'GET') {
         $path = $this->buildPath($path, $params);
         $params = array();
     }
     return $this->FB->api($path, $method, $params);
 }
Exemplo n.º 2
0
 /**
  * Delete (previously granted) permission
  * Deletes the given permission by issuing a delete request to the GraphApi
  * DELETE /{user-id}/permissions/{permission-name}
  *
  * @see https://developers.facebook.com/docs/facebook-login/permissions/#revoking
  * @param string $perm Permission name
  * @return bool
  */
 public function deletePermission($perm)
 {
     $result = $this->FacebookApi->api('/me/permissions/' . (string) $perm, 'DELETE');
     if (FacebookApi::$version < FacebookApi::API_VERSION_V2_1) {
         $result = $result === 'true' ? true : false;
     }
     if (!$result) {
         $this->log(__d('facebook', "Failed to delete permission '%s'.", $perm));
         return false;
     }
     $this->log(__d('facebook', "Deleted permission: %s", $perm), 'info');
     $this->updateUserInfo();
     return true;
 }