public function ConfigurationItem::__construct in Features 8.3
Same name and namespace in other branches
- 8.4 src/ConfigurationItem.php \Drupal\features\ConfigurationItem::__construct()
Creates a new ConfigurationItem instance.
Parameters
string $name: The config name.
array $data: The config data.
array $additional_properties: (optional) Additional properties set on the object.
File
- src/
ConfigurationItem.php, line 107
Class
- ConfigurationItem
- Contains some configuration together with metadata like the name + package.
Namespace
Drupal\featuresCode
public function __construct($name, array $data, array $additional_properties = []) {
$this->name = $name;
$this->data = $data;
$properties = get_object_vars($this);
foreach ($additional_properties as $property => $value) {
if (!array_key_exists($property, $properties)) {
throw new \InvalidArgumentException('Invalid property: ' . $property);
}
$this->{$property} = $value;
}
}