protected function _saveSubProductsChunk( MW_Common_Criteria_Interface $search, array $domains, array $list, $size )
	{
		$manager = MShop_Factory::createManager( $this->_getContext(), 'product' );
		$start = 0;

		do
		{
			$result = $manager->searchItems( $search, $domains );

			if( !empty( $result ) )
			{
				foreach( $result as $refId => $refItem )
				{
					$refItem->setId( null );
					$refItem->setId( $list[$refId] );
				}

				foreach( $this->_getSubManagers() as $submanager ) {
					$submanager->rebuildIndex( $result );
				}
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start, $size );
		}
		while( $count == $size );
	}
protected function _saveSubProductsChunk( MW_Common_Criteria_Interface $search, array $domains, array $list, $size )
	{
		$manager = MShop_Factory::createManager( $this->_getContext(), 'product' );
		$start = 0;

		do
		{
			$result = $manager->searchItems( $search, $domains );

			if( !empty( $result ) )
			{
				foreach( $result as $refId => $refItem )
				{
					$refItem->setId( null );
					$refItem->setId( $list[$refId] );
				}

				foreach( $this->_getSubManagers() as $submanager ) {
					$submanager->rebuildIndex( $result );
				}
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start, $size );
		}
		while( $count == $size );
	}
protected function _saveSubProductsChunk ( MW_Common_Criteria_Interface $ search , array $ domains , array $ list , $ size ) { $ manager = MShop_Factory :: createManager ( $ this -> _getContext ( ) , 'product' ) ; $ start = 0 ; do { $ result = $ manager -> searchItems ( $ search , $ domains ) ; if ( ! empty ( $ result ) ) { foreach ( $ result as $ refId => $ refItem ) { $ refItem -> setId ( null ) ; $ refItem -> setId ( $ list [ $ refId ] ) ; } foreach ( $ this -> _getSubManagers ( ) as $ submanager ) { $ submanager -> rebuildIndex ( $ result ) ; } } $ count = count ( $ result ) ; $ start += $ count ; $ search -> setSlice ( $ start , $ size ) ; } while ( $ count == $ size ) ; }
Saves one chunk of the sub products.

@param MW_Common_Criteria_Interface $search Search criterias for retrieving the sub-products
@param array $domains List of domains to fetch list items and referenced items for
@param array $list Associative list of sub-product IDs as keys and parent products IDs as values
@param integer $size Number of products per chunk
Saves one chunk of the sub products .