public function searchItems(MW_Common_Criteria_Interface $search, array $ref = array(), &$total = null)
	{
		$items = array();
		$context = $this->_getContext();
		$priceManager = MShop_Factory::createManager( $context, 'price' );

		$dbm = $context->getDatabaseManager();
		$dbname = $this->_getResourceName();
		$conn = $dbm->acquire( $dbname );

		try
		{
			$sitelevel = MShop_Locale_Manager_Abstract::SITE_SUBTREE;
			$cfgPathSearch = 'mshop/order/manager/base/service/default/item/search';
			$cfgPathCount =  'mshop/order/manager/base/service/default/item/count';
			$required = array( 'order.base.service' );

			$results = $this->_searchItems( $conn, $search, $cfgPathSearch, $cfgPathCount,
				$required, $total, $sitelevel );

			try
			{
				while( ( $row = $results->fetch() ) !== false )
				{
					$price = $priceManager->createItem();
					$price->setValue($row['price']);
					$price->setRebate($row['rebate']);
					$price->setCosts($row['costs']);
					$price->setTaxRate($row['taxrate']);
					$items[ $row['id'] ] = array( 'price' => $price, 'item' => $row );
				}
			}
			catch( Exception $e )
			{
				$results->finish();
				throw $e;
			}

			$dbm->release( $conn, $dbname );
		}
		catch( Exception $e )
		{
			$dbm->release( $conn, $dbname );
			throw $e;
		}

		$result = array();
		$attributes = $this->_getAttributeItems( array_keys( $items ) );

		foreach ( $items as $id => $row )
		{
			$attrList = array();
			if( isset( $attributes[$id] ) ) {
				$attrList = $attributes[$id];
			}
			$result[ $id ] = $this->_createItem( $row['price'], $row['item'], $attrList );
		}

		return $result;
	}
public function searchItems(MW_Common_Criteria_Interface $search, array $ref = array(), &$total = null)
	{
		$items = array();
		$context = $this->_getContext();
		$priceManager = MShop_Factory::createManager( $context, 'price' );

		$dbm = $context->getDatabaseManager();
		$dbname = $this->_getResourceName();
		$conn = $dbm->acquire( $dbname );

		try
		{
			$sitelevel = MShop_Locale_Manager_Abstract::SITE_SUBTREE;
			$cfgPathSearch = 'mshop/order/manager/base/service/default/item/search';
			$cfgPathCount =  'mshop/order/manager/base/service/default/item/count';
			$required = array( 'order.base.service' );

			$results = $this->_searchItems( $conn, $search, $cfgPathSearch, $cfgPathCount,
				$required, $total, $sitelevel );

			try
			{
				while( ( $row = $results->fetch() ) !== false )
				{
					$price = $priceManager->createItem();
					$price->setValue($row['price']);
					$price->setRebate($row['rebate']);
					$price->setCosts($row['costs']);
					$price->setTaxRate($row['taxrate']);
					$items[ $row['id'] ] = array( 'price' => $price, 'item' => $row );
				}
			}
			catch( Exception $e )
			{
				$results->finish();
				throw $e;
			}

			$dbm->release( $conn, $dbname );
		}
		catch( Exception $e )
		{
			$dbm->release( $conn, $dbname );
			throw $e;
		}

		$result = array();
		$attributes = $this->_getAttributeItems( array_keys( $items ) );

		foreach ( $items as $id => $row )
		{
			$attrList = array();
			if( isset( $attributes[$id] ) ) {
				$attrList = $attributes[$id];
			}
			$result[ $id ] = $this->_createItem( $row['price'], $row['item'], $attrList );
		}

		return $result;
	}
public function searchItems ( MW_Common_Criteria_Interface $ search , array $ ref = array ( ) , & $ total = null ) { $ items = array ( ) ; $ context = $ this -> _getContext ( ) ; $ priceManager = MShop_Factory :: createManager ( $ context , 'price' ) ; $ dbm = $ context -> getDatabaseManager ( ) ; $ dbname = $ this -> _getResourceName ( ) ; $ conn = $ dbm -> acquire ( $ dbname ) ; try { $ sitelevel = MShop_Locale_Manager_Abstract :: SITE_SUBTREE ; $ cfgPathSearch = 'mshop/order/manager/base/service/default/item/search' ; $ cfgPathCount = 'mshop/order/manager/base/service/default/item/count' ; $ required = array ( 'order.base.service' ) ; $ results = $ this -> _searchItems ( $ conn , $ search , $ cfgPathSearch , $ cfgPathCount , $ required , $ total , $ sitelevel ) ; try { while ( ( $ row = $ results -> fetch ( ) ) !== false ) { $ price = $ priceManager -> createItem ( ) ; $ price -> setValue ( $ row [ 'price' ] ) ; $ price -> setRebate ( $ row [ 'rebate' ] ) ; $ price -> setCosts ( $ row [ 'costs' ] ) ; $ price -> setTaxRate ( $ row [ 'taxrate' ] ) ; $ items [ $ row [ 'id' ] ] = array ( 'price' => $ price , 'item' => $ row ) ; } } catch ( Exception $ e ) { $ results -> finish ( ) ; throw $ e ; } $ dbm -> release ( $ conn , $ dbname ) ; } catch ( Exception $ e ) { $ dbm -> release ( $ conn , $ dbname ) ; throw $ e ; } $ result = array ( ) ; $ attributes = $ this -> _getAttributeItems ( array_keys ( $ items ) ) ; foreach ( $ items as $ id => $ row ) { $ attrList = array ( ) ; if ( isset ( $ attributes [ $ id ] ) ) { $ attrList = $ attributes [ $ id ] ; } $ result [ $ id ] = $ this -> _createItem ( $ row [ 'price' ] , $ row [ 'item' ] , $ attrList ) ; } return $ result ; }
Searches for order service items based on the given criteria.

@param MW_Common_Criteria_Interface $search Search object containing the conditions
@param array $ref Not used
@param integer &$total Number of items that are available in total
@return array List of items implementing MShop_Order_Item_Base_Service_Interface
Searches for order service items based on the given criteria .