You are here

public function EventHandler::enqueue in Services Client 7.2

Enqueue item if should be queue.

Parameters

bool $force: Force enqueueing.

Return value

bool TRUE if queued.

File

include/event.inc, line 765

Class

EventHandler
Event handler plugin.

Code

public function enqueue($force = FALSE) {
  if ($this
    ->getEntity()) {
    if ($force || !empty($this->config['queue']) || $this
      ->getControlData()
      ->shouldQueue()) {
      $this
        ->log(ServicesClientLogLevel::INFO, "QUEUE; entity_type : @entity_type, entity_id : @entity_id, uuid : @uuid", array(
        '@entity_type' => $this->event->entity_type,
        '@entity_id' => $this
          ->getEntityId(),
        '@uuid' => isset($this
          ->getEntity()->uuid) ? $this
          ->getEntity()->uuid : NULL,
      ));
      return $this
        ->enqueueEntity();
    }
  }
  return FALSE;
}