protected function _createItem( array $values = array(), array $listItems = array(), array $refItems = array(),
		array $children = array(), MW_Tree_Node_Interface $node = null )
	{
		if( $node === null )
		{
			if( !isset( $values['siteid'] ) ) {
				throw new MShop_Catalog_Exception( 'No site ID available for creating a catalog item' );
			}

			$node = $this->_createTreeManager( $values['siteid'] )->createNode();
			$node->siteid = $values['siteid'];
		}

		if( isset( $node->config ) && ( $result = json_decode( $node->config, true ) ) !== null ) {
			$node->config = $result;
		}

		return new MShop_Catalog_Item_Default( $node, $children, $listItems, $refItems );
	}
protected function _createItem( array $values = array(), array $listItems = array(), array $refItems = array(),
		array $children = array(), MW_Tree_Node_Interface $node = null )
	{
		if( $node === null )
		{
			if( !isset( $values['siteid'] ) ) {
				throw new MShop_Catalog_Exception( 'No site ID available for creating a catalog item' );
			}

			$node = $this->_createTreeManager( $values['siteid'] )->createNode();
			$node->siteid = $values['siteid'];
		}

		if( isset( $node->config ) && ( $result = json_decode( $node->config, true ) ) !== null ) {
			$node->config = $result;
		}

		return new MShop_Catalog_Item_Default( $node, $children, $listItems, $refItems );
	}
protected function _createItem ( array $ values = array ( ) , array $ listItems = array ( ) , array $ refItems = array ( ) , array $ children = array ( ) , MW_Tree_Node_Interface $ node = null ) { if ( $ node === null ) { if ( ! isset ( $ values [ 'siteid' ] ) ) { throw new MShop_Catalog_Exception ( 'No site ID available for creating a catalog item' ) ; } $ node = $ this -> _createTreeManager ( $ values [ 'siteid' ] ) -> createNode ( ) ; $ node -> siteid = $ values [ 'siteid' ] ; } if ( isset ( $ node -> config ) && ( $ result = json_decode ( $ node -> config , true ) ) !== null ) { $ node -> config = $ result ; } return new MShop_Catalog_Item_Default ( $ node , $ children , $ listItems , $ refItems ) ; }
Creates a new catalog item.

@param MW_Tree_Node_Interface $node Nested set tree node
@param array $children List of children of this catalog item
@param array $listItems List of list items that belong to the catalog item
@param array $refItems Associative list of referenced items grouped by domain
@return MShop_Catalog_Item_Interface New catalog item
Creates a new catalog item .