You are here

protected function EntitySaveHandler::doSync in Services Client 7.2

Execute sync action.

Overrides EventHandler::doSync

1 call to EntitySaveHandler::doSync()
EntitySaveHandler::execute in include/event.inc
Execute event and send event to remove endpoint.

File

include/event.inc, line 1025

Class

EntitySaveHandler
General entity save handler.

Code

protected function doSync($object) {
  $object = (array) $object;
  $id = $this
    ->getRemoteEntityId();
  if (empty($id)) {
    $this
      ->getConnection()
      ->create($this->config['resource'], $object);
    return $this
      ->getConnection()
      ->getResponse();
  }
  else {
    $this
      ->getConnection()
      ->update($this->config['resource'], $id, $object);
    return $this
      ->getConnection()
      ->getResponse();
  }
}