You are here

function services_client_raw_data_set in Services Client 7

Set data to destination object

Parameters

$path:

$destination:

$data:

1 call to services_client_raw_data_set()
services_client_process_mapping in ./services_client.module
Process the mapping lists for fields

File

./services_client.module, line 1002
Services client module allows to push different types of objects on different types of events such as node_save, user_save to remote masters.

Code

function services_client_raw_data_set($path, &$destination, $set_data) {

  // Explode the segments by #
  $parts = explode('#', trim($path));
  $data =& $destination;
  foreach ($parts as $part) {

    // Create array element
    if (substr($part, 0, 1) == '>') {
      $name = substr($part, 1);
      if (!isset($data[$name])) {
        $data[$name] = NULL;
      }
      $data =& $data[$name];
    }
    else {
      $name = $part;
      if (!isset($data->{$name})) {
        $data->{$name} = NULL;
      }
      $data =& $data->{$name};
    }
  }
  $data = $set_data;
}