src/Kunstmaan/PagePartBundle/PageTemplate/PageTemplateConfigurationParser.php
private function buildRegion($rawRegion)
    {
        $children = [];
        $rows = [];
        $rawRegion = array_replace(['regions' => [], 'rows' => []], $rawRegion);

        foreach ($rawRegion['regions'] as $child) {
            $children[] = $this->buildRegion($child);
        }

        foreach ($rawRegion['rows'] as $row) {
            $rows[] = $this->buildRow($row);
        }

        $rawRegion = array_replace([
            'name' => null,
            'span' => 12,
            'template' => null,
        ], $rawRegion);

        return new Region($rawRegion['name'], $rawRegion['span'], $rawRegion['template'], $children, $rows);
    }
private function buildRegion($rawRegion)
    {
        $children = [];
        $rows = [];
        $rawRegion = array_replace(['regions' => [], 'rows' => []], $rawRegion);

        foreach ($rawRegion['regions'] as $child) {
            $children[] = $this->buildRegion($child);
        }

        foreach ($rawRegion['rows'] as $row) {
            $rows[] = $this->buildRow($row);
        }

        $rawRegion = array_replace([
            'name' => null,
            'span' => 12,
            'template' => null,
        ], $rawRegion);

        return new Region($rawRegion['name'], $rawRegion['span'], $rawRegion['template'], $children, $rows);
    }
private function buildRegion ( $ rawRegion ) { $ children = [ ] ; $ rows = [ ] ; $ rawRegion = array_replace ( [ 'regions' => [ ] , 'rows' => [ ] ] , $ rawRegion ) ; foreach ( $ rawRegion [ 'regions' ] as $ child ) { $ children [ ] = $ this -> buildRegion ( $ child ) ; } foreach ( $ rawRegion [ 'rows' ] as $ row ) { $ rows [ ] = $ this -> buildRow ( $ row ) ; } $ rawRegion = array_replace ( [ 'name' => null , 'span' => 12 , 'template' => null , ] , $ rawRegion ) ; return new Region ( $ rawRegion [ 'name' ] , $ rawRegion [ 'span' ] , $ rawRegion [ 'template' ] , $ children , $ rows ) ; }
This builds a Region out of the rawRegion from the Yaml

@param array $rawRegion

@return Region
This builds a Region out of the rawRegion from the Yaml