protected function _createTree( MW_Tree_Node_Interface $node, MShop_Catalog_Item_Interface $item,
		array $listItemMap, array $refItemMap )
	{
		foreach( $node->getChildren() as $child )
		{
			$listItems = array();
			if ( array_key_exists( $child->getId(), $listItemMap ) ) {
				$listItems = $listItemMap[ $child->getId() ];
			}

			$refItems = array();
			if ( array_key_exists( $child->getId(), $refItemMap ) ) {
				$refItems = $refItemMap[ $child->getId() ];
			}

			$newItem = $this->_createItem( array(), $listItems, $refItems, array(), $child );
			$item->addChild( $newItem );

			$this->_createTree( $child, $newItem, $listItemMap, $refItemMap );
		}
	}
protected function _createTree( MW_Tree_Node_Interface $node, MShop_Catalog_Item_Interface $item,
		array $listItemMap, array $refItemMap )
	{
		foreach( $node->getChildren() as $child )
		{
			$listItems = array();
			if ( array_key_exists( $child->getId(), $listItemMap ) ) {
				$listItems = $listItemMap[ $child->getId() ];
			}

			$refItems = array();
			if ( array_key_exists( $child->getId(), $refItemMap ) ) {
				$refItems = $refItemMap[ $child->getId() ];
			}

			$newItem = $this->_createItem( array(), $listItems, $refItems, array(), $child );
			$item->addChild( $newItem );

			$this->_createTree( $child, $newItem, $listItemMap, $refItemMap );
		}
	}
protected function _createTree ( MW_Tree_Node_Interface $ node , MShop_Catalog_Item_Interface $ item , array $ listItemMap , array $ refItemMap ) { foreach ( $ node -> getChildren ( ) as $ child ) { $ listItems = array ( ) ; if ( array_key_exists ( $ child -> getId ( ) , $ listItemMap ) ) { $ listItems = $ listItemMap [ $ child -> getId ( ) ] ; } $ refItems = array ( ) ; if ( array_key_exists ( $ child -> getId ( ) , $ refItemMap ) ) { $ refItems = $ refItemMap [ $ child -> getId ( ) ] ; } $ newItem = $ this -> _createItem ( array ( ) , $ listItems , $ refItems , array ( ) , $ child ) ; $ item -> addChild ( $ newItem ) ; $ this -> _createTree ( $ child , $ newItem , $ listItemMap , $ refItemMap ) ; } }
Builds the tree of catalog items.

@param MW_Tree_Node_Interface $node Parent tree node
@param MShop_Catalog_Item_Interface $item Parent tree catalog Item
@param array $listItemMap Associative list of parent-item-ID / list items for the catalog item
@param array $refItemMap Associative list of parent-item-ID/domain/items key/value pairs
Builds the tree of catalog items .