original_string: protected function initialize()
      {
          $itemData = $this->getItemData();
  
          $itemsMerged = array();
          foreach ($itemData as $key => $itemOptions)
          {
              $itemsMerged[$key] = array_merge($this->defaults, $itemOptions);
  
              if (isset($itemsMerged[$key]['children']['.defaults']))
              {
                  $itemsMerged[$key]['children']['.defaults'] = array_merge($this->defaults, $itemsMerged[$key]['children']['.defaults']);
              }
              else
              {
                  $itemsMerged[$key]['children']['.defaults'] = $this->defaults;
              }
          }
  
          $this->baseItem = $this->createItem('', array(
              'title' => '',
              'item_class' => 'C33s\MenuBundle\Item\MenuItem',
              'children' => $itemsMerged,
          ));
      }
code: protected function initialize()
      {
          $itemData = $this->getItemData();
  
          $itemsMerged = array();
          foreach ($itemData as $key => $itemOptions)
          {
              $itemsMerged[$key] = array_merge($this->defaults, $itemOptions);
  
              if (isset($itemsMerged[$key]['children']['.defaults']))
              {
                  $itemsMerged[$key]['children']['.defaults'] = array_merge($this->defaults, $itemsMerged[$key]['children']['.defaults']);
              }
              else
              {
                  $itemsMerged[$key]['children']['.defaults'] = $this->defaults;
              }
          }
  
          $this->baseItem = $this->createItem('', array(
              'title' => '',
              'item_class' => 'C33s\MenuBundle\Item\MenuItem',
              'children' => $itemsMerged,
          ));
      }
code_tokens: protected function initialize ( ) { $ itemData = $ this -> getItemData ( ) ; $ itemsMerged = array ( ) ; foreach ( $ itemData as $ key => $ itemOptions ) { $ itemsMerged [ $ key ] = array_merge ( $ this -> defaults , $ itemOptions ) ; if ( isset ( $ itemsMerged [ $ key ] [ 'children' ] [ '.defaults' ] ) ) { $ itemsMerged [ $ key ] [ 'children' ] [ '.defaults' ] = array_merge ( $ this -> defaults , $ itemsMerged [ $ key ] [ 'children' ] [ '.defaults' ] ) ; } else { $ itemsMerged [ $ key ] [ 'children' ] [ '.defaults' ] = $ this -> defaults ; } } $ this -> baseItem = $ this -> createItem ( '' , array ( 'title' => '' , 'item_class' => 'C33s\MenuBundle\Item\MenuItem' , 'children' => $ itemsMerged , ) ) ; }
docstring: Initialize base menu item and its children
docstring_tokens: Initialize base menu item and its children