You are here

function hook_services_client_mapped_object_alter in Services Client 7.2

Allow to alter object that is sent to remote site.

Parameters

EventHandler $handler: Handler class that provides sending object.

stdClass $object: Object that is going to be sent.

1 function implements hook_services_client_mapped_object_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

services_client_test_services_client_mapped_object_alter in tests/services_client_test/services_client_test.module
Implements hook_services_client_mapped_object_alter().
1 invocation of hook_services_client_mapped_object_alter()
EntitySaveHandler::execute in include/event.inc
Execute event and send event to remove endpoint.

File

./services_client.api.php, line 111
Services client allows you to push different objects from local drupal installation to remote servers via REST api.

Code

function hook_services_client_mapped_object_alter($handler, $object) {
  if ($handler
    ->getEvent()->name == 'my_event') {

    // Load entity that is being processed.
    $entity = $handler
      ->getEntity();
    $object->my_property = $entity->custom_array['value'];
  }
}