public function Package::setDependencies in Features 8.3
Same name and namespace in other branches
- 8.4 src/Package.php \Drupal\features\Package::setDependencies()
Sets the dependencies of a package.
Ensures that dependencies are unique and do not include the package itself.
Parameters
\string[] $dependencies:
Return value
$this
1 call to Package::setDependencies()
File
- src/
Package.php, line 497
Class
- Package
- Defines a value object for storing package related data.
Namespace
Drupal\featuresCode
public function setDependencies(array $dependencies) {
$dependencies = array_unique($dependencies);
// Package shouldn't be dependent on itself.
$full_name = $this
->getFullName();
if (in_array($full_name, $dependencies)) {
unset($dependencies[array_search($full_name, $dependencies)]);
}
sort($dependencies);
$this->dependencies = $dependencies;
return $this;
}