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

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

		try
		{
			$domain = explode( '.', $this->_prefix );

			if ( ( $topdomain = array_shift( $domain ) ) === null ) {
				throw new MShop_Exception( sprintf( 'Configuration not available' ) );
			}

			$level = MShop_Locale_Manager_Abstract::SITE_ALL;
			$cfgPathSearch = $this->_configPath . 'search';
			$cfgPathCount =  $this->_configPath . 'count';

			$name = trim( $this->_prefix, '.' );
			$required = array( $name );

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

			while( ( $row = $results->fetch() ) !== false )
			{
				if ( ( $row['config'] = json_decode( $row['config'], true ) ) === null ) {
					$row['config'] = array();
				}

				$map[ $row['id'] ] = $row;
				$typeIds[ $row['typeid'] ] = null;
			}

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

		if( !empty( $typeIds ) )
		{
			$typeManager = $this->getSubManager( 'type' );
			$typeSearch = $typeManager->createSearch();
			$typeSearch->setConditions( $typeSearch->compare( '==', $name . '.type.id', array_keys( $typeIds ) ) );
			$typeSearch->setSlice( 0, $search->getSliceSize() );
			$typeItems = $typeManager->searchItems( $typeSearch );

			foreach( $map as $id => $row )
			{
				if( isset( $typeItems[ $row['typeid'] ] ) ) {
					$row['type'] = $typeItems[ $row['typeid'] ]->getCode();
				}
				$items[ $row['id'] ] = $this->_createItem( $row );
			}
		}

		return $items;
	}