You are here

function services_client_get_data_id in Services Client 7

Extract primary key identifier from passed data

Parameters

stdClass $src_data: Source data (entity)

string $event: Event name

Return value

int ID of entity

1 call to services_client_get_data_id()
services_client_data_process in ./services_client.module
This function takes inbound data objects and a type and determines if there are tasks for them. If there are, it checks conditions and then generates connections and organizes the data to pass to the calling functions

File

./services_client.module, line 570
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_get_data_id($src_data, $event) {
  $type = services_client_get_data_type($event);
  if (entity_get_info($type)) {
    $id = reset(entity_extract_ids($type, $src_data));
    return $id;
  }
  return NULL;
}