You are here

class MetadataProcessor in Configuration Management 7.3

Hierarchy

Expanded class hierarchy of MetadataProcessor

File

src/Processors/MetadataProcessor.php, line 7

Namespace

Configuration\Processors
View source
class MetadataProcessor extends AbstractProcessor {
  public static function availableProcessors() {
    return array(
      'AddDependencies',
      'RemoveDependencies',
      'AddParts',
      'RemoveParts',
      'AddModules',
      'RemoveModules',
    );
  }
  public function apply(Configuration $configuration, $properties = array()) {
    switch ($this
      ->getName()) {
      case 'AddDependencies':
        foreach ($properties as $dependency) {
          $this->configuration_manager
            ->newDependency($configuration, $dependency);
        }
        break;
      case 'AddParts':
        foreach ($properties as $part) {
          $this->configuration_manager
            ->newPart($configuration, $dependency);
        }
        break;
      case 'AddModules':
        foreach ($properties as $module) {
          $configuration
            ->addModule($module);
        }
        break;
      case 'RemoveDependencies':
        foreach ($properties as $dependency) {
          $configuration
            ->removeDependency($dependency);
        }
        break;
      case 'RemoveParts':
        foreach ($properties as $part) {
          $configuration
            ->removePart($part);
        }
        break;
      case 'RemoveModules':
        foreach ($properties as $module) {
          $configuration
            ->removeModule($module);
        }
        break;
    }
  }
  public function revert(Configuration $configuration, $properties = array()) {

    // Nothing to do. This proccesors are not reversible.
  }

}

Members