if ($type == 'module' ||
$type == 'theme' ||
$type == 'content'
) { $dependent_entities =
array_filter($this->data,
function DConfigEntityDependency
$entity) use ($type,
$name) { return $entity->
hasDependency($type,
$name);
});
} // If checking content, module, or theme dependencies, discover which
// entities are dependent on the entities that have a direct dependency.
foreach ($dependent_entities as $entity) { $entities_to_check[] =
$entity->
getConfigDependencyName();
} } $dependencies =
array_merge($this->
createGraphConfigEntityDependencies($entities_to_check),
$dependent_entities);
// Sort dependencies in the reverse order of the graph. So the least
// dependent is at the top. For example, this ensures that fields are
// always after field storages. This is because field storages need to be
// created before a field.
$graph =
$this->
getGraph();
$sorts =
$this->
prepareMultisort($graph,
['weight', 'name'
]);
array_multisort($sorts['weight'
], SORT_DESC, SORT_NUMERIC,
$sorts['name'
], SORT_ASC, SORT_NATURAL | SORT_FLAG_CASE,
$graph);
return array_replace(array_intersect_key($graph,
$dependencies),
$dependencies);
} /**
* Extracts data from the graph for use in array_multisort().
*
* @param array $graph
* The graph to extract data from.
* @param array $keys
* The keys whose values to extract.
*
* @return array
* An array keyed by the $keys passed in. The values are arrays keyed by the
* row from the graph and the value is the corresponding value for the key
* from the graph.
*/