22         array(
'oxartnum', 
'oxarticles', 1, 0, 0),
 
   23         array(
'oxtitle', 
'oxarticles', 1, 1, 0),
 
   24         array(
'oxean', 
'oxarticles', 1, 0, 0),
 
   25         array(
'oxmpn', 
'oxarticles', 0, 0, 0),
 
   26         array(
'oxprice', 
'oxarticles', 0, 0, 0),
 
   27         array(
'oxstock', 
'oxarticles', 0, 0, 0),
 
   28         array(
'oxid', 
'oxarticles', 0, 0, 1)
 
   30                                  'container2' => array(
 
   31                                      array(
'oxartnum', 
'oxarticles', 1, 0, 0),
 
   32                                      array(
'oxtitle', 
'oxarticles', 1, 1, 0),
 
   33                                      array(
'oxean', 
'oxarticles', 1, 0, 0),
 
   34                                      array(
'oxmpn', 
'oxarticles', 0, 0, 0),
 
   35                                      array(
'oxprice', 
'oxarticles', 0, 0, 0),
 
   36                                      array(
'oxstock', 
'oxarticles', 0, 0, 0),
 
   37                                      array(
'oxid', 
'oxarticles', 0, 0, 1)
 
   60         if (!$sOxid && $sSynchOxid) {
 
   63             $sQAdd = 
' from ' . $sArticleTable . 
' where 1 ';
 
   67             $sJoin = 
" {$sArticleTable}.oxid={$sO2CView}.oxobjectid ";
 
   70             if ($sSynchOxid && $sOxid != $sSynchOxid) {
 
   72                 $sSubSelect = 
' and ' . $sArticleTable . 
'.oxid not in ( ';
 
   73                 $sSubSelect .= 
"select $sArticleTable.oxid from $sO2CView left join $sArticleTable ";
 
   74                 $sSubSelect .= 
"on $sJoin where $sO2CView.oxcatnid =  " . $oDb->quote($sSynchOxid) . 
" ";
 
   75                 $sSubSelect .= 
'and ' . $sArticleTable . 
'.oxid is not null ) ';
 
   78             $sQAdd = 
" from $sO2CView join $sArticleTable ";
 
   79             $sQAdd .= 
" on $sJoin where $sO2CView.oxcatnid = " . $oDb->quote($sOxid);
 
   80             $sQAdd .= 
" and $sArticleTable.oxid is not null $sSubSelect ";
 
   99         if (!$this->
getConfig()->getConfigParam(
'blVariantsSelection')) {
 
  100             $sQ .= 
" and {$sArtTable}.oxparentid = '' ";
 
  125         if (is_array($aArticles)) {
 
  129             $oNew = 
oxNew(
'oxobject2category');
 
  134             foreach ($aArticles as $sAdd) {
 
  137                 $sSelect = 
"select 1 from $sO2CView as oxobject2category where oxobject2category.oxcatnid= " 
  138                            . $oDb->quote($sCategoryID) . 
" and oxobject2category.oxobjectid = " . $oDb->quote($sAdd) . 
"";
 
  139                 if ($oDb->getOne($sSelect, 
false, 
false)) {
 
  143                 $oNew->oxobject2category__oxid = 
new oxField($oNew->setId(md5($sAdd . $sCategoryID . $sShopID)));
 
  144                 $oNew->oxobject2category__oxobjectid = 
new oxField($sAdd);
 
  145                 $oNew->oxobject2category__oxcatnid = 
new oxField($sCategoryID);
 
  146                 $oNew->oxobject2category__oxtime = 
new oxField(time());
 
  153                 $sProdIds .= $oDb->quote($sAdd);
 
  174             $sSqlShopFilter = 
"";
 
  175             $sSqlWhereShopFilter = 
"";
 
  176             $sQ = 
"update oxobject2category set oxtime = 0 where oxid in ( 
  177                       select _tmp.oxid from ( 
  178                           select oxobject2category.oxid from ( 
  179                               select min(oxtime) as oxtime, oxobjectid from {$sO2CView} 
  180                               where oxobjectid in ( {$sProdIds} ) {$sSqlShopFilter} group by oxobjectid 
  182                           left join oxobject2category on oxobject2category.oxtime = _subtmp.oxtime 
  183                            and oxobject2category.oxobjectid = _subtmp.oxobjectid 
  184                            {$sSqlWhereShopFilter} 
  186                    ) {$sSqlShopFilter}";
 
  199         $sShopID = $this->
getConfig()->getShopId();
 
  209         if (is_array($aArticles) && count($aArticles)) {
 
  212             $sDelete = 
"delete from oxobject2category where";
 
  213             $sWhere = 
" oxcatnid=" . $oDb->quote($sCategoryID);
 
  214             if (!$this->
getConfig()->getConfigParam(
'blVariantsSelection')) {
 
  215                 $sQ = $sDelete . $sWhere . 
" and oxobjectid in 
  216                     ( select oxid from oxarticles where oxparentid in ( {$sProdIds} ) )";
 
  219             $sQ = $sDelete . $sWhere . 
" and oxobjectid in ( {$sProdIds} )";