entities = $entities; return $self; } /** * @param array $element * The root element of the layout, in shallow/deep format. * @param array $entities * A list of entities, keyed by named. * This will be updated to include 'fields'. * Ex: $entities['spouse']['type'] = 'Contact'; */ protected static function parseFields($element, &$entities) { if (!isset($element['#children'])) { return; } foreach ($element['#children'] as $child) { if (is_string($child)) { //nothing } elseif ($child['#tag'] == 'af-fieldset' && !empty($child['#children'])) { $entities[$child['model']]['fields'] = array_merge($entities[$child['model']]['fields'] ?? [], AHQ::getTags($child, 'af-field')); } elseif (!empty($child['#children'])) { self::parseFields($child['#children'], $entities); } } } /** * @return array * Ex: $entities['spouse']['type'] = 'Contact'; */ public function getEntities() { return $this->entities; } }