You are here

public function ServicesClientConnection::relationships in Services Client 7.2

Same name and namespace in other branches
  1. 7 services_client_connection/include/connection.inc \ServicesClientConnection::relationships()

Load resource related data

Parameters

$resource: Resource type i.e. 'user' or 'node'

$id: Optionally this can be id of the resource, call would look like $client->action('node', 23, 'publish');

$relation: Related data i.e. for node comments

$data: Associative array of additional data that should be passed to call

$options: Extra options of request

File

services_client_connection/include/connection.inc, line 413
Main services client connection class which exposes simple API

Class

ServicesClientConnection
@file Main services client connection class which exposes simple API

Code

public function relationships($resource, $id, $relation, $data = array()) {
  $this->http_request = $this
    ->createRequest(array(
    'resource' => $resource,
    'relation' => $relation,
    'id' => $id,
    'data' => $data,
  ));
  return $this
    ->processRequest()->data;
}