50 $iRes =
oxDb::getDb()->getOne(
"select 1 << ( $iShopId - 1 ) as shopbit" );
69 $aShopBits = array_fill(0, $iFieldCount, 0);
104 $aShopSetBits = array();
107 $aInheritedShops = array();
108 $sQ =
'select oxid, oxparentid, oxisinherited from oxshops where oxid = "'.$sShopId.
'" ';
110 if ( $rs && $rs->recordCount()> 0 && $rs->fields[0] ) {
111 $iOXID = $rs->fields[0];
112 $sParentID = $rs->fields[1];
115 if ( is_null($blIsInherited) ) {
116 $blIsInherited = $rs->fields[2];
120 $sShopId = $sParentID;
122 }
while ( ( $blIsInherited && $sParentID ) && $iCnt++ < $iMax );
142 $sSelect =
"select ({$iShopBit} & {$sField}) as isIncluded from {$sTable} where oxid = ".$oDb->quote( $sOXID );
144 return (
bool) $oDb->getOne( $sSelect );
161 $sSelect =
"select ({$iShopBit} & {$sField}) as isExcluded from {$sTable} where oxid = ".$oDb->quote( $sOXID );
163 return (
bool) $oDb->getOne( $sSelect );
175 return ceil($iShopId / self::SHOP_FIELD_SET_SIZE)-1;
187 for ($iSet=0; $iSet<$iCount; $iSet++) {
208 if ( $sFieldSet > 0 ) {
209 $sFieldName =
"oxshopincl".$sFieldSet;
210 $oDbMetadata =
oxNew(
'oxDbMetaDataHandler');
211 $blExists = $oDbMetadata->tableExists( $sTable ) && $oDbMetadata->fieldExists( $sFieldName, $sTable );
227 $aMultiShopTables = $this->
getConfig()->getConfigParam(
'aMultiShopTables' );
229 $oDbMetadata =
oxNew(
'oxDbMetaDataHandler');
231 foreach ( $aMultiShopTables as $sTable ) {
232 foreach ( array(
"OXSHOPINCL",
"OXSHOPEXCL" ) as $sField ) {
233 $sNewFieldName = $sField . $iFieldSet;
234 if ($iFieldSet > 1) {
235 $iPrevLang = $iFieldSet-1;
236 $sPrevField = $sField.$iPrevLang;
238 $sPrevField = $sField;
240 if ( !$oDbMetadata->fieldExists( $sNewFieldName, $sTable ) ) {
243 $aSql[] = $oDbMetadata->getAddFieldSql( $sTable, $sField, $sNewFieldName, $sPrevField );
247 $aSql = array_merge($aSql, (array) $oDbMetadata->getAddFieldIndexSql($sTable, $sField, $sNewFieldName));
251 $oDbMetadata->executeSql($aSql);
263 $sSuffix = ( $iSet > 0 ) ? $iSet :
'';
291 return $sField.$sSuffix;
320 $sSnippet =
"{$sField} = {$sField} | $iBit";
337 $sSnippet =
"{$sField} = {$sField} & ~{$iBit}";
354 $sSnippet =
"{$sField} = {$sField} | $iBit";
371 $sSnippet =
"{$iField} = {$iField} & ~{$iBit}";
385 return 1 + (($iShopId - 1) % self::SHOP_FIELD_SET_SIZE);
405 return oxDb::getDb()->getOne(
"select max(oxid) as maxid from oxshops" );
419 foreach ( $aShopSetBits as $iShopSet => $aBits ) {
421 $iRes =
oxDb::getDb()->getOne(
"select (".implode(
" | ", $aBits).
") as bitwiseOr" );
422 $aFieldSets[$iShopSet] = $iRes;