You are here

public function ServicesClientConnection::targetAction in Services Client 7.2

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

Target action on specific resource

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');

$action: Action name i.e. 'login' or 'publish'

$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 387
Main services client connection class which exposes simple API

Class

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

Code

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