You are here

public function NodeSaveHandler::getRemoteUserId in Services Client 7.2

Retrieve remote user ID.

Return value

mixed|NULL If no remote entity exists returns NULL

1 call to NodeSaveHandler::getRemoteUserId()
NodeSaveHandler::beforeSync in include/event.inc
Before sync event.

File

include/event.inc, line 1240

Class

NodeSaveHandler
Adds extra logic for saving remote nodes.

Code

public function getRemoteUserId($uid) {
  $account = user_load($uid);
  $result = $this
    ->getRemoteIdByUUID($account->uuid, 'user', 'user', 'uid');

  // Log remote id.
  if (!empty($result)) {
    $this
      ->log(ServicesClientLogLevel::DEVEL, "FOUND AUTHOR ID; local uuid : @local_uuid, remote id : @remote_id", array(
      '@local_uuid' => $account->uuid,
      '@remote_id' => $result,
    ));
  }
  else {
    $this
      ->log(ServicesClientLogLevel::DEVEL, "NOT AUTHOR FOUND ID; local uuid : @local_uuid", array(
      '@local_uuid' => $account->uuid,
      '@remote_id' => $result,
    ));
  }
  return $result;
}