You are here

public function AcsfEvent::__construct in Acquia Cloud Site Factory Connector 8

Same name and namespace in other branches
  1. 8.2 src/Event/AcsfEvent.php \Drupal\acsf\Event\AcsfEvent::__construct()

Constructor.

Parameters

AcsfEventDispatcher $dispatcher: The event dispatcher object.

\Drupal\acsf\AcsfLog $log: The log object.

string $type: The type of event to run.

array $registry: The registry from acsf_registry.

array $context: An arbitrary context for handlers.

\Drupal\acsf\AcsfSite $site: The site being operated upon (optional).

File

src/Event/AcsfEvent.php, line 51

Class

AcsfEvent
ACSFEvent.

Namespace

Drupal\acsf\Event

Code

public function __construct(AcsfEventDispatcher $dispatcher, AcsfLog $log, $type, array $registry, array $context, AcsfSite $site = NULL) {
  $this->dispatcher = $dispatcher;
  $this->log = $log;
  $this->type = $type;
  $this->site = $site;

  // Make sure 'events' has a value so code can always refer to it.
  if (!isset($registry['events'])) {
    $registry['events'] = [];
  }
  $this->registry = $registry;
  $this->context = $context;
  $this->handlers = [
    'incomplete' => [],
    'complete' => [],
    'failed' => [],
  ];
}