You are here

protected function ContentEntityNormalizer::inDependencies in Content Synchronization 8.2

Same name and namespace in other branches
  1. 3.0.x src/Normalizer/ContentEntityNormalizer.php \Drupal\content_sync\Normalizer\ContentEntityNormalizer::inDependencies()

Checks if a dependency is in a dependencies nested array.

Parameters

string $dependency: An entity identifier.

$dependencies: A nested array of dependencies.

Return value

bool

1 call to ContentEntityNormalizer::inDependencies()
ContentEntityNormalizer::normalize in src/Normalizer/ContentEntityNormalizer.php
Normalizes an object into a set of arrays/scalars.

File

src/Normalizer/ContentEntityNormalizer.php, line 172

Class

ContentEntityNormalizer
Adds the file URI to embedded file entities.

Namespace

Drupal\content_sync\Normalizer

Code

protected function inDependencies($dependency, $dependencies) {
  list($entity_type_id, $bundle, $uuid) = explode('.', $dependency);
  if (isset($dependencies[$entity_type_id])) {
    if (in_array($dependency, $dependencies[$entity_type_id])) {
      return TRUE;
    }
  }
  return FALSE;
}