Sulu\Component\Content\Compat\Block\BlockPropertyType::addChild PHP Method

addChild() public method

public addChild ( Sulu\Component\Content\Compat\PropertyInterface $property )
$property Sulu\Component\Content\Compat\PropertyInterface
    public function addChild(PropertyInterface $property)
    {
        $this->childProperties[] = $property;
    }

Usage Example

Exemplo n.º 1
0
 private function createBlockProperty(BlockMetadata $property, StructureInterface $structure = null)
 {
     $blockProperty = new BlockProperty($property->getName(), ['title' => $property->title, 'info_text' => $property->description], $property->getDefaultComponentName(), $property->isRequired(), $property->isLocalized(), $property->getMaxOccurs(), $property->getMinOccurs(), $property->getParameters(), [], $property->getColspan());
     $blockProperty->setStructure($structure);
     foreach ($property->getComponents() as $component) {
         $blockPropertyType = new BlockPropertyType($component->getName(), ['title' => $component->title, 'info_text' => $component->description]);
         foreach ($component->getChildren() as $property) {
             $blockPropertyType->addChild($this->createProperty($property, $structure));
         }
         $blockProperty->addType($blockPropertyType);
     }
     return $blockProperty;
 }
All Usage Examples Of Sulu\Component\Content\Compat\Block\BlockPropertyType::addChild