sButtonLabel = $oDomNode->GetChildText('button-label'); $oCollectionTypeNode = $oDomNode->GetOptionalElement('collection-type'); if ($oCollectionTypeNode) { $this->oCollectionType = CollectionTypeFactory::GetInstance()->CreateCollectionTypeFromDomNode($oCollectionTypeNode); } else { throw new PropertyTreeException("Node: {$this->sId}, missing collection-type in node specification"); } // read child properties foreach ($oDomNode->GetUniqueElement('prototype')->childNodes as $oNode) { if ($oNode instanceof DesignElement) { $this->AddChild($oPropertyTreeFactory->CreateNodeFromDom($oNode, $this)); } } } public function ToPHPFormBlock(&$aPHPFragments = []): string { $sFormBlockClass = $this->oCollectionType->GetFormBlockClass(); $sSubTreeClass = 'SubFormFor__'.$this->sIdWithPath; // Create the collection node $sLocalPHP = <<Add('$this->sId', '$sFormBlockClass', [ 'label' => '$this->sLabel', 'button_label' => '$this->sButtonLabel', 'block_entry_type' => '$sSubTreeClass', ]); PHP; $sSubClassPHP = <<aChildren as $oProperty) { $sSubClassPHP .= "\n".$oProperty->ToPHPFormBlock($aPHPFragments); } $sSubClassPHP .= <<