original_string: protected function buildBlockView($id, BlockView $parentView = null)
      {
          $blockType       = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
          $resolvedOptions = $this->rawLayout->getProperty($id, RawLayout::RESOLVED_OPTIONS, true);
          $types           = $this->typeHelper->getTypes($blockType);
          $view            = new BlockView($parentView);
  
          if (is_null($resolvedOptions)) { // Try to resolve options again to render block
              $options  = $this->rawLayout->getProperty($id, RawLayout::OPTIONS, true);
              $resolvedOptions = $this->setBlockResolvedOptions($id, $blockType, $options, $types);
          }
  
          // point the block view state to the current block
          $this->block->initialize($id);
          // build the view
          foreach ($types as $type) {
              $type->buildView($view, $this->block, $resolvedOptions);
              $this->registry->buildView($type->getName(), $view, $this->block, $resolvedOptions);
          }
  
          array_walk_recursive(
              $view->vars,
              function (&$var) {
                  if ($var instanceof Options) {
                      $var = $var->toArray();
                  }
              }
          );
  
          return $view;
      }
code: protected function buildBlockView($id, BlockView $parentView = null)
      {
          $blockType       = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
          $resolvedOptions = $this->rawLayout->getProperty($id, RawLayout::RESOLVED_OPTIONS, true);
          $types           = $this->typeHelper->getTypes($blockType);
          $view            = new BlockView($parentView);
  
          if (is_null($resolvedOptions)) { // Try to resolve options again to render block
              $options  = $this->rawLayout->getProperty($id, RawLayout::OPTIONS, true);
              $resolvedOptions = $this->setBlockResolvedOptions($id, $blockType, $options, $types);
          }
  
          // point the block view state to the current block
          $this->block->initialize($id);
          // build the view
          foreach ($types as $type) {
              $type->buildView($view, $this->block, $resolvedOptions);
              $this->registry->buildView($type->getName(), $view, $this->block, $resolvedOptions);
          }
  
          array_walk_recursive(
              $view->vars,
              function (&$var) {
                  if ($var instanceof Options) {
                      $var = $var->toArray();
                  }
              }
          );
  
          return $view;
      }
code_tokens: protected function buildBlockView ( $ id , BlockView $ parentView = null ) { $ blockType = $ this -> rawLayout -> getProperty ( $ id , RawLayout :: BLOCK_TYPE , true ) ; $ resolvedOptions = $ this -> rawLayout -> getProperty ( $ id , RawLayout :: RESOLVED_OPTIONS , true ) ; $ types = $ this -> typeHelper -> getTypes ( $ blockType ) ; $ view = new BlockView ( $ parentView ) ; if ( is_null ( $ resolvedOptions ) ) { // Try to resolve options again to render block $ options = $ this -> rawLayout -> getProperty ( $ id , RawLayout :: OPTIONS , true ) ; $ resolvedOptions = $ this -> setBlockResolvedOptions ( $ id , $ blockType , $ options , $ types ) ; } // point the block view state to the current block $ this -> block -> initialize ( $ id ) ; // build the view foreach ( $ types as $ type ) { $ type -> buildView ( $ view , $ this -> block , $ resolvedOptions ) ; $ this -> registry -> buildView ( $ type -> getName ( ) , $ view , $ this -> block , $ resolvedOptions ) ; } array_walk_recursive ( $ view -> vars , function ( & $ var ) { if ( $ var instanceof Options ) { $ var = $ var -> toArray ( ) ; } } ) ; return $ view ; }
docstring: Created and builds the block view
  
  @param string         $id
  @param BlockView|null $parentView
  
  @return BlockView
docstring_tokens: Created and builds the block view