You are here

public function MetadataProcessor::apply in Configuration Management 7.3

Overrides AbstractProcessor::apply

File

src/Processors/MetadataProcessor.php, line 20

Class

MetadataProcessor

Namespace

Configuration\Processors

Code

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;
  }
}