public function load( $id, $fresh = false )
	{
		$search = $this->createSearch();
		$search->setConditions( $search->compare( '==', 'order.base.id', $id ) );

		$context = $this->_getContext();
		$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' );
			$total = null;

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

			if( ( $row = $results->fetch() ) === false ) {
				throw new MShop_Order_Exception( sprintf( 'Order base item with order ID "%1$s" not found', $id ) );
			}
			$results->finish();

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

		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$localeManager = MShop_Factory::createManager( $context, 'locale' );

		$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']);

		if( $fresh === false ) {
			$basket = $this->_load( $id, $price, $localeItem, $row );
		} else {
			$basket = $this->_loadFresh( $id, $price, $localeItem, $row );
		}

		return $basket;
	}
public function load( $id, $fresh = false )
	{
		$search = $this->createSearch();
		$search->setConditions( $search->compare( '==', 'order.base.id', $id ) );

		$context = $this->_getContext();
		$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' );
			$total = null;

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

			if( ( $row = $results->fetch() ) === false ) {
				throw new MShop_Order_Exception( sprintf( 'Order base item with order ID "%1$s" not found', $id ) );
			}
			$results->finish();

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

		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$localeManager = MShop_Factory::createManager( $context, 'locale' );

		$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']);

		if( $fresh === false ) {
			$basket = $this->_load( $id, $price, $localeItem, $row );
		} else {
			$basket = $this->_loadFresh( $id, $price, $localeItem, $row );
		}

		return $basket;
	}
public function load ( $ id , $ fresh = false ) { $ search = $ this -> createSearch ( ) ; $ search -> setConditions ( $ search -> compare ( '==' , 'order.base.id' , $ id ) ) ; $ context = $ this -> _getContext ( ) ; $ 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' ) ; $ total = null ; $ results = $ this -> _searchItems ( $ conn , $ search , $ cfgPathSearch , $ cfgPathCount , $ required , $ total , $ sitelevel ) ; if ( ( $ row = $ results -> fetch ( ) ) === false ) { throw new MShop_Order_Exception ( sprintf ( 'Order base item with order ID "%1$s" not found' , $ id ) ) ; } $ results -> finish ( ) ; $ dbm -> release ( $ conn , $ dbname ) ; } catch ( Exception $ e ) { $ dbm -> release ( $ conn , $ dbname ) ; throw $ e ; } $ priceManager = MShop_Factory :: createManager ( $ context , 'price' ) ; $ localeManager = MShop_Factory :: createManager ( $ context , 'locale' ) ; $ 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' ] ) ; if ( $ fresh === false ) { $ basket = $ this -> _load ( $ id , $ price , $ localeItem , $ row ) ; } else { $ basket = $ this -> _loadFresh ( $ id , $ price , $ localeItem , $ row ) ; } return $ basket ; }
Creates a new basket containing all items from the order excluding the coupons.
The items will be marked as new and modified so an additional order is
stored when the basket is saved.

@param integer $id Base ID of the order to load
@param boolean $fresh Create a new basket by copying the existing one and remove IDs
@return MShop_Order_Item_Base_Interface Basket including all items
Creates a new basket containing all items from the order excluding the coupons . The items will be marked as new and modified so an additional order is stored when the basket is saved .