public function searchItems( MW_Common_Criteria_Interface $search, array $ref = array(), &$total = null )
	{
		$items = array();

		$context = $this->_getContext();
		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$localeManager = MShop_Factory::createManager( $context, 'locale' );

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

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

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

			while( ( $row = $results->fetch() ) !== false )
			{
				$price = $priceManager->createItem();
				$price->setCurrencyId( $row['currencyid'] );
				$price->setValue( $row['price'] );
				$price->setCosts( $row['costs'] );
				$price->setRebate( $row['rebate'] );

				// you may need the site object! take care!
				$localeItem = $localeManager->createItem();
				$localeItem->setLanguageId($row['langid']);
				$localeItem->setCurrencyId($row['currencyid']);
				$localeItem->setSiteId($row['siteid']);

				$items[ $row['id'] ] = $this->_createItem( $price, $localeItem, $row );
			}

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

		return $items;
	}
public function searchItems( MW_Common_Criteria_Interface $search, array $ref = array(), &$total = null )
	{
		$items = array();

		$context = $this->_getContext();
		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$localeManager = MShop_Factory::createManager( $context, 'locale' );

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

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

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

			while( ( $row = $results->fetch() ) !== false )
			{
				$price = $priceManager->createItem();
				$price->setCurrencyId( $row['currencyid'] );
				$price->setValue( $row['price'] );
				$price->setCosts( $row['costs'] );
				$price->setRebate( $row['rebate'] );

				// you may need the site object! take care!
				$localeItem = $localeManager->createItem();
				$localeItem->setLanguageId($row['langid']);
				$localeItem->setCurrencyId($row['currencyid']);
				$localeItem->setSiteId($row['siteid']);

				$items[ $row['id'] ] = $this->_createItem( $price, $localeItem, $row );
			}

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

		return $items;
	}
public function searchItems ( MW_Common_Criteria_Interface $ search , array $ ref = array ( ) , & $ total = null ) { $ items = array ( ) ; $ context = $ this -> _getContext ( ) ; $ priceManager = MShop_Factory :: createManager ( $ context , 'price' ) ; $ localeManager = MShop_Factory :: createManager ( $ context , 'locale' ) ; $ dbm = $ context -> getDatabaseManager ( ) ; $ dbname = $ this -> _getResourceName ( ) ; $ conn = $ dbm -> acquire ( $ dbname ) ; try { $ sitelevel = MShop_Locale_Manager_Abstract :: SITE_SUBTREE ; $ cfgPathSearch = 'mshop/order/manager/base/default/item/search' ; $ cfgPathCount = 'mshop/order/manager/base/default/item/count' ; $ required = array ( 'order.base' ) ; $ results = $ this -> _searchItems ( $ conn , $ search , $ cfgPathSearch , $ cfgPathCount , $ required , $ total , $ sitelevel ) ; while ( ( $ row = $ results -> fetch ( ) ) !== false ) { $ price = $ priceManager -> createItem ( ) ; $ price -> setCurrencyId ( $ row [ 'currencyid' ] ) ; $ price -> setValue ( $ row [ 'price' ] ) ; $ price -> setCosts ( $ row [ 'costs' ] ) ; $ price -> setRebate ( $ row [ 'rebate' ] ) ; // you may need the site object! take care! $ localeItem = $ localeManager -> createItem ( ) ; $ localeItem -> setLanguageId ( $ row [ 'langid' ] ) ; $ localeItem -> setCurrencyId ( $ row [ 'currencyid' ] ) ; $ localeItem -> setSiteId ( $ row [ 'siteid' ] ) ; $ items [ $ row [ 'id' ] ] = $ this -> _createItem ( $ price , $ localeItem , $ row ) ; } $ dbm -> release ( $ conn , $ dbname ) ; } catch ( Exception $ e ) { $ dbm -> release ( $ conn , $ dbname ) ; throw $ e ; } return $ items ; }
Search for orders 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_Interface
@throws MShop_Order_Exception If creating items fails
@throws MW_DB_Exception If a database operation fails
Search for orders based on the given criteria .