public function getServices( $type, MShop_Order_Item_Base_Interface $basket,
		$ref = array( 'media', 'price', 'text' ) )
	{
		if( isset( $this->_items[$type] ) ) {
			return $this->_items[$type];
		}

		$serviceManager = MShop_Factory::createManager( $this->_getContext(), 'service' );

		$search = $serviceManager->createSearch( true );
		$expr = array(
			$search->getConditions(),
			$search->compare( '==', 'service.type.domain', 'service' ),
			$search->compare( '==', 'service.type.code', $type ),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );
		$search->setSortations( array( $search->sort( '+', 'service.position' ) ) );

		$this->_items[$type] = $serviceManager->searchItems( $search, $ref );


		foreach( $this->_items[$type] as $id => $service )
		{
			try
			{
				$provider = $serviceManager->getProvider( $service );

				if( $provider->isAvailable( $basket ) ) {
					$this->_providers[$type][$id] = $provider;
				} else {
					unset( $this->_items[$type][$id] );
				}
			}
			catch( MShop_Service_Exception $e )
			{
				$msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id );
				$this->_getContext()->getLogger()->log( $msg, MW_Logger_Abstract::WARN );
			}
		}

		return $this->_items[$type];
	}
public function getServices( $type, MShop_Order_Item_Base_Interface $basket,
		$ref = array( 'media', 'price', 'text' ) )
	{
		if( isset( $this->_items[$type] ) ) {
			return $this->_items[$type];
		}

		$serviceManager = MShop_Factory::createManager( $this->_getContext(), 'service' );

		$search = $serviceManager->createSearch( true );
		$expr = array(
			$search->getConditions(),
			$search->compare( '==', 'service.type.domain', 'service' ),
			$search->compare( '==', 'service.type.code', $type ),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );
		$search->setSortations( array( $search->sort( '+', 'service.position' ) ) );

		$this->_items[$type] = $serviceManager->searchItems( $search, $ref );


		foreach( $this->_items[$type] as $id => $service )
		{
			try
			{
				$provider = $serviceManager->getProvider( $service );

				if( $provider->isAvailable( $basket ) ) {
					$this->_providers[$type][$id] = $provider;
				} else {
					unset( $this->_items[$type][$id] );
				}
			}
			catch( MShop_Service_Exception $e )
			{
				$msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id );
				$this->_getContext()->getLogger()->log( $msg, MW_Logger_Abstract::WARN );
			}
		}

		return $this->_items[$type];
	}
public function getServices ( $ type , MShop_Order_Item_Base_Interface $ basket , $ ref = array ( 'media' , 'price' , 'text' ) ) { if ( isset ( $ this -> _items [ $ type ] ) ) { return $ this -> _items [ $ type ] ; } $ serviceManager = MShop_Factory :: createManager ( $ this -> _getContext ( ) , 'service' ) ; $ search = $ serviceManager -> createSearch ( true ) ; $ expr = array ( $ search -> getConditions ( ) , $ search -> compare ( '==' , 'service.type.domain' , 'service' ) , $ search -> compare ( '==' , 'service.type.code' , $ type ) , ) ; $ search -> setConditions ( $ search -> combine ( '&&' , $ expr ) ) ; $ search -> setSortations ( array ( $ search -> sort ( '+' , 'service.position' ) ) ) ; $ this -> _items [ $ type ] = $ serviceManager -> searchItems ( $ search , $ ref ) ; foreach ( $ this -> _items [ $ type ] as $ id => $ service ) { try { $ provider = $ serviceManager -> getProvider ( $ service ) ; if ( $ provider -> isAvailable ( $ basket ) ) { $ this -> _providers [ $ type ] [ $ id ] = $ provider ; } else { unset ( $ this -> _items [ $ type ] [ $ id ] ) ; } } catch ( MShop_Service_Exception $ e ) { $ msg = sprintf ( 'Unable to create provider "%1$s" for service with ID "%2$s"' , $ service -> getCode ( ) , $ id ) ; $ this -> _getContext ( ) -> getLogger ( ) -> log ( $ msg , MW_Logger_Abstract :: WARN ) ; } } return $ this -> _items [ $ type ] ; }
Returns the service items that are available for the service type and the content of the basket.

@param string $type Service type, e.g. "delivery" (shipping related) or "payment" (payment related)
@param MShop_Order_Item_Base_Interface $basket Basket of the user
@param array $ref List of domains for which the items referenced by the services should be fetched too
@return array List of service items implementing MShop_Service_Item_Interface with referenced items
@throws Exception If an error occurs
Returns the service items that are available for the service type and the content of the basket .