private function _bootstrapMatch( $siteId, $lang, $currency, $active,
		MShop_Locale_Item_Site_Interface $siteItem, array $sitePath, array $siteSubTree )
	{
		// Try to find exact match
		$search = $this->createSearch( $active );

		$expr = array( $search->compare( '==', 'locale.siteid', $sitePath ) );

		if( !empty( $lang ) ) {
			$expr[] = $search->compare( '==', 'locale.languageid', $lang );
		}

		if( !empty( $currency ) ) {
			$expr[] = $search->compare( '==', 'locale.currencyid', $currency );
		}

		$expr[] = $search->getConditions();


		if ( $active === true )
		{
			$expr[] = $search->compare( '>', 'locale.currency.status', 0 );
			$expr[] = $search->compare( '>', 'locale.language.status', 0 );
			$expr[] = $search->compare( '>', 'locale.site.status', 0 );
		}

		$search->setConditions( $search->combine( '&&', $expr ) );
		$result = $this->_search( $search );

		// Try to find first item where site matches
		foreach( $result as $row )
		{
			if( $row['siteid'] == $siteId ) {
				return $this->_createItem( $row, $siteItem, $sitePath, $siteSubTree );
			}
		}

		if( ( $row = reset( $result ) ) !== false )
		{
			$row['siteid'] = $siteId;
			return $this->_createItem( $row, $siteItem, $sitePath, $siteSubTree );
		}

		return false;
	}
private function _bootstrapMatch( $siteId, $lang, $currency, $active,
		MShop_Locale_Item_Site_Interface $siteItem, array $sitePath, array $siteSubTree )
	{
		// Try to find exact match
		$search = $this->createSearch( $active );

		$expr = array( $search->compare( '==', 'locale.siteid', $sitePath ) );

		if( !empty( $lang ) ) {
			$expr[] = $search->compare( '==', 'locale.languageid', $lang );
		}

		if( !empty( $currency ) ) {
			$expr[] = $search->compare( '==', 'locale.currencyid', $currency );
		}

		$expr[] = $search->getConditions();


		if ( $active === true )
		{
			$expr[] = $search->compare( '>', 'locale.currency.status', 0 );
			$expr[] = $search->compare( '>', 'locale.language.status', 0 );
			$expr[] = $search->compare( '>', 'locale.site.status', 0 );
		}

		$search->setConditions( $search->combine( '&&', $expr ) );
		$result = $this->_search( $search );

		// Try to find first item where site matches
		foreach( $result as $row )
		{
			if( $row['siteid'] == $siteId ) {
				return $this->_createItem( $row, $siteItem, $sitePath, $siteSubTree );
			}
		}

		if( ( $row = reset( $result ) ) !== false )
		{
			$row['siteid'] = $siteId;
			return $this->_createItem( $row, $siteItem, $sitePath, $siteSubTree );
		}

		return false;
	}
private function _bootstrapMatch ( $ siteId , $ lang , $ currency , $ active , MShop_Locale_Item_Site_Interface $ siteItem , array $ sitePath , array $ siteSubTree ) { // Try to find exact match $ search = $ this -> createSearch ( $ active ) ; $ expr = array ( $ search -> compare ( '==' , 'locale.siteid' , $ sitePath ) ) ; if ( ! empty ( $ lang ) ) { $ expr [ ] = $ search -> compare ( '==' , 'locale.languageid' , $ lang ) ; } if ( ! empty ( $ currency ) ) { $ expr [ ] = $ search -> compare ( '==' , 'locale.currencyid' , $ currency ) ; } $ expr [ ] = $ search -> getConditions ( ) ; if ( $ active === true ) { $ expr [ ] = $ search -> compare ( '>' , 'locale.currency.status' , 0 ) ; $ expr [ ] = $ search -> compare ( '>' , 'locale.language.status' , 0 ) ; $ expr [ ] = $ search -> compare ( '>' , 'locale.site.status' , 0 ) ; } $ search -> setConditions ( $ search -> combine ( '&&' , $ expr ) ) ; $ result = $ this -> _search ( $ search ) ; // Try to find first item where site matches foreach ( $ result as $ row ) { if ( $ row [ 'siteid' ] == $ siteId ) { return $ this -> _createItem ( $ row , $ siteItem , $ sitePath , $ siteSubTree ) ; } } if ( ( $ row = reset ( $ result ) ) !== false ) { $ row [ 'siteid' ] = $ siteId ; return $ this -> _createItem ( $ row , $ siteItem , $ sitePath , $ siteSubTree ) ; } return false ; }
Returns the matching locale item for the given site code, language code and currency code.

If the locale item is inherited from a parent site, the site ID of this locale item
is changed to the site ID of the actual site. This ensures that items assigned to
the same site as the site item are still used.

@param string $siteId Site ID
@param string $lang Language code
@param string $currency Currency code
@param boolean $active Flag to get only active items
@param MShop_Locale_Item_Site_Interface Site item
@param array $sitePath List of site IDs up to the root site
@param array $siteSubTree List of site IDs below and including the current site
@return MShop_Locale_Item_Interface|boolean Locale item for the given parameters or false if no item was found
Returns the matching locale item for the given site code language code and currency code .