public function PatternDefinition::toArray in UI Patterns 8
Return array definition.
Return value
array Array definition.
File
- src/
Definition/ PatternDefinition.php, line 86
Class
- PatternDefinition
- Class PatternDefinition.
Namespace
Drupal\ui_patterns\DefinitionCode
public function toArray() {
$definition = $this->definition;
foreach ($this
->getFields() as $field) {
$definition['fields'][$field
->getName()] = $field
->toArray();
}
foreach ($this
->getVariants() as $variant) {
$definition['variants'][$variant
->getName()] = $variant
->toArray();
}
return $definition;
}