You are here

public function DeployProcessorBatch::publish in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 plugins/DeployProcessorBatch.inc \DeployProcessorBatch::publish()

Processing method that should hand over the aggregator to the endpoint to publish all deployed entities. This method will only be called after successful deployments.

Parameters

interger $deployment_key: The unique deployment key for this deployment.

DeployEndpoint $endpoint: The endpoint object to hand over the aggregator to.

string $lock_name: Optional name of the lock that this deployment is working under.

Overrides DeployProcessorMemory::publish

File

plugins/DeployProcessorBatch.inc, line 53
Batch API plugin for deploy Processor.

Class

DeployProcessorBatch
Processor class using the Batch API

Code

public function publish($deployment_key, DeployEndpoint $endpoint, $lock_name = NULL) {
  foreach ($this->aggregator as $entity) {
    $entity_info = entity_get_info($entity->__metadata['type']);
    $id_key = $entity_info['entity keys']['id'];
    $entity->__metadata['id'] = $entity->{$id_key};
    $entity->__metadata['deployment_key'] = $deployment_key;
    $entity->__metadata['plan_name'] = $this->aggregator->plan->name;
    $entity->__metadata['endpoint_name'] = $endpoint->name;
    $entity->__metadata['lock_name'] = $lock_name;
    $this->operations[] = array(
      'deploy_queue_worker_publish',
      array(
        $entity,
      ),
    );
  }
}