function Group::toDtcg
File
-
core/
lib/ Drupal/ Core/ Theme/ DesignToken/ Group.php, line 93
Class
- Group
- A group: distinguishable by not having a $value property.
Namespace
Drupal\Core\Theme\DesignTokenCode
public function toDtcg() : array {
$data = [];
if ($this->type) {
$data['$type'] = $this->type;
}
if ($this->description) {
$data['$description'] = $this->description
->render();
}
foreach ($this->children as $key => $child) {
$data[$key] = $child->toDtcg();
}
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.