14 array(
'oxtitle',
'oxcategories', 1, 1, 0 ),
15 array(
'oxdesc',
'oxcategories', 1, 1, 0 ),
16 array(
'oxid',
'oxcategories', 0, 0, 0 ),
17 array(
'oxid',
'oxcategories', 0, 0, 1 )
19 'container2' => array(
20 array(
'oxtitle',
'oxcategories', 1, 1, 0 ),
21 array(
'oxdesc',
'oxcategories', 1, 1, 0 ),
22 array(
'oxid',
'oxcategories', 0, 0, 0 ),
23 array(
'oxid',
'oxobject2category', 0, 0, 1 ),
24 array(
'oxtime',
'oxobject2category', 0, 0, 1 ),
25 array(
'oxid',
'oxcategories', 0, 0, 1 )
36 $sCategoriesTable = $this->
_getViewName(
'oxcategories' );
45 $sQAdd =
" from $sO2CView left join $sCategoriesTable on $sCategoriesTable.oxid=$sO2CView.oxcatnid ";
46 $sQAdd .=
" where $sO2CView.oxobjectid = " . $oDb->quote( $sOxid ) .
" and $sCategoriesTable.oxid is not null ";
48 $sQAdd =
" from $sCategoriesTable where $sCategoriesTable.oxid not in ( ";
49 $sQAdd .=
" select $sCategoriesTable.oxid from $sO2CView left join $sCategoriesTable on $sCategoriesTable.oxid=$sO2CView.oxcatnid ";
50 $sQAdd .=
" where $sO2CView.oxobjectid = " . $oDb->quote( $sSynchOxid ) .
" and $sCategoriesTable.oxid is not null ) and $sCategoriesTable.oxpriceto = '0'";
71 reset( $aDataFields );
72 while ( list( $iPos, $aField ) = each( $aDataFields ) ) {
75 if ( $aField[
'_3'] ==
'0' ) {
81 $iMinVal = $aField[
'_3'];
83 } elseif ( $iMinVal > $aField[
'_3'] ) {
89 if ( isset( $iMinPos ) ) {
90 $aDataFields[$iMinPos][
'_3'] =
'0';
113 $sCategoriesTable = $this->
_getViewName(
'oxcategories' );
118 if ( is_array( $aRemoveCat ) && count( $aRemoveCat ) ) {
120 $sQ =
"delete from oxobject2category where oxobject2category.oxobjectid= " .
oxDb::getDb()->quote( $soxId ) .
" and ";
121 $sQ .=
" oxcatnid in (" . implode(
', ',
oxDb::getInstance()->quoteArray( $aRemoveCat ) ) .
')';
122 $oDb->Execute( $sQ );
151 $sCategoriesTable = $this->
_getViewName(
'oxcategories' );
155 if ( isset( $aAddCat) && is_array($aAddCat)) {
159 $oNew =
oxNew(
'oxbase' );
160 $oNew->init(
'oxobject2category' );
163 foreach ( $aAddCat as $sAdd ) {
166 $sSelect =
"select 1 from " . $sO2CView .
" as oxobject2category where oxobject2category.oxcatnid= " . $oDb->quote( $sAdd ) .
" and oxobject2category.oxobjectid = " . $oDb->quote( $soxId ) .
" ";
167 if ( $oDb->getOne( $sSelect,
false,
false ) )
170 $oNew->setId( $myUtilsObj->generateUID() );
171 $oNew->oxobject2category__oxobjectid =
new oxField( $soxId );
172 $oNew->oxobject2category__oxcatnid =
new oxField( $sAdd );
173 $oNew->oxobject2category__oxtime =
new oxField( time() );
199 $soxId = $oDb->quote( $soxId );
202 $sQ =
"update oxobject2category set oxtime = 0 where oxobjectid = {$soxId} and oxid = (
204 select oxid from {$sO2CView} where oxobjectid = {$soxId} order by oxtime limit 1
207 $oDb->execute( $sQ );
226 $sQ =
"update oxobject2category set oxtime = oxtime + 10 where oxobjectid = " . $oDb->quote( $soxId );
230 $sQ =
"update oxobject2category set oxtime = 0 where oxobjectid = " . $oDb->quote( $soxId ) .
" and oxcatnid = " . $oDb->quote( $sDefCat ) .
" $sShopCheck ";
235 oxRegistry::get(
"oxSeoEncoder")->markAsExpired( $soxId, null, 1, null,
"oxtype='oxarticle'" );