class ServicesClientEventResult in Services Client 7.2
Class for handling event operation results.
Hierarchy
- class \ServicesClientEventResult
Expanded class hierarchy of ServicesClientEventResult
2 string references to 'ServicesClientEventResult'
- drush_services_client_process_queue in ./
services_client.drush.inc - Process queued sync jobs
- ServicesClientWebTestCase::testServicesClientProcessing in tests/
services_client.test
File
- include/
plugin.inc, line 272 - Base plugin definitions. All other plugins should be extended from this set of plugins.
View source
class ServicesClientEventResult {
/**
* Initialized event handler.
*
* @var EventHandler
*/
protected $handler;
/**
* Entity id.
*
* @var int
*/
protected $entity_id;
/**
* Event data object.
*
* @var stdClass
*/
public $event;
/**
* Entity which was processed in event.
*
* @var stdClass
*/
public $entity;
/**
* Entity type.
*
* @var string
*/
public $entity_type;
/**
* Mapped object if exists.
*
* @var stdClass
*/
public $object;
/**
* Request sent to remote site.
*
* @var ServicesClientConnectionHttpRequest
*/
public $request;
/**
* Response retrieved from remote site.
*
* @var ServicesClientConnectionResponse
*/
public $response;
/**
* If failed error message from exception.
*
* @var string
*/
public $error_message;
/**
* If failed error code from exception.
*
* @var int
*/
public $error_code;
/**
* Error type.
*
* @var ServicesClientErrorType const
*/
public $error_type;
/**
* Retrieve entity id.
*
* @return int
*/
public function getEntityId() {
if (empty($this->entity_id)) {
list($this->entity_id) = entity_extract_ids($this->entity_type, $this->entity);
}
return $this->entity_id;
}
/**
* Retrieve event handler.
*
* @return EventHandler
*/
public function getHandler() {
// Lazy load handler.
if (empty($this->handler)) {
$this->handler = $this->event
->getHandler();
}
return $this->handler;
}
/**
* Set current handler.
*
* @param EventHandler $handler
* Event handler.
*/
public function setHandler(EventHandler $handler) {
$this->handler = $handler;
return $this;
}
/**
* Retry event.
*
* @return ServicesClientEventResult
* Result of new operation.
*/
public function retry() {
return $this
->getHandler()
->execute();
}
/**
* Returns if event was successful.
*
* @return bool
* TRUE if successful.
*/
public function success() {
return empty($this->error_code) && empty($this->error_type);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ServicesClientEventResult:: |
public | property | Entity which was processed in event. | |
ServicesClientEventResult:: |
protected | property | Entity id. | |
ServicesClientEventResult:: |
public | property | Entity type. | |
ServicesClientEventResult:: |
public | property | If failed error code from exception. | |
ServicesClientEventResult:: |
public | property | If failed error message from exception. | |
ServicesClientEventResult:: |
public | property | Error type. | |
ServicesClientEventResult:: |
public | property | Event data object. | |
ServicesClientEventResult:: |
protected | property | Initialized event handler. | |
ServicesClientEventResult:: |
public | property | Mapped object if exists. | |
ServicesClientEventResult:: |
public | property | Request sent to remote site. | |
ServicesClientEventResult:: |
public | property | Response retrieved from remote site. | |
ServicesClientEventResult:: |
public | function | Retrieve entity id. | |
ServicesClientEventResult:: |
public | function | Retrieve event handler. | |
ServicesClientEventResult:: |
public | function | Retry event. | |
ServicesClientEventResult:: |
public | function | Set current handler. | |
ServicesClientEventResult:: |
public | function | Returns if event was successful. |