private function parseBlocks($node) { // TODO parse content, detect other blocks and create them $block = new Block(); $block->setType('Content'); $block->setName('Content'); $value = $this->blockImporter->driver('standard')->parse($node); $block->setBlockValue($value); $block->setPosition(1); return $block; }
protected function parseArea($node) { $area = new Area(); $area->setName((string) $node['name']); if (isset($node->style)) { $styleSet = $this->styleSetImporter->import($node->style); $area->setStyleSet($styleSet); } // Parse areas $nodes = false; if ($node->blocks->block) { $nodes = $node->blocks->block; } elseif ($node->block) { // 5.6 $nodes = $node->block; } if ($nodes) { $i = 0; foreach ($nodes as $blockNode) { if ($blockNode['type']) { $block = $this->parseBlock($blockNode); } elseif ($blockNode['mc-block-id'] != '') { $block = new Block(); $block->setDefaultsOutputIdentifier((string) $blockNode['mc-block-id']); } if (isset($block)) { $block->setPosition($i); $block->setArea($area); $area->blocks->add($block); ++$i; } } } return $area; }