You are here

public static function ContentTypeConfiguration::alterDependencies in Configuration Management 7.2

Overrides Drupal\configuration\Config\Configuration::alterDependencies().

Overrides Configuration::alterDependencies

File

lib/Drupal/configuration/Config/ContentTypeConfiguration.php, line 89
Definition of Drupal\configuration\Config\ContentTypeConfiguration.

Class

ContentTypeConfiguration

Namespace

Drupal\configuration\Config

Code

public static function alterDependencies(Configuration $config) {
  if ($config
    ->getComponent() == 'permission') {
    foreach (node_permissions_get_configured_types() as $type) {
      foreach (array_keys(node_list_permissions($type)) as $permission) {
        $data = $config
          ->getData();
        if ($permission == $data['permission']) {
          $content_type = ConfigurationManagement::createConfigurationInstance('content_type.' . $type);
          $config
            ->addToDependencies($content_type);
          break;
        }
      }
    }
  }
}