protected function saveParagraphStructure( array $structure,
                                               array &$paragraphIdMap,
                                               $rootId = null )
    {
        $model      = $this->getParagraphModel();
        $paragraph  = $model->saveRawData( array(
            'type'      => $structure['type'],
            'name'      => $structure['name'],
            'left'      => $structure['left'],
            'right'     => $structure['right'],
            'rootId'    => $rootId,
        ) );

        if ( empty( $paragraph ) )
        {
            return null;
        }

        $paragraphIdMap[$structure['id']] = $paragraph;
        $model->saveRawProperties( $paragraph, $structure['properties'] );

        foreach ( $structure['children'] as $child )
        {
            $this->saveParagraphStructure(
                $child,
                $paragraphIdMap,
                $rootId ? $rootId : $paragraph
            );
        }

        return $paragraph;
    }