Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConfigDependencies.php

function ConfigDependencies::onDependencyRemoval

Informs the entity that entities it depends on will be deleted.

Parameters

\Drupal\rest\RestResourceConfigInterface $rest_config: The rest configuration.

array $dependencies: An array of dependencies that will be deleted keyed by dependency type. Dependency types are, for example, entity, module and theme.

Return value

bool TRUE if the entity has been changed as a result, FALSE if not.

See also

\Drupal\Core\Config\Entity\ConfigEntityInterface::onDependencyRemoval()

File

core/modules/rest/src/Entity/ConfigDependencies.php, line 127

Class

ConfigDependencies
Calculates rest resource config dependencies.

Namespace

Drupal\rest\Entity

Code

public function onDependencyRemoval(RestResourceConfigInterface $rest_config, array $dependencies) {
    $granularity = $rest_config->get('granularity');
    switch ($granularity) {
        case RestResourceConfigInterface::METHOD_GRANULARITY:
            return $this->onDependencyRemovalForMethodGranularity($rest_config, $dependencies);
        case RestResourceConfigInterface::RESOURCE_GRANULARITY:
            return $this->onDependencyRemovalForResourceGranularity($rest_config, $dependencies);
        default:
            throw new \InvalidArgumentException('Invalid granularity specified.');
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal