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',
'oxobject2article', 0, 0, 1)
58 $sQAdd =
" from {$sArticleTable} where 1 ";
59 $sQAdd .=
$myConfig->getConfigParam(
'blVariantsSelection') ?
'' :
" and {$sArticleTable}.oxparentid = '' ";
60 } elseif ($sSynchSelId && $sSelId != $sSynchSelId) {
62 $blVariantsSelectionParameter =
$myConfig->getConfigParam(
'blVariantsSelection');
63 $sSqlIfTrue =
" ({$sArticleTable}.oxid=oxobject2category.oxobjectid " .
64 "or {$sArticleTable}.oxparentid=oxobject2category.oxobjectid)";
65 $sSqlIfFalse =
" {$sArticleTable}.oxid=oxobject2category.oxobjectid ";
66 $sVariantsSelectionSnippet = $blVariantsSelectionParameter ? $sSqlIfTrue : $sSqlIfFalse;
68 $sQAdd =
" from {$sView} as oxobject2category left join {$sArticleTable} on {$sVariantsSelectionSnippet}" .
69 " where oxobject2category.oxcatnid = " . $oDb->quote($sSelId) .
" ";
70 } elseif (
$myConfig->getConfigParam(
'blBidirectCross')) {
71 $sQAdd =
" from oxobject2article " .
72 " inner join {$sArticleTable} on ( oxobject2article.oxobjectid = {$sArticleTable}.oxid " .
73 " or oxobject2article.oxarticlenid = {$sArticleTable}.oxid ) " .
74 " where ( oxobject2article.oxarticlenid = " . $oDb->quote($sSelId) .
75 " or oxobject2article.oxobjectid = " . $oDb->quote($sSelId) .
" ) " .
76 " and {$sArticleTable}.oxid != " . $oDb->quote($sSelId) .
" ";
78 $sQAdd =
" from oxobject2article left join {$sArticleTable} " .
79 "on oxobject2article.oxobjectid={$sArticleTable}.oxid " .
80 " where oxobject2article.oxarticlenid = " . $oDb->quote($sSelId) .
" ";
83 if ($sSynchSelId && $sSynchSelId != $sSelId) {
84 if (
$myConfig->getConfigParam(
'blBidirectCross')) {
85 $sSubSelect =
"select {$sArticleTable}.oxid from oxobject2article " .
86 "left join {$sArticleTable} on (oxobject2article.oxobjectid={$sArticleTable}.oxid " .
87 "or oxobject2article.oxarticlenid={$sArticleTable}.oxid) " .
88 "where (oxobject2article.oxarticlenid = " . $oDb->quote($sSynchSelId) .
89 " or oxobject2article.oxobjectid = " . $oDb->quote($sSynchSelId) .
" )";
91 $sSubSelect =
"select {$sArticleTable}.oxid from oxobject2article " .
92 "left join {$sArticleTable} on oxobject2article.oxobjectid={$sArticleTable}.oxid " .
93 "where oxobject2article.oxarticlenid = " . $oDb->quote($sSynchSelId) .
" ";
96 $sSubSelect .=
" and {$sArticleTable}.oxid IS NOT NULL ";
97 $sQAdd .=
" and {$sArticleTable}.oxid not in ( $sSubSelect ) ";
101 $sQAdd .=
" and {$sArticleTable}.oxid IS NOT NULL ";
104 $sId = ($sSynchSelId) ? $sSynchSelId : $sSelId;
105 $sQAdd .=
" and {$sArticleTable}.oxid != " . $oDb->quote($sId) .
" ";
120 } elseif (is_array($aChosenArt)) {
122 $sQ =
"delete from oxobject2article where oxobject2article.oxid in (" . $sChosenArticles .
") ";
139 $aChosenArt = $this->
_getAll(parent::_addFilter(
"select $sArtTable.oxid " . $this->
_getQuery()));
142 $oArticle =
oxNew(
"oxarticle");
143 if ($oArticle->load($soxId) && $soxId && $soxId !=
"-1" && is_array($aChosenArt)) {
144 foreach ($aChosenArt as $sAdd) {
145 $oNewGroup =
oxNew(
'oxbase');
146 $oNewGroup->init(
'oxobject2article');
147 $oNewGroup->oxobject2article__oxobjectid =
new oxField($sAdd);
148 $oNewGroup->oxobject2article__oxarticlenid =
new oxField($oArticle->oxarticles__oxid->value);
149 $oNewGroup->oxobject2article__oxsort =
new oxField(0);