You are here

DeployAggregatorManaged.inc in Deploy - Content Staging 7.3

Same filename and directory in other branches
  1. 7.2 plugins/DeployAggregatorManaged.inc

Managed entities Deploy aggregator plugin.

File

plugins/DeployAggregatorManaged.inc
View source
<?php

/**
 * @file
 * Managed entities Deploy aggregator plugin.
 */

/**
 * Managed deployment aggregator.
 */
class DeployAggregatorManaged extends DeployAggregatorBase {

  /**
   * Configuration data.
   * @var array
   */
  public $config = array();

  /**
   * Holds a reference to the plan object that initiated it.
   *
   * @var DeployPlan
   */
  public $plan;

  /**
   * {@inheritdoc}
   */
  public function __construct(DeployPlan $plan = NULL, array $config = array()) {
    $this->config += array(
      'debug' => FALSE,
      'delete_post_deploy' => FALSE,
    );
    $this->config = array_merge($this->config, $config);
    $this->plan = $plan;
  }

  /**
   * Get aggregated entities.
   */
  public function getEntities() {
    return deploy_manager_get_entities($this->plan->name);
  }

  /**
   * {@inheritdoc}
   */
  public function configForm(&$form_state) {
    $form = array();
    $form['delete_post_deploy'] = array(
      '#type' => 'checkbox',
      '#title' => t('Delete successfully deployed entities from the plan'),
      '#description' => t('If checked, each successfully deployed entity will be automatically deleted from the plan.'),
      '#default_value' => $this->config['delete_post_deploy'],
    );
    return $form;
  }

}

Classes

Namesort descending Description
DeployAggregatorManaged Managed deployment aggregator.