repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
partition
stringclasses
1 value
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/DiscountCategoriesAjax.php
DiscountCategoriesAjax.addCategoryToDiscount
protected function addCategoryToDiscount($discountId, $categoryId) { $object2Discount = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $object2Discount->init('oxobject2discount'); $object2Discount->oxobject2discount__oxdiscountid = new \OxidEsales\Eshop\Core\Field($discountId); $object2Discount->oxobject2discount__oxobjectid = new \OxidEsales\Eshop\Core\Field($categoryId); $object2Discount->oxobject2discount__oxtype = new \OxidEsales\Eshop\Core\Field("oxcategories"); $object2Discount->save(); }
php
protected function addCategoryToDiscount($discountId, $categoryId) { $object2Discount = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $object2Discount->init('oxobject2discount'); $object2Discount->oxobject2discount__oxdiscountid = new \OxidEsales\Eshop\Core\Field($discountId); $object2Discount->oxobject2discount__oxobjectid = new \OxidEsales\Eshop\Core\Field($categoryId); $object2Discount->oxobject2discount__oxtype = new \OxidEsales\Eshop\Core\Field("oxcategories"); $object2Discount->save(); }
[ "protected", "function", "addCategoryToDiscount", "(", "$", "discountId", ",", "$", "categoryId", ")", "{", "$", "object2Discount", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Model", "\\", "BaseModel", "::", "class", ")", ";",...
Adds category to discounts list. @param string $discountId @param string $categoryId
[ "Adds", "category", "to", "discounts", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DiscountCategoriesAjax.php#L127-L136
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderRecomm.php
SeoEncoderRecomm.getRecommUri
public function getRecommUri($oRecomm, $iLang = null) { if (!($sSeoUrl = $this->_loadFromDb('dynamic', $oRecomm->getId(), $iLang))) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // fetching part of base url $sSeoUrl = $this->_getStaticUri( $oRecomm->getBaseStdLink($iLang, false), $myConfig->getShopId(), $iLang ) . $this->_prepareTitle($oRecomm->oxrecommlists__oxtitle->value, false, $iLang); // creating unique $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oRecomm->getId(), $iLang); // inserting $this->_saveToDb('dynamic', $oRecomm->getId(), $oRecomm->getBaseStdLink($iLang), $sSeoUrl, $iLang, $myConfig->getShopId()); } return $sSeoUrl; }
php
public function getRecommUri($oRecomm, $iLang = null) { if (!($sSeoUrl = $this->_loadFromDb('dynamic', $oRecomm->getId(), $iLang))) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // fetching part of base url $sSeoUrl = $this->_getStaticUri( $oRecomm->getBaseStdLink($iLang, false), $myConfig->getShopId(), $iLang ) . $this->_prepareTitle($oRecomm->oxrecommlists__oxtitle->value, false, $iLang); // creating unique $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oRecomm->getId(), $iLang); // inserting $this->_saveToDb('dynamic', $oRecomm->getId(), $oRecomm->getBaseStdLink($iLang), $sSeoUrl, $iLang, $myConfig->getShopId()); } return $sSeoUrl; }
[ "public", "function", "getRecommUri", "(", "$", "oRecomm", ",", "$", "iLang", "=", "null", ")", "{", "if", "(", "!", "(", "$", "sSeoUrl", "=", "$", "this", "->", "_loadFromDb", "(", "'dynamic'", ",", "$", "oRecomm", "->", "getId", "(", ")", ",", "$...
Returns SEO uri for tag. @param \OxidEsales\Eshop\Application\Model\RecommendationList $oRecomm recommendation list object @param int $iLang language @return string
[ "Returns", "SEO", "uri", "for", "tag", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderRecomm.php#L26-L47
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderRecomm.php
SeoEncoderRecomm.getRecommUrl
public function getRecommUrl($oRecomm, $iLang = null) { if (!isset($iLang)) { $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } return $this->_getFullUrl($this->getRecommUri($oRecomm, $iLang), $iLang); }
php
public function getRecommUrl($oRecomm, $iLang = null) { if (!isset($iLang)) { $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } return $this->_getFullUrl($this->getRecommUri($oRecomm, $iLang), $iLang); }
[ "public", "function", "getRecommUrl", "(", "$", "oRecomm", ",", "$", "iLang", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "iLang", ")", ")", "{", "$", "iLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", ":...
Returns full url for passed tag @param \OxidEsales\Eshop\Application\Model\RecommendationList $oRecomm recommendation list object @param int $iLang language @return string
[ "Returns", "full", "url", "for", "passed", "tag" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderRecomm.php#L57-L64
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderRecomm.php
SeoEncoderRecomm.getRecommPageUrl
public function getRecommPageUrl($recomm, $pageNumber, $languageId = null, $isFixed = false) { if (!isset($languageId)) { $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } $stdUrl = $recomm->getBaseStdLink($languageId); $parameters = null; $stdUrl = $this->_trimUrl($stdUrl, $languageId); $seoUrl = $this->getRecommUri($recomm, $languageId); return $this->assembleFullPageUrl($recomm, 'dynamic', $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed); }
php
public function getRecommPageUrl($recomm, $pageNumber, $languageId = null, $isFixed = false) { if (!isset($languageId)) { $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } $stdUrl = $recomm->getBaseStdLink($languageId); $parameters = null; $stdUrl = $this->_trimUrl($stdUrl, $languageId); $seoUrl = $this->getRecommUri($recomm, $languageId); return $this->assembleFullPageUrl($recomm, 'dynamic', $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed); }
[ "public", "function", "getRecommPageUrl", "(", "$", "recomm", ",", "$", "pageNumber", ",", "$", "languageId", "=", "null", ",", "$", "isFixed", "=", "false", ")", "{", "if", "(", "!", "isset", "(", "$", "languageId", ")", ")", "{", "$", "languageId", ...
Returns tag SEO url for specified page @param \OxidEsales\Eshop\Application\Model\RecommendationList $recomm Recommendation list object. @param int $pageNumber Number of the page which should be prepared. @param int $languageId Language id. @param bool $isFixed Fixed url marker (default is null). @return string
[ "Returns", "tag", "SEO", "url", "for", "specified", "page" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderRecomm.php#L76-L88
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel.setLanguage
public function setLanguage($lang = null) { $this->_iLanguage = (int) $lang; // reset $this->_sViewTable = false; }
php
public function setLanguage($lang = null) { $this->_iLanguage = (int) $lang; // reset $this->_sViewTable = false; }
[ "public", "function", "setLanguage", "(", "$", "lang", "=", "null", ")", "{", "$", "this", "->", "_iLanguage", "=", "(", "int", ")", "$", "lang", ";", "// reset", "$", "this", "->", "_sViewTable", "=", "false", ";", "}" ]
Sets object language. @param string $lang string (default null)
[ "Sets", "object", "language", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L58-L63
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel.getLanguage
public function getLanguage() { if ($this->_iLanguage === null) { $this->_iLanguage = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } return $this->_iLanguage; }
php
public function getLanguage() { if ($this->_iLanguage === null) { $this->_iLanguage = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } return $this->_iLanguage; }
[ "public", "function", "getLanguage", "(", ")", "{", "if", "(", "$", "this", "->", "_iLanguage", "===", "null", ")", "{", "$", "this", "->", "_iLanguage", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")",...
Returns object language @return int
[ "Returns", "object", "language" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L70-L77
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel.loadInLang
public function loadInLang($language, $oxid) { // set new lang to this object $this->setLanguage($language); // reset $this->_sViewTable = false; return $this->load($oxid); }
php
public function loadInLang($language, $oxid) { // set new lang to this object $this->setLanguage($language); // reset $this->_sViewTable = false; return $this->load($oxid); }
[ "public", "function", "loadInLang", "(", "$", "language", ",", "$", "oxid", ")", "{", "// set new lang to this object", "$", "this", "->", "setLanguage", "(", "$", "language", ")", ";", "// reset", "$", "this", "->", "_sViewTable", "=", "false", ";", "return...
Loads object data from DB in passed language, returns true on success. @param integer $language Load this language compatible data @param string $oxid object ID @return bool
[ "Loads", "object", "data", "from", "DB", "in", "passed", "language", "returns", "true", "on", "success", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L144-L152
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel.modifyCacheKey
public function modifyCacheKey($cacheKey, $override = false) { if ($override) { $this->_sCacheKey = $cacheKey . "|i18n"; } else { $this->_sCacheKey .= $cacheKey; } if (!$cacheKey) { $this->_sCacheKey = null; } }
php
public function modifyCacheKey($cacheKey, $override = false) { if ($override) { $this->_sCacheKey = $cacheKey . "|i18n"; } else { $this->_sCacheKey .= $cacheKey; } if (!$cacheKey) { $this->_sCacheKey = null; } }
[ "public", "function", "modifyCacheKey", "(", "$", "cacheKey", ",", "$", "override", "=", "false", ")", "{", "if", "(", "$", "override", ")", "{", "$", "this", "->", "_sCacheKey", "=", "$", "cacheKey", ".", "\"|i18n\"", ";", "}", "else", "{", "$", "th...
Lazy loading cache key modifier. @param string $cacheKey kache key @param bool $override marker to force override cache key
[ "Lazy", "loading", "cache", "key", "modifier", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L160-L171
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel.getAvailableInLangs
public function getAvailableInLangs() { $languages = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(); $objFields = $this->_getTableFields( getViewName($this->_sCoreTable, -1, -1), true ); $multiLangFields = []; //selecting all object multilang fields foreach ($objFields as $key => $value) { //skipping oxactive field if (preg_match('/^oxactive(_(\d{1,2}))?$/', $key)) { continue; } $fieldLang = $this->_getFieldLang($key); //checking, if field is multilanguage if ($this->isMultilingualField($key) || $fieldLang > 0) { $newKey = preg_replace('/_(\d{1,2})$/', '', $key); $multiLangFields[$newKey][] = (int) $fieldLang; } } // if no multilanguage fields, return default languages array if (count($multiLangFields) < 1) { return $languages; } // select from non-multilanguage core view (all ml tables joined to one) $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $query = "select * from " . getViewName($this->_sCoreTable, -1, -1) . " where oxid = " . $db->quote($this->getId()); $rs = $db->getAll($query); $notInLang = $languages; // checks if object field data is not empty in all available languages // and formats not available in languages array if (isset($rs[0]) && is_array($rs[0]) && count($rs[0])) { foreach ($multiLangFields as $fieldId => $multiLangIds) { foreach ($multiLangIds as $multiLangId) { $fieldName = ($multiLangId == 0) ? $fieldId : $fieldId . '_' . $multiLangId; if ($rs[0][strtoupper($fieldName)]) { unset($notInLang[$multiLangId]); continue; } } } } return array_diff($languages, $notInLang); }
php
public function getAvailableInLangs() { $languages = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(); $objFields = $this->_getTableFields( getViewName($this->_sCoreTable, -1, -1), true ); $multiLangFields = []; //selecting all object multilang fields foreach ($objFields as $key => $value) { //skipping oxactive field if (preg_match('/^oxactive(_(\d{1,2}))?$/', $key)) { continue; } $fieldLang = $this->_getFieldLang($key); //checking, if field is multilanguage if ($this->isMultilingualField($key) || $fieldLang > 0) { $newKey = preg_replace('/_(\d{1,2})$/', '', $key); $multiLangFields[$newKey][] = (int) $fieldLang; } } // if no multilanguage fields, return default languages array if (count($multiLangFields) < 1) { return $languages; } // select from non-multilanguage core view (all ml tables joined to one) $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $query = "select * from " . getViewName($this->_sCoreTable, -1, -1) . " where oxid = " . $db->quote($this->getId()); $rs = $db->getAll($query); $notInLang = $languages; // checks if object field data is not empty in all available languages // and formats not available in languages array if (isset($rs[0]) && is_array($rs[0]) && count($rs[0])) { foreach ($multiLangFields as $fieldId => $multiLangIds) { foreach ($multiLangIds as $multiLangId) { $fieldName = ($multiLangId == 0) ? $fieldId : $fieldId . '_' . $multiLangId; if ($rs[0][strtoupper($fieldName)]) { unset($notInLang[$multiLangId]); continue; } } } } return array_diff($languages, $notInLang); }
[ "public", "function", "getAvailableInLangs", "(", ")", "{", "$", "languages", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", "->", "getLanguageNames", "(", ")", ";", "$", "objFields", "=", "$", "this", ...
Returns an array of languages in which object multilanguage fields are already setted @return array
[ "Returns", "an", "array", "of", "languages", "in", "which", "object", "multilanguage", "fields", "are", "already", "setted" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L179-L232
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel.getUpdateSqlFieldName
public function getUpdateSqlFieldName($field) { $lang = $this->getLanguage(); if ($lang && $this->_blEmployMultilanguage && $this->isMultilingualField($field)) { $field .= "_" . $lang; } return $field; }
php
public function getUpdateSqlFieldName($field) { $lang = $this->getLanguage(); if ($lang && $this->_blEmployMultilanguage && $this->isMultilingualField($field)) { $field .= "_" . $lang; } return $field; }
[ "public", "function", "getUpdateSqlFieldName", "(", "$", "field", ")", "{", "$", "lang", "=", "$", "this", "->", "getLanguage", "(", ")", ";", "if", "(", "$", "lang", "&&", "$", "this", "->", "_blEmployMultilanguage", "&&", "$", "this", "->", "isMultilin...
Returns DB field name for update. @param string $field Field name @return string
[ "Returns", "DB", "field", "name", "for", "update", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L320-L328
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel._getUpdateFieldsForTable
protected function _getUpdateFieldsForTable($table, $useSkipSaveFields = true) { $coreTable = $this->getCoreTableName(); $skipMultilingual = false; $skipCoreFields = false; if ($table != $coreTable) { $skipCoreFields = true; } if ($this->_blEmployMultilanguage) { if ($table != getLangTableName($coreTable, $this->getLanguage())) { $skipMultilingual = true; } } $sql = ''; $sep = false; foreach (array_keys($this->_aFieldNames) as $key) { $keyLowercase = strtolower($key); if ($keyLowercase != 'oxid') { if ($this->_blEmployMultilanguage) { if ($skipMultilingual && $this->isMultilingualField($key)) { continue; } if ($skipCoreFields && !$this->isMultilingualField($key)) { continue; } } else { // need to explicitly check field language $fieldLang = $this->_getFieldLang($key); if ($fieldLang) { if ($table != getLangTableName($coreTable, $fieldLang)) { continue; } } elseif ($skipCoreFields) { continue; } } } if (!$this->checkFieldCanBeUpdated($key)) { continue; } $longName = $this->_getFieldLongName($key); $field = $this->$longName; if (!$useSkipSaveFields || ($useSkipSaveFields && !in_array($keyLowercase, $this->_aSkipSaveFields))) { $key = $this->getUpdateSqlFieldName($key); $sql .= (($sep) ? ',' : '') . $key . " = " . $this->_getUpdateFieldValue($key, $field); $sep = true; } } return $sql; }
php
protected function _getUpdateFieldsForTable($table, $useSkipSaveFields = true) { $coreTable = $this->getCoreTableName(); $skipMultilingual = false; $skipCoreFields = false; if ($table != $coreTable) { $skipCoreFields = true; } if ($this->_blEmployMultilanguage) { if ($table != getLangTableName($coreTable, $this->getLanguage())) { $skipMultilingual = true; } } $sql = ''; $sep = false; foreach (array_keys($this->_aFieldNames) as $key) { $keyLowercase = strtolower($key); if ($keyLowercase != 'oxid') { if ($this->_blEmployMultilanguage) { if ($skipMultilingual && $this->isMultilingualField($key)) { continue; } if ($skipCoreFields && !$this->isMultilingualField($key)) { continue; } } else { // need to explicitly check field language $fieldLang = $this->_getFieldLang($key); if ($fieldLang) { if ($table != getLangTableName($coreTable, $fieldLang)) { continue; } } elseif ($skipCoreFields) { continue; } } } if (!$this->checkFieldCanBeUpdated($key)) { continue; } $longName = $this->_getFieldLongName($key); $field = $this->$longName; if (!$useSkipSaveFields || ($useSkipSaveFields && !in_array($keyLowercase, $this->_aSkipSaveFields))) { $key = $this->getUpdateSqlFieldName($key); $sql .= (($sep) ? ',' : '') . $key . " = " . $this->_getUpdateFieldValue($key, $field); $sep = true; } } return $sql; }
[ "protected", "function", "_getUpdateFieldsForTable", "(", "$", "table", ",", "$", "useSkipSaveFields", "=", "true", ")", "{", "$", "coreTable", "=", "$", "this", "->", "getCoreTableName", "(", ")", ";", "$", "skipMultilingual", "=", "false", ";", "$", "skipC...
return update fields SQL part @param string $table table name to be updated @param bool $useSkipSaveFields use skip save fields array? @return string
[ "return", "update", "fields", "SQL", "part" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L352-L408
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel._getLanguageSetTables
protected function _getLanguageSetTables($coreTableName = null) { $coreTableName = $coreTableName ? $coreTableName : $this->getCoreTableName(); return oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class)->getAllMultiTables($coreTableName); }
php
protected function _getLanguageSetTables($coreTableName = null) { $coreTableName = $coreTableName ? $coreTableName : $this->getCoreTableName(); return oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class)->getAllMultiTables($coreTableName); }
[ "protected", "function", "_getLanguageSetTables", "(", "$", "coreTableName", "=", "null", ")", "{", "$", "coreTableName", "=", "$", "coreTableName", "?", "$", "coreTableName", ":", "$", "this", "->", "getCoreTableName", "(", ")", ";", "return", "oxNew", "(", ...
Return all DB tables for the language sets @param string $coreTableName core table name [optional] @return array
[ "Return", "all", "DB", "tables", "for", "the", "language", "sets" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L475-L480
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel._insert
protected function _insert() { $result = parent::_insert(); if ($result) { //also insert to multilang tables if it is separate foreach ($this->_getLanguageSetTables() as $table) { $sql = "insert into $table set " . $this->_getUpdateFieldsForTable($table, $this->getUseSkipSaveFields()); $result = $result && (bool) $this->executeDatabaseQuery($sql); } } return $result; }
php
protected function _insert() { $result = parent::_insert(); if ($result) { //also insert to multilang tables if it is separate foreach ($this->_getLanguageSetTables() as $table) { $sql = "insert into $table set " . $this->_getUpdateFieldsForTable($table, $this->getUseSkipSaveFields()); $result = $result && (bool) $this->executeDatabaseQuery($sql); } } return $result; }
[ "protected", "function", "_insert", "(", ")", "{", "$", "result", "=", "parent", "::", "_insert", "(", ")", ";", "if", "(", "$", "result", ")", "{", "//also insert to multilang tables if it is separate", "foreach", "(", "$", "this", "->", "_getLanguageSetTables"...
Insert this Object into the database, this function only works on the main table, it will not save any dependend tables, which might be loaded through oxlist. @return bool
[ "Insert", "this", "Object", "into", "the", "database", "this", "function", "only", "works", "on", "the", "main", "table", "it", "will", "not", "save", "any", "dependend", "tables", "which", "might", "be", "loaded", "through", "oxlist", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L489-L503
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel._getObjectViewName
protected function _getObjectViewName($table, $shopID = null) { if (!$this->_blEmployMultilanguage) { return parent::_getObjectViewName($table, $shopID); } return getViewName($table, $this->getLanguage(), $shopID); }
php
protected function _getObjectViewName($table, $shopID = null) { if (!$this->_blEmployMultilanguage) { return parent::_getObjectViewName($table, $shopID); } return getViewName($table, $this->getLanguage(), $shopID); }
[ "protected", "function", "_getObjectViewName", "(", "$", "table", ",", "$", "shopID", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "_blEmployMultilanguage", ")", "{", "return", "parent", "::", "_getObjectViewName", "(", "$", "table", ",", "$",...
Returns actual object view or table name @param string $table Original table name @param int $shopID Shop ID @return string
[ "Returns", "actual", "object", "view", "or", "table", "name" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L513-L520
train
OXID-eSales/oxideshop_ce
source/Core/Model/MultiLanguageModel.php
MultiLanguageModel._addField
protected function _addField($name, $status, $type = null, $length = null) { if ($this->_blEmployMultilanguage && $this->_getFieldLang($name)) { return; } return parent::_addField($name, $status, $type, $length); }
php
protected function _addField($name, $status, $type = null, $length = null) { if ($this->_blEmployMultilanguage && $this->_getFieldLang($name)) { return; } return parent::_addField($name, $status, $type, $length); }
[ "protected", "function", "_addField", "(", "$", "name", ",", "$", "status", ",", "$", "type", "=", "null", ",", "$", "length", "=", "null", ")", "{", "if", "(", "$", "this", "->", "_blEmployMultilanguage", "&&", "$", "this", "->", "_getFieldLang", "(",...
Adds additional field to meta structure. Skips language fields @param string $name Field name @param string $status Field status (0-non multilang field, 1-multilang field) @param string $type Field type @param string $length Field Length @return null;
[ "Adds", "additional", "field", "to", "meta", "structure", ".", "Skips", "language", "fields" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Model/MultiLanguageModel.php#L557-L564
train
OXID-eSales/oxideshop_ce
source/Internal/Application/Service/ProjectYamlImportService.php
ProjectYamlImportService.removeNonExistingImports
public function removeNonExistingImports() { $projectConfig = $this->projectYamlDao->loadProjectConfigFile(); $configChanged = false; foreach ($projectConfig->getImportFileNames() as $fileName) { if (file_exists($fileName)) { continue; } $projectConfig->removeImport($fileName); $configChanged = true; } if ($configChanged) { $this->projectYamlDao->saveProjectConfigFile($projectConfig); } }
php
public function removeNonExistingImports() { $projectConfig = $this->projectYamlDao->loadProjectConfigFile(); $configChanged = false; foreach ($projectConfig->getImportFileNames() as $fileName) { if (file_exists($fileName)) { continue; } $projectConfig->removeImport($fileName); $configChanged = true; } if ($configChanged) { $this->projectYamlDao->saveProjectConfigFile($projectConfig); } }
[ "public", "function", "removeNonExistingImports", "(", ")", "{", "$", "projectConfig", "=", "$", "this", "->", "projectYamlDao", "->", "loadProjectConfigFile", "(", ")", ";", "$", "configChanged", "=", "false", ";", "foreach", "(", "$", "projectConfig", "->", ...
Checks if the import files exist and if not removes them
[ "Checks", "if", "the", "import", "files", "exist", "and", "if", "not", "removes", "them" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Application/Service/ProjectYamlImportService.php#L61-L77
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RecommListController.php
RecommListController.render
public function render() { \OxidEsales\Eshop\Application\Controller\FrontendController::render(); $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $this->_iAllArtCnt = 0; if ($oActiveRecommList = $this->getActiveRecommList()) { if (($oList = $this->getArticleList()) && $oList->count()) { $this->_iAllArtCnt = $oActiveRecommList->getArtCount(); } if ($myConfig->getConfigParam('bl_rssRecommListArts')) { /** @var \OxidEsales\Eshop\Application\Model\RssFeed $oRss */ $oRss = oxNew(\OxidEsales\Eshop\Application\Model\RssFeed::class); $this->addRssFeed( $oRss->getRecommListArticlesTitle($oActiveRecommList), $oRss->getRecommListArticlesUrl($this->_oActiveRecommList), 'recommlistarts' ); } } else { if (($oList = $this->getRecommLists()) && $oList->count()) { $oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class); $this->_iAllArtCnt = $oRecommList->getSearchRecommListCount($this->getRecommSearch()); } } if (!($oList = $this->getArticleList())) { $oList = $this->getRecommLists(); } if ($oList && $oList->count()) { $iNrofCatArticles = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles'); $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10; $this->_iCntPages = ceil($this->_iAllArtCnt / $iNrofCatArticles); } // processing list articles $this->_processListArticles(); return $this->_sThisTemplate; }
php
public function render() { \OxidEsales\Eshop\Application\Controller\FrontendController::render(); $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $this->_iAllArtCnt = 0; if ($oActiveRecommList = $this->getActiveRecommList()) { if (($oList = $this->getArticleList()) && $oList->count()) { $this->_iAllArtCnt = $oActiveRecommList->getArtCount(); } if ($myConfig->getConfigParam('bl_rssRecommListArts')) { /** @var \OxidEsales\Eshop\Application\Model\RssFeed $oRss */ $oRss = oxNew(\OxidEsales\Eshop\Application\Model\RssFeed::class); $this->addRssFeed( $oRss->getRecommListArticlesTitle($oActiveRecommList), $oRss->getRecommListArticlesUrl($this->_oActiveRecommList), 'recommlistarts' ); } } else { if (($oList = $this->getRecommLists()) && $oList->count()) { $oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class); $this->_iAllArtCnt = $oRecommList->getSearchRecommListCount($this->getRecommSearch()); } } if (!($oList = $this->getArticleList())) { $oList = $this->getRecommLists(); } if ($oList && $oList->count()) { $iNrofCatArticles = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles'); $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10; $this->_iCntPages = ceil($this->_iAllArtCnt / $iNrofCatArticles); } // processing list articles $this->_processListArticles(); return $this->_sThisTemplate; }
[ "public", "function", "render", "(", ")", "{", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Controller", "\\", "FrontendController", "::", "render", "(", ")", ";", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\...
Collects current view data, return current template file name @return string
[ "Collects", "current", "view", "data", "return", "current", "template", "file", "name" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RecommListController.php#L106-L147
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RecommListController.php
RecommListController.getAddSeoUrlParams
public function getAddSeoUrlParams() { $sAddParams = parent::getAddSeoUrlParams(); if ($sParam = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("searchrecomm", true)) { $sAddParams .= "&amp;searchrecomm=" . rawurlencode($sParam); } return $sAddParams; }
php
public function getAddSeoUrlParams() { $sAddParams = parent::getAddSeoUrlParams(); if ($sParam = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("searchrecomm", true)) { $sAddParams .= "&amp;searchrecomm=" . rawurlencode($sParam); } return $sAddParams; }
[ "public", "function", "getAddSeoUrlParams", "(", ")", "{", "$", "sAddParams", "=", "parent", "::", "getAddSeoUrlParams", "(", ")", ";", "if", "(", "$", "sParam", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "("...
Returns additional URL parameters which must be added to list products seo urls @return string
[ "Returns", "additional", "URL", "parameters", "which", "must", "be", "added", "to", "list", "products", "seo", "urls" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RecommListController.php#L181-L189
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RecommListController.php
RecommListController.getSimilarRecommLists
public function getSimilarRecommLists() { if ($this->_oOtherRecommList === null) { $this->_oOtherRecommList = false; if (($oActiveRecommList = $this->getActiveRecommList()) && ($oList = $this->getArticleList())) { $oRecommLists = $oActiveRecommList->getRecommListsByIds($oList->arrayKeys()); //do not show the same list unset($oRecommLists[$oActiveRecommList->getId()]); $this->_oOtherRecommList = $oRecommLists; } } return $this->_oOtherRecommList; }
php
public function getSimilarRecommLists() { if ($this->_oOtherRecommList === null) { $this->_oOtherRecommList = false; if (($oActiveRecommList = $this->getActiveRecommList()) && ($oList = $this->getArticleList())) { $oRecommLists = $oActiveRecommList->getRecommListsByIds($oList->arrayKeys()); //do not show the same list unset($oRecommLists[$oActiveRecommList->getId()]); $this->_oOtherRecommList = $oRecommLists; } } return $this->_oOtherRecommList; }
[ "public", "function", "getSimilarRecommLists", "(", ")", "{", "if", "(", "$", "this", "->", "_oOtherRecommList", "===", "null", ")", "{", "$", "this", "->", "_oOtherRecommList", "=", "false", ";", "if", "(", "(", "$", "oActiveRecommList", "=", "$", "this",...
Template variable getter. Returns other recommlists @return object
[ "Template", "variable", "getter", ".", "Returns", "other", "recommlists" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RecommListController.php#L288-L301
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RecommListController.php
RecommListController.getRatingCount
public function getRatingCount() { if ($this->_iRatingCnt === null) { $this->_iRatingCnt = false; if ($this->isReviewActive() && ($oActiveRecommList = $this->getActiveRecommList())) { $this->_iRatingCnt = $oActiveRecommList->oxrecommlists__oxratingcnt->value; } } return $this->_iRatingCnt; }
php
public function getRatingCount() { if ($this->_iRatingCnt === null) { $this->_iRatingCnt = false; if ($this->isReviewActive() && ($oActiveRecommList = $this->getActiveRecommList())) { $this->_iRatingCnt = $oActiveRecommList->oxrecommlists__oxratingcnt->value; } } return $this->_iRatingCnt; }
[ "public", "function", "getRatingCount", "(", ")", "{", "if", "(", "$", "this", "->", "_iRatingCnt", "===", "null", ")", "{", "$", "this", "->", "_iRatingCnt", "=", "false", ";", "if", "(", "$", "this", "->", "isReviewActive", "(", ")", "&&", "(", "$"...
Template variable getter. Returns rating count @return integer
[ "Template", "variable", "getter", ".", "Returns", "rating", "count" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RecommListController.php#L371-L381
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RecommListController.php
RecommListController.getRecommLists
public function getRecommLists() { if ($this->_oSearchRecommLists === null) { $this->_oSearchRecommLists = []; if (!$this->getActiveRecommList()) { // list of found oxrecommlists $oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class); $oList = $oRecommList->getSearchRecommLists($this->getRecommSearch()); if ($oList && $oList->count()) { $this->_oSearchRecommLists = $oList; } } } return $this->_oSearchRecommLists; }
php
public function getRecommLists() { if ($this->_oSearchRecommLists === null) { $this->_oSearchRecommLists = []; if (!$this->getActiveRecommList()) { // list of found oxrecommlists $oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class); $oList = $oRecommList->getSearchRecommLists($this->getRecommSearch()); if ($oList && $oList->count()) { $this->_oSearchRecommLists = $oList; } } } return $this->_oSearchRecommLists; }
[ "public", "function", "getRecommLists", "(", ")", "{", "if", "(", "$", "this", "->", "_oSearchRecommLists", "===", "null", ")", "{", "$", "this", "->", "_oSearchRecommLists", "=", "[", "]", ";", "if", "(", "!", "$", "this", "->", "getActiveRecommList", "...
Template variable getter. Returns searched recommlist @return object
[ "Template", "variable", "getter", ".", "Returns", "searched", "recommlist" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RecommListController.php#L388-L403
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RecommListController.php
RecommListController.getTreePath
public function getTreePath() { $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aPath[0] = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); $aPath[0]->setLink(false); $aPath[0]->oxcategories__oxtitle = new \OxidEsales\Eshop\Core\Field($oLang->translateString('RECOMMLIST')); if ($sSearchParam = $this->getRecommSearch()) { $shopHomeURL = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl(); $sUrl = $shopHomeURL . "cl=recommlist&amp;searchrecomm=" . rawurlencode($sSearchParam); $sTitle = $oLang->translateString('RECOMMLIST_SEARCH') . ' "' . $sSearchParam . '"'; $aPath[1] = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); $aPath[1]->setLink($sUrl); $aPath[1]->oxcategories__oxtitle = new \OxidEsales\Eshop\Core\Field($sTitle); } return $aPath; }
php
public function getTreePath() { $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aPath[0] = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); $aPath[0]->setLink(false); $aPath[0]->oxcategories__oxtitle = new \OxidEsales\Eshop\Core\Field($oLang->translateString('RECOMMLIST')); if ($sSearchParam = $this->getRecommSearch()) { $shopHomeURL = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl(); $sUrl = $shopHomeURL . "cl=recommlist&amp;searchrecomm=" . rawurlencode($sSearchParam); $sTitle = $oLang->translateString('RECOMMLIST_SEARCH') . ' "' . $sSearchParam . '"'; $aPath[1] = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); $aPath[1]->setLink($sUrl); $aPath[1]->oxcategories__oxtitle = new \OxidEsales\Eshop\Core\Field($sTitle); } return $aPath; }
[ "public", "function", "getTreePath", "(", ")", "{", "$", "oLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", ";", "$", "aPath", "[", "0", "]", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop...
Template variable getter. Returns category path array @return array
[ "Template", "variable", "getter", ".", "Returns", "category", "path", "array" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RecommListController.php#L427-L446
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/ImportObject.php
ImportObject.getRightFields
public function getRightFields() { $accessRightFields = []; if (!$this->fieldList) { $this->getFieldList(); } foreach ($this->fieldList as $field) { $accessRightFields[] = strtolower($this->tableName . '__' . $field); } return $accessRightFields; }
php
public function getRightFields() { $accessRightFields = []; if (!$this->fieldList) { $this->getFieldList(); } foreach ($this->fieldList as $field) { $accessRightFields[] = strtolower($this->tableName . '__' . $field); } return $accessRightFields; }
[ "public", "function", "getRightFields", "(", ")", "{", "$", "accessRightFields", "=", "[", "]", ";", "if", "(", "!", "$", "this", "->", "fieldList", ")", "{", "$", "this", "->", "getFieldList", "(", ")", ";", "}", "foreach", "(", "$", "this", "->", ...
Used for the RR implementation, right now not really used. @return array
[ "Used", "for", "the", "RR", "implementation", "right", "now", "not", "really", "used", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/ImportObject.php#L93-L105
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/ImportObject.php
ImportObject.getFieldList
public function getFieldList() { $objectName = $this->getShopObjectName(); if ($objectName) { $shopObject = oxNew($objectName); } else { $shopObject = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $shopObject->init($this->getTableName()); } if ($shopObject instanceof \OxidEsales\Eshop\Core\Model\MultiLanguageModel) { $shopObject->setLanguage(0); $shopObject->setEnableMultilang(false); } $viewName = $shopObject->getViewName(); $fields = str_ireplace('`' . $viewName . "`.", "", strtoupper($shopObject->getSelectFields())); $fields = str_ireplace([" ", "`"], ["", ""], $fields); $this->fieldList = explode(",", $fields); return $this->fieldList; }
php
public function getFieldList() { $objectName = $this->getShopObjectName(); if ($objectName) { $shopObject = oxNew($objectName); } else { $shopObject = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $shopObject->init($this->getTableName()); } if ($shopObject instanceof \OxidEsales\Eshop\Core\Model\MultiLanguageModel) { $shopObject->setLanguage(0); $shopObject->setEnableMultilang(false); } $viewName = $shopObject->getViewName(); $fields = str_ireplace('`' . $viewName . "`.", "", strtoupper($shopObject->getSelectFields())); $fields = str_ireplace([" ", "`"], ["", ""], $fields); $this->fieldList = explode(",", $fields); return $this->fieldList; }
[ "public", "function", "getFieldList", "(", ")", "{", "$", "objectName", "=", "$", "this", "->", "getShopObjectName", "(", ")", ";", "if", "(", "$", "objectName", ")", "{", "$", "shopObject", "=", "oxNew", "(", "$", "objectName", ")", ";", "}", "else", ...
Returns the predefined field list. @return array
[ "Returns", "the", "predefined", "field", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/ImportObject.php#L112-L134
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/ImportObject.php
ImportObject.getTableName
protected function getTableName() { $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); return getViewName($this->tableName, -1, $shopId); }
php
protected function getTableName() { $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); return getViewName($this->tableName, -1, $shopId); }
[ "protected", "function", "getTableName", "(", ")", "{", "$", "shopId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getShopId", "(", ")", ";", "return", "getViewName", "(", "$", "this", "->",...
Returns table or View name. @return string
[ "Returns", "table", "or", "View", "name", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/ImportObject.php#L161-L166
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/ImportObject.php
ImportObject.saveObject
protected function saveObject($data, $allowCustomShopId) { $shopObject = $this->createShopObject(); foreach ($data as $key => $value) { // change case to UPPER $uppercaseKey = strtoupper($key); if (!isset($data[$uppercaseKey])) { unset($data[$key]); $data[$uppercaseKey] = $value; } } if (method_exists($shopObject, 'setForceCoreTableUsage')) { $shopObject->setForceCoreTableUsage(true); } $isLoaded = false; if ($data['OXID']) { $isLoaded = $shopObject->load($data['OXID']); } $data = $this->preAssignObject($shopObject, $data, $allowCustomShopId); if ($isLoaded) { $this->checkWriteAccess($shopObject, $data); } else { $this->checkCreateAccess($data); } $shopObject->assign($data); if ($allowCustomShopId) { $shopObject->setIsDerived(false); } if ($this->preSaveObject($shopObject, $data)) { // store if ($shopObject->save()) { return $this->postSaveObject($shopObject, $data); } } return false; }
php
protected function saveObject($data, $allowCustomShopId) { $shopObject = $this->createShopObject(); foreach ($data as $key => $value) { // change case to UPPER $uppercaseKey = strtoupper($key); if (!isset($data[$uppercaseKey])) { unset($data[$key]); $data[$uppercaseKey] = $value; } } if (method_exists($shopObject, 'setForceCoreTableUsage')) { $shopObject->setForceCoreTableUsage(true); } $isLoaded = false; if ($data['OXID']) { $isLoaded = $shopObject->load($data['OXID']); } $data = $this->preAssignObject($shopObject, $data, $allowCustomShopId); if ($isLoaded) { $this->checkWriteAccess($shopObject, $data); } else { $this->checkCreateAccess($data); } $shopObject->assign($data); if ($allowCustomShopId) { $shopObject->setIsDerived(false); } if ($this->preSaveObject($shopObject, $data)) { // store if ($shopObject->save()) { return $this->postSaveObject($shopObject, $data); } } return false; }
[ "protected", "function", "saveObject", "(", "$", "data", ",", "$", "allowCustomShopId", ")", "{", "$", "shopObject", "=", "$", "this", "->", "createShopObject", "(", ")", ";", "foreach", "(", "$", "data", "as", "$", "key", "=>", "$", "value", ")", "{",...
Saves object data. @param array $data data for saving @param bool $allowCustomShopId allow custom shop id @return string|false
[ "Saves", "object", "data", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/ImportObject.php#L220-L264
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/ImportObject.php
ImportObject.getOxidFromKeyFields
protected function getOxidFromKeyFields($data) { if (!is_array($this->getKeyFields())) { return null; } $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $queryWherePart = []; $allKeysExists = true; foreach ($this->getKeyFields() as $key) { if (array_key_exists($key, $data)) { $queryWherePart[] = $key . '=' . $database->quote($data[$key]); } else { $allKeysExists = false; } } if ($allKeysExists) { $query = 'SELECT OXID FROM ' . $this->getTableName() . ' WHERE ' . implode(' AND ', $queryWherePart); return $database->getOne($query); } return null; }
php
protected function getOxidFromKeyFields($data) { if (!is_array($this->getKeyFields())) { return null; } $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $queryWherePart = []; $allKeysExists = true; foreach ($this->getKeyFields() as $key) { if (array_key_exists($key, $data)) { $queryWherePart[] = $key . '=' . $database->quote($data[$key]); } else { $allKeysExists = false; } } if ($allKeysExists) { $query = 'SELECT OXID FROM ' . $this->getTableName() . ' WHERE ' . implode(' AND ', $queryWherePart); return $database->getOne($query); } return null; }
[ "protected", "function", "getOxidFromKeyFields", "(", "$", "data", ")", "{", "if", "(", "!", "is_array", "(", "$", "this", "->", "getKeyFields", "(", ")", ")", ")", "{", "return", "null", ";", "}", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop...
Returns oxid of this data type from key fields. @param array $data Data for object. @return string
[ "Returns", "oxid", "of", "this", "data", "type", "from", "key", "fields", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/ImportObject.php#L287-L312
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/ImportObject.php
ImportObject.isAllowedToEdit
protected function isAllowedToEdit($shopId) { $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class); $user->loadAdminUser(); if ($user->oxuser__oxrights->value == "malladmin" || $user->oxuser__oxrights->value == (int) $shopId) { return true; } return false; }
php
protected function isAllowedToEdit($shopId) { $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class); $user->loadAdminUser(); if ($user->oxuser__oxrights->value == "malladmin" || $user->oxuser__oxrights->value == (int) $shopId) { return true; } return false; }
[ "protected", "function", "isAllowedToEdit", "(", "$", "shopId", ")", "{", "$", "user", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "User", "::", "class", ")", ";", "$", "user", "->", "loadAdminUser", "(...
Checks if user is allowed to edit in this shop. @param int $shopId shop id @return bool
[ "Checks", "if", "user", "is", "allowed", "to", "edit", "in", "this", "shop", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/ImportObject.php#L321-L331
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/ImportObject.php
ImportObject.createShopObject
protected function createShopObject() { $objectName = $this->getShopObjectName(); if ($objectName) { $shopObject = oxNew($objectName, 'core'); if ($shopObject instanceof \OxidEsales\Eshop\Core\Model\MultiLanguageModel) { $shopObject->setLanguage(0); $shopObject->setEnableMultilang(false); } } else { $shopObject = oxNew('oxBase', 'core'); $shopObject->init($this->getBaseTableName()); } return $shopObject; }
php
protected function createShopObject() { $objectName = $this->getShopObjectName(); if ($objectName) { $shopObject = oxNew($objectName, 'core'); if ($shopObject instanceof \OxidEsales\Eshop\Core\Model\MultiLanguageModel) { $shopObject->setLanguage(0); $shopObject->setEnableMultilang(false); } } else { $shopObject = oxNew('oxBase', 'core'); $shopObject->init($this->getBaseTableName()); } return $shopObject; }
[ "protected", "function", "createShopObject", "(", ")", "{", "$", "objectName", "=", "$", "this", "->", "getShopObjectName", "(", ")", ";", "if", "(", "$", "objectName", ")", "{", "$", "shopObject", "=", "oxNew", "(", "$", "objectName", ",", "'core'", ")"...
Creates shop object. @return \OxidEsales\Eshop\Core\Model\BaseModel
[ "Creates", "shop", "object", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/ImportObject.php#L354-L369
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountController.php
AccountController.confirmTerms
public function confirmTerms() { $termsConfirmation = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("term"); if (!$termsConfirmation && $this->isEnabledPrivateSales()) { $user = $this->getUser(); if ($user && !$user->isTermsAccepted()) { $termsConfirmation = true; } } return $termsConfirmation; }
php
public function confirmTerms() { $termsConfirmation = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("term"); if (!$termsConfirmation && $this->isEnabledPrivateSales()) { $user = $this->getUser(); if ($user && !$user->isTermsAccepted()) { $termsConfirmation = true; } } return $termsConfirmation; }
[ "public", "function", "confirmTerms", "(", ")", "{", "$", "termsConfirmation", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestParameter", "(", "\"term\"", ")", ";", "if", "(", "!", "$",...
Confirms term agreement. Returns value of confirmed term @return string | bool
[ "Confirms", "term", "agreement", ".", "Returns", "value", "of", "confirmed", "term" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountController.php#L153-L164
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountController.php
AccountController.getArticleId
public function getArticleId() { if ($this->_sArticleId === null) { // passing wishlist information if ($articleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid')) { $this->_sArticleId = $articleId; } } return $this->_sArticleId; }
php
public function getArticleId() { if ($this->_sArticleId === null) { // passing wishlist information if ($articleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid')) { $this->_sArticleId = $articleId; } } return $this->_sArticleId; }
[ "public", "function", "getArticleId", "(", ")", "{", "if", "(", "$", "this", "->", "_sArticleId", "===", "null", ")", "{", "// passing wishlist information", "if", "(", "$", "articleId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry",...
Return the active article id @return string | bool
[ "Return", "the", "active", "article", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountController.php#L243-L253
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountController.php
AccountController.getSearchParamForHtml
public function getSearchParamForHtml() { if ($this->_sSearchParamForHtml === null) { $this->_sSearchParamForHtml = false; if ($this->getArticleId()) { $this->_sSearchParamForHtml = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam'); } } return $this->_sSearchParamForHtml; }
php
public function getSearchParamForHtml() { if ($this->_sSearchParamForHtml === null) { $this->_sSearchParamForHtml = false; if ($this->getArticleId()) { $this->_sSearchParamForHtml = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam'); } } return $this->_sSearchParamForHtml; }
[ "public", "function", "getSearchParamForHtml", "(", ")", "{", "if", "(", "$", "this", "->", "_sSearchParamForHtml", "===", "null", ")", "{", "$", "this", "->", "_sSearchParamForHtml", "=", "false", ";", "if", "(", "$", "this", "->", "getArticleId", "(", ")...
Template variable getter. Returns search parameter for Html @return string
[ "Template", "variable", "getter", ".", "Returns", "search", "parameter", "for", "Html" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountController.php#L260-L270
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountController.php
AccountController.getSearchParam
public function getSearchParam() { if ($this->_sSearchParam === null) { $this->_sSearchParam = false; if ($this->getArticleId()) { $this->_sSearchParam = rawurlencode(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam', true)); } } return $this->_sSearchParam; }
php
public function getSearchParam() { if ($this->_sSearchParam === null) { $this->_sSearchParam = false; if ($this->getArticleId()) { $this->_sSearchParam = rawurlencode(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam', true)); } } return $this->_sSearchParam; }
[ "public", "function", "getSearchParam", "(", ")", "{", "if", "(", "$", "this", "->", "_sSearchParam", "===", "null", ")", "{", "$", "this", "->", "_sSearchParam", "=", "false", ";", "if", "(", "$", "this", "->", "getArticleId", "(", ")", ")", "{", "$...
Template variable getter. Returns search parameter @return string
[ "Template", "variable", "getter", ".", "Returns", "search", "parameter" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountController.php#L277-L287
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountController.php
AccountController.getListType
public function getListType() { if ($this->_sListType === null) { $this->_sListType = false; if ($this->getArticleId()) { // searching in vendor #671 $this->_sListType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('listtype'); } } return $this->_sListType; }
php
public function getListType() { if ($this->_sListType === null) { $this->_sListType = false; if ($this->getArticleId()) { // searching in vendor #671 $this->_sListType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('listtype'); } } return $this->_sListType; }
[ "public", "function", "getListType", "(", ")", "{", "if", "(", "$", "this", "->", "_sListType", "===", "null", ")", "{", "$", "this", "->", "_sListType", "=", "false", ";", "if", "(", "$", "this", "->", "getArticleId", "(", ")", ")", "{", "// searchi...
Template variable getter. Returns list type @return string
[ "Template", "variable", "getter", ".", "Returns", "list", "type" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountController.php#L294-L305
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountController.php
AccountController.deleteAccount
public function deleteAccount() { $this->accountDeletionStatus = false; $user = $this->getUser(); /** * Setting derived to false allows mall users to delete their account being in a different shop as the shop * the account was originally created in. */ if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blMallUsers')) { $user->setIsDerived(false); } if ($this->canUserAccountBeDeleted() && $user->delete()) { $this->accountDeletionStatus = true; $user->logout(); $session = $this->getSession(); $session->destroy(); } }
php
public function deleteAccount() { $this->accountDeletionStatus = false; $user = $this->getUser(); /** * Setting derived to false allows mall users to delete their account being in a different shop as the shop * the account was originally created in. */ if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blMallUsers')) { $user->setIsDerived(false); } if ($this->canUserAccountBeDeleted() && $user->delete()) { $this->accountDeletionStatus = true; $user->logout(); $session = $this->getSession(); $session->destroy(); } }
[ "public", "function", "deleteAccount", "(", ")", "{", "$", "this", "->", "accountDeletionStatus", "=", "false", ";", "$", "user", "=", "$", "this", "->", "getUser", "(", ")", ";", "/**\n * Setting derived to false allows mall users to delete their account being ...
Deletes User account.
[ "Deletes", "User", "account", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountController.php#L366-L385
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountController.php
AccountController.isUserAllowedToDeleteOwnAccount
public function isUserAllowedToDeleteOwnAccount() { $allowUsersToDeleteTheirAccount = Registry::getConfig()->getConfigParam('blAllowUsersToDeleteTheirAccount'); $user = $this->getUser(); return $allowUsersToDeleteTheirAccount && $user && !$user->isMallAdmin(); }
php
public function isUserAllowedToDeleteOwnAccount() { $allowUsersToDeleteTheirAccount = Registry::getConfig()->getConfigParam('blAllowUsersToDeleteTheirAccount'); $user = $this->getUser(); return $allowUsersToDeleteTheirAccount && $user && !$user->isMallAdmin(); }
[ "public", "function", "isUserAllowedToDeleteOwnAccount", "(", ")", "{", "$", "allowUsersToDeleteTheirAccount", "=", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'blAllowUsersToDeleteTheirAccount'", ")", ";", "$", "user", "=", "$", "this", "...
Returns true if User is allowed to delete own account. @return bool
[ "Returns", "true", "if", "User", "is", "allowed", "to", "delete", "own", "account", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountController.php#L392-L399
train
OXID-eSales/oxideshop_ce
source/Application/Model/RequiredFieldsValidator.php
RequiredFieldsValidator.validateFields
public function validateFields($oObject) { $aRequiredFields = $this->getRequiredFields(); $oFieldValidator = $this->getFieldValidator(); $aInvalidFields = []; foreach ($aRequiredFields as $sFieldName) { if (!$oFieldValidator->validateFieldValue($oObject->getFieldData($sFieldName))) { $aInvalidFields[] = $sFieldName; } } $this->_setInvalidFields($aInvalidFields); return empty($aInvalidFields); }
php
public function validateFields($oObject) { $aRequiredFields = $this->getRequiredFields(); $oFieldValidator = $this->getFieldValidator(); $aInvalidFields = []; foreach ($aRequiredFields as $sFieldName) { if (!$oFieldValidator->validateFieldValue($oObject->getFieldData($sFieldName))) { $aInvalidFields[] = $sFieldName; } } $this->_setInvalidFields($aInvalidFields); return empty($aInvalidFields); }
[ "public", "function", "validateFields", "(", "$", "oObject", ")", "{", "$", "aRequiredFields", "=", "$", "this", "->", "getRequiredFields", "(", ")", ";", "$", "oFieldValidator", "=", "$", "this", "->", "getFieldValidator", "(", ")", ";", "$", "aInvalidField...
Checks if all required fields are filled. Returns array of invalid fields or empty array if all fields are fine. @param \OxidEsales\Eshop\Core\Model\BaseModel $oObject Address fields with values. @return bool If any invalid field exist.
[ "Checks", "if", "all", "required", "fields", "are", "filled", ".", "Returns", "array", "of", "invalid", "fields", "or", "empty", "array", "if", "all", "fields", "are", "fine", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RequiredFieldsValidator.php#L107-L121
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/AttributeCategoryAjax.php
AttributeCategoryAjax.removeCatFromAttr
public function removeCatFromAttr() { $aChosenCat = $this->_getActionIds('oxcategory2attribute.oxid'); if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $sQ = $this->_addFilter("delete oxcategory2attribute.* " . $this->_getQuery()); \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ); } elseif (is_array($aChosenCat)) { $sChosenCategories = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aChosenCat)); $sQ = "delete from oxcategory2attribute where oxcategory2attribute.oxid in (" . $sChosenCategories . ") "; \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ); } $this->resetContentCache(); }
php
public function removeCatFromAttr() { $aChosenCat = $this->_getActionIds('oxcategory2attribute.oxid'); if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $sQ = $this->_addFilter("delete oxcategory2attribute.* " . $this->_getQuery()); \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ); } elseif (is_array($aChosenCat)) { $sChosenCategories = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aChosenCat)); $sQ = "delete from oxcategory2attribute where oxcategory2attribute.oxid in (" . $sChosenCategories . ") "; \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ); } $this->resetContentCache(); }
[ "public", "function", "removeCatFromAttr", "(", ")", "{", "$", "aChosenCat", "=", "$", "this", "->", "_getActionIds", "(", "'oxcategory2attribute.oxid'", ")", ";", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig",...
Removes category from Attributes list
[ "Removes", "category", "from", "Attributes", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/AttributeCategoryAjax.php#L85-L99
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/AttributeCategoryAjax.php
AttributeCategoryAjax.addCatToAttr
public function addCatToAttr() { $aAddCategory = $this->_getActionIds('oxcategories.oxid'); $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid'); $oAttribute = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $sCatTable = $this->_getViewName('oxcategories'); $aAddCategory = $this->_getAll($this->_addFilter("select $sCatTable.oxid " . $this->_getQuery())); } if ($oAttribute->load($soxId) && is_array($aAddCategory)) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); foreach ($aAddCategory as $sAdd) { $oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $oNewGroup->init("oxcategory2attribute"); $sOxSortField = 'oxcategory2attribute__oxsort'; $sObjectIdField = 'oxcategory2attribute__oxobjectid'; $sAttributeIdField = 'oxcategory2attribute__oxattrid'; $sOxIdField = 'oxattribute__oxid'; $oNewGroup->$sObjectIdField = new \OxidEsales\Eshop\Core\Field($sAdd); $oNewGroup->$sAttributeIdField = new \OxidEsales\Eshop\Core\Field($oAttribute->$sOxIdField->value); $sSql = "select max(oxsort) + 1 from oxcategory2attribute where oxobjectid = '$sAdd' "; $oNewGroup->$sOxSortField = new \OxidEsales\Eshop\Core\Field(( int ) $database->getOne($sSql)); $oNewGroup->save(); } } $this->resetContentCache(); }
php
public function addCatToAttr() { $aAddCategory = $this->_getActionIds('oxcategories.oxid'); $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid'); $oAttribute = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $sCatTable = $this->_getViewName('oxcategories'); $aAddCategory = $this->_getAll($this->_addFilter("select $sCatTable.oxid " . $this->_getQuery())); } if ($oAttribute->load($soxId) && is_array($aAddCategory)) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); foreach ($aAddCategory as $sAdd) { $oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $oNewGroup->init("oxcategory2attribute"); $sOxSortField = 'oxcategory2attribute__oxsort'; $sObjectIdField = 'oxcategory2attribute__oxobjectid'; $sAttributeIdField = 'oxcategory2attribute__oxattrid'; $sOxIdField = 'oxattribute__oxid'; $oNewGroup->$sObjectIdField = new \OxidEsales\Eshop\Core\Field($sAdd); $oNewGroup->$sAttributeIdField = new \OxidEsales\Eshop\Core\Field($oAttribute->$sOxIdField->value); $sSql = "select max(oxsort) + 1 from oxcategory2attribute where oxobjectid = '$sAdd' "; $oNewGroup->$sOxSortField = new \OxidEsales\Eshop\Core\Field(( int ) $database->getOne($sSql)); $oNewGroup->save(); } } $this->resetContentCache(); }
[ "public", "function", "addCatToAttr", "(", ")", "{", "$", "aAddCategory", "=", "$", "this", "->", "_getActionIds", "(", "'oxcategories.oxid'", ")", ";", "$", "soxId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", ...
Adds category to Attributes list @throws Exception
[ "Adds", "category", "to", "Attributes", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/AttributeCategoryAjax.php#L106-L139
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ActionsMain.php
ActionsMain.getActionFormData
private function getActionFormData() { $request = oxNew(Request::class); $formData = $request->getRequestEscapedParameter("editval"); $formData = $this->normalizeActionFormData($formData); return $formData; }
php
private function getActionFormData() { $request = oxNew(Request::class); $formData = $request->getRequestEscapedParameter("editval"); $formData = $this->normalizeActionFormData($formData); return $formData; }
[ "private", "function", "getActionFormData", "(", ")", "{", "$", "request", "=", "oxNew", "(", "Request", "::", "class", ")", ";", "$", "formData", "=", "$", "request", "->", "getRequestEscapedParameter", "(", "\"editval\"", ")", ";", "$", "formData", "=", ...
Returns form data for Action. @return array
[ "Returns", "form", "data", "for", "Action", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ActionsMain.php#L163-L170
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ActionsMain.php
ActionsMain.normalizeActionFormData
private function normalizeActionFormData($formData) { if ($this->isNewEditObject() === true) { $formData['oxactions__oxid'] = null; } if (!$formData['oxactions__oxactive']) { $formData['oxactions__oxactive'] = 0; } return $formData; }
php
private function normalizeActionFormData($formData) { if ($this->isNewEditObject() === true) { $formData['oxactions__oxid'] = null; } if (!$formData['oxactions__oxactive']) { $formData['oxactions__oxactive'] = 0; } return $formData; }
[ "private", "function", "normalizeActionFormData", "(", "$", "formData", ")", "{", "if", "(", "$", "this", "->", "isNewEditObject", "(", ")", "===", "true", ")", "{", "$", "formData", "[", "'oxactions__oxid'", "]", "=", "null", ";", "}", "if", "(", "!", ...
Normalizes form data for Action. @param array $formData @return array
[ "Normalizes", "form", "data", "for", "Action", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ActionsMain.php#L179-L190
train
OXID-eSales/oxideshop_ce
source/Application/Model/Review.php
Review.load
public function load($oxId) { if ($blRet = parent::load($oxId)) { // convert date's to international format $this->oxreviews__oxcreate->setValue(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxreviews__oxcreate->value)); } return $blRet; }
php
public function load($oxId) { if ($blRet = parent::load($oxId)) { // convert date's to international format $this->oxreviews__oxcreate->setValue(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxreviews__oxcreate->value)); } return $blRet; }
[ "public", "function", "load", "(", "$", "oxId", ")", "{", "if", "(", "$", "blRet", "=", "parent", "::", "load", "(", "$", "oxId", ")", ")", "{", "// convert date's to international format", "$", "this", "->", "oxreviews__oxcreate", "->", "setValue", "(", "...
Loads object review information. Returns true on success. @param string $oxId ID of object to load @return bool
[ "Loads", "object", "review", "information", ".", "Returns", "true", "on", "success", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Review.php#L68-L76
train
OXID-eSales/oxideshop_ce
source/Application/Model/Review.php
Review.loadList
public function loadList($sType, $aIds, $blLoadEmpty = false, $iLoadInLang = null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $oRevs = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); $oRevs->init('oxreview'); if (is_array($aIds) && count($aIds)) { $sObjectIdWhere = "oxreviews.oxobjectid in ( " . implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aIds)) . " )"; } elseif (is_string($aIds) && $aIds) { $sObjectIdWhere = "oxreviews.oxobjectid = " . $oDb->quote($aIds); } else { return $oRevs; } $iLoadInLang = is_null($iLoadInLang) ? (int) \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage() : (int) $iLoadInLang; $sSelect = "select oxreviews.* from oxreviews where oxreviews.oxtype = " . $oDb->quote($sType) . " and $sObjectIdWhere and oxreviews.oxlang = '$iLoadInLang'"; if (!$blLoadEmpty) { $sSelect .= ' and oxreviews.oxtext != "" '; } if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blGBModerate')) { $sSelect .= ' and ( oxreviews.oxactive = "1" '; $sSelect .= ($oUser = $this->getUser()) ? 'or oxreviews.oxuserid = ' . $oDb->quote($oUser->getId()) . ' )' : ')'; } $sSelect .= ' order by oxreviews.oxcreate desc '; $oRevs->selectString($sSelect); // change date foreach ($oRevs as $oItem) { $oItem->oxreviews__oxcreate->convertToFormattedDbDate(); $oItem->oxreviews__oxtext->convertToPseudoHtml(); } return $oRevs; }
php
public function loadList($sType, $aIds, $blLoadEmpty = false, $iLoadInLang = null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $oRevs = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); $oRevs->init('oxreview'); if (is_array($aIds) && count($aIds)) { $sObjectIdWhere = "oxreviews.oxobjectid in ( " . implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aIds)) . " )"; } elseif (is_string($aIds) && $aIds) { $sObjectIdWhere = "oxreviews.oxobjectid = " . $oDb->quote($aIds); } else { return $oRevs; } $iLoadInLang = is_null($iLoadInLang) ? (int) \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage() : (int) $iLoadInLang; $sSelect = "select oxreviews.* from oxreviews where oxreviews.oxtype = " . $oDb->quote($sType) . " and $sObjectIdWhere and oxreviews.oxlang = '$iLoadInLang'"; if (!$blLoadEmpty) { $sSelect .= ' and oxreviews.oxtext != "" '; } if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blGBModerate')) { $sSelect .= ' and ( oxreviews.oxactive = "1" '; $sSelect .= ($oUser = $this->getUser()) ? 'or oxreviews.oxuserid = ' . $oDb->quote($oUser->getId()) . ' )' : ')'; } $sSelect .= ' order by oxreviews.oxcreate desc '; $oRevs->selectString($sSelect); // change date foreach ($oRevs as $oItem) { $oItem->oxreviews__oxcreate->convertToFormattedDbDate(); $oItem->oxreviews__oxtext->convertToPseudoHtml(); } return $oRevs; }
[ "public", "function", "loadList", "(", "$", "sType", ",", "$", "aIds", ",", "$", "blLoadEmpty", "=", "false", ",", "$", "iLoadInLang", "=", "null", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", ":...
get oxList of reviews for given object ids and type @param string $sType type of given ids @param mixed $aIds given object ids to load, can be array or just one id, given as string @param boolean $blLoadEmpty true if want to load empty text reviews @param int $iLoadInLang language to select for loading @return oxList
[ "get", "oxList", "of", "reviews", "for", "given", "object", "ids", "and", "type" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Review.php#L101-L140
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.getArticles
public function getArticles($iStart = null, $iNrofArticles = null, $blReload = false) { // cached ? if ($this->_oArticles !== null && !$blReload) { return $this->_oArticles; } $this->_oArticles = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); if ($iStart !== null && $iNrofArticles !== null) { $this->_oArticles->setSqlLimit($iStart, $iNrofArticles); } // loading basket items $this->_oArticles->loadRecommArticles($this->getId(), $this->_sArticlesFilter); return $this->_oArticles; }
php
public function getArticles($iStart = null, $iNrofArticles = null, $blReload = false) { // cached ? if ($this->_oArticles !== null && !$blReload) { return $this->_oArticles; } $this->_oArticles = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); if ($iStart !== null && $iNrofArticles !== null) { $this->_oArticles->setSqlLimit($iStart, $iNrofArticles); } // loading basket items $this->_oArticles->loadRecommArticles($this->getId(), $this->_sArticlesFilter); return $this->_oArticles; }
[ "public", "function", "getArticles", "(", "$", "iStart", "=", "null", ",", "$", "iNrofArticles", "=", "null", ",", "$", "blReload", "=", "false", ")", "{", "// cached ?", "if", "(", "$", "this", "->", "_oArticles", "!==", "null", "&&", "!", "$", "blRel...
Returns list of recommendation list items @param integer $iStart start for sql limit @param integer $iNrofArticles nr of items per page @param bool $blReload if TRUE forces to reload list @return \OxidEsales\Eshop\Core\Model\ListModel
[ "Returns", "list", "of", "recommendation", "list", "items" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L69-L86
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.getArtCount
public function getArtCount() { $iCnt = 0; $sSelect = $this->_getArticleSelect(); if ($sSelect) { $iCnt = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSelect); } return $iCnt; }
php
public function getArtCount() { $iCnt = 0; $sSelect = $this->_getArticleSelect(); if ($sSelect) { $iCnt = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSelect); } return $iCnt; }
[ "public", "function", "getArtCount", "(", ")", "{", "$", "iCnt", "=", "0", ";", "$", "sSelect", "=", "$", "this", "->", "_getArticleSelect", "(", ")", ";", "if", "(", "$", "sSelect", ")", "{", "$", "iCnt", "=", "\\", "OxidEsales", "\\", "Eshop", "\...
Returns count of recommendation list items @return integer
[ "Returns", "count", "of", "recommendation", "list", "items" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L93-L102
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.getFirstArticle
public function getFirstArticle() { $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->setSqlLimit(0, 1); $oArtList->loadRecommArticles($this->getId(), $this->_sArticlesFilter); $oArtList->rewind(); return $oArtList->current(); }
php
public function getFirstArticle() { $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->setSqlLimit(0, 1); $oArtList->loadRecommArticles($this->getId(), $this->_sArticlesFilter); $oArtList->rewind(); return $oArtList->current(); }
[ "public", "function", "getFirstArticle", "(", ")", "{", "$", "oArtList", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "ArticleList", "::", "class", ")", ";", "$", "oArtList", "->", "setSqlLimit", "(", "0",...
returns first article from this list's article list @return oxArticle
[ "returns", "first", "article", "from", "this", "list", "s", "article", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L124-L132
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.getArtDescription
public function getArtDescription($sOXID) { if (!$sOXID) { return false; } $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sSelect = 'select oxdesc from oxobject2list where oxlistid = ' . $oDb->quote($this->getId()) . ' and oxobjectid = ' . $oDb->quote($sOXID); return $oDb->getOne($sSelect); }
php
public function getArtDescription($sOXID) { if (!$sOXID) { return false; } $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sSelect = 'select oxdesc from oxobject2list where oxlistid = ' . $oDb->quote($this->getId()) . ' and oxobjectid = ' . $oDb->quote($sOXID); return $oDb->getOne($sSelect); }
[ "public", "function", "getArtDescription", "(", "$", "sOXID", ")", "{", "if", "(", "!", "$", "sOXID", ")", "{", "return", "false", ";", "}", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(",...
Returns article description for recommendation list @param string $sOXID Object ID @return string
[ "Returns", "article", "description", "for", "recommendation", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L167-L177
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.removeArticle
public function removeArticle($sOXID) { if ($sOXID) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "delete from oxobject2list where oxobjectid = " . $oDb->quote($sOXID) . " and oxlistid=" . $oDb->quote($this->getId()); return $oDb->execute($sQ); } }
php
public function removeArticle($sOXID) { if ($sOXID) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "delete from oxobject2list where oxobjectid = " . $oDb->quote($sOXID) . " and oxlistid=" . $oDb->quote($this->getId()); return $oDb->execute($sQ); } }
[ "public", "function", "removeArticle", "(", "$", "sOXID", ")", "{", "if", "(", "$", "sOXID", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "sQ", "=", "\"delete...
Remove article from recommendation list @param string $sOXID Object ID @return bool
[ "Remove", "article", "from", "recommendation", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L186-L194
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.addArticle
public function addArticle($sOXID, $sDesc) { $blAdd = false; if ($sOXID) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); if (!$database->getOne("select oxid from oxobject2list where oxobjectid=" . $database->quote($sOXID) . " and oxlistid=" . $database->quote($this->getId()))) { $sUid = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID(); $sQ = "insert into oxobject2list ( oxid, oxobjectid, oxlistid, oxdesc ) values ( '$sUid', " . $database->quote($sOXID) . ", " . $database->quote($this->getId()) . ", " . $database->quote($sDesc) . " )"; $blAdd = $database->execute($sQ); } } return $blAdd; }
php
public function addArticle($sOXID, $sDesc) { $blAdd = false; if ($sOXID) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); if (!$database->getOne("select oxid from oxobject2list where oxobjectid=" . $database->quote($sOXID) . " and oxlistid=" . $database->quote($this->getId()))) { $sUid = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID(); $sQ = "insert into oxobject2list ( oxid, oxobjectid, oxlistid, oxdesc ) values ( '$sUid', " . $database->quote($sOXID) . ", " . $database->quote($this->getId()) . ", " . $database->quote($sDesc) . " )"; $blAdd = $database->execute($sQ); } } return $blAdd; }
[ "public", "function", "addArticle", "(", "$", "sOXID", ",", "$", "sDesc", ")", "{", "$", "blAdd", "=", "false", ";", "if", "(", "$", "sOXID", ")", "{", "// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV...
Add article to recommendation list @param string $sOXID Object ID @param string $sDesc recommended article description @throws Exception @return bool
[ "Add", "article", "to", "recommendation", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L206-L221
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.getSearchRecommLists
public function getSearchRecommLists($sSearchStr) { if ($sSearchStr) { // sets active page $iActPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr'); $iActPage = ($iActPage < 0) ? 0 : $iActPage; // load only lists which we show on screen $iNrofCatArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles'); $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10; $oRecommList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); $oRecommList->init('oxrecommlist'); $sSelect = $this->_getSearchSelect($sSearchStr); $oRecommList->setSqlLimit($iNrofCatArticles * $iActPage, $iNrofCatArticles); $oRecommList->selectString($sSelect); return $oRecommList; } }
php
public function getSearchRecommLists($sSearchStr) { if ($sSearchStr) { // sets active page $iActPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr'); $iActPage = ($iActPage < 0) ? 0 : $iActPage; // load only lists which we show on screen $iNrofCatArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles'); $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10; $oRecommList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); $oRecommList->init('oxrecommlist'); $sSelect = $this->_getSearchSelect($sSearchStr); $oRecommList->setSqlLimit($iNrofCatArticles * $iActPage, $iNrofCatArticles); $oRecommList->selectString($sSelect); return $oRecommList; } }
[ "public", "function", "getSearchRecommLists", "(", "$", "sSearchStr", ")", "{", "if", "(", "$", "sSearchStr", ")", "{", "// sets active page", "$", "iActPage", "=", "(", "int", ")", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "...
Returns user recommendation list objects @param string $sSearchStr Search string @return object oxlist with oxrecommlist objects
[ "Returns", "user", "recommendation", "list", "objects" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L321-L340
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.getSearchRecommListCount
public function getSearchRecommListCount($sSearchStr) { $iCnt = 0; $sSelect = $this->_getSearchSelect($sSearchStr); if ($sSelect) { $sPartial = substr($sSelect, strpos($sSelect, ' from ')); $sSelect = "select count( distinct rl.oxid ) $sPartial "; $iCnt = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSelect); } return $iCnt; }
php
public function getSearchRecommListCount($sSearchStr) { $iCnt = 0; $sSelect = $this->_getSearchSelect($sSearchStr); if ($sSelect) { $sPartial = substr($sSelect, strpos($sSelect, ' from ')); $sSelect = "select count( distinct rl.oxid ) $sPartial "; $iCnt = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSelect); } return $iCnt; }
[ "public", "function", "getSearchRecommListCount", "(", "$", "sSearchStr", ")", "{", "$", "iCnt", "=", "0", ";", "$", "sSelect", "=", "$", "this", "->", "_getSearchSelect", "(", "$", "sSearchStr", ")", ";", "if", "(", "$", "sSelect", ")", "{", "$", "sPa...
Returns the amount of lists according to search parameters. @param string $sSearchStr Search string @return int
[ "Returns", "the", "amount", "of", "lists", "according", "to", "search", "parameters", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L349-L360
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList._getSearchSelect
protected function _getSearchSelect($sSearchStr) { $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $sSearchStrQuoted = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote("%$sSearchStr%"); $sSelect = "select distinct rl.* from oxrecommlists as rl"; $sSelect .= " inner join oxobject2list as o2l on o2l.oxlistid = rl.oxid"; $sSelect .= " where ( rl.oxtitle like $sSearchStrQuoted or rl.oxdesc like $sSearchStrQuoted"; $sSelect .= " or o2l.oxdesc like $sSearchStrQuoted ) and rl.oxshopid = '$iShopId'"; return $sSelect; }
php
protected function _getSearchSelect($sSearchStr) { $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $sSearchStrQuoted = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote("%$sSearchStr%"); $sSelect = "select distinct rl.* from oxrecommlists as rl"; $sSelect .= " inner join oxobject2list as o2l on o2l.oxlistid = rl.oxid"; $sSelect .= " where ( rl.oxtitle like $sSearchStrQuoted or rl.oxdesc like $sSearchStrQuoted"; $sSelect .= " or o2l.oxdesc like $sSearchStrQuoted ) and rl.oxshopid = '$iShopId'"; return $sSelect; }
[ "protected", "function", "_getSearchSelect", "(", "$", "sSearchStr", ")", "{", "$", "iShopId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getShopId", "(", ")", ";", "$", "sSearchStrQuoted", "...
Returns the appropriate SQL select according to search parameters @param string $sSearchStr Search string @return string
[ "Returns", "the", "appropriate", "SQL", "select", "according", "to", "search", "parameters" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L369-L380
train
OXID-eSales/oxideshop_ce
source/Application/Model/RecommendationList.php
RecommendationList.getLink
public function getLink($iLang = null) { if ($iLang === null) { $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } if (!\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) { return $this->getStdLink($iLang); } if (!isset($this->_aSeoUrls[$iLang])) { $this->_aSeoUrls[$iLang] = $this->getBaseSeoLink($iLang); } return $this->_aSeoUrls[$iLang]; }
php
public function getLink($iLang = null) { if ($iLang === null) { $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } if (!\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) { return $this->getStdLink($iLang); } if (!isset($this->_aSeoUrls[$iLang])) { $this->_aSeoUrls[$iLang] = $this->getBaseSeoLink($iLang); } return $this->_aSeoUrls[$iLang]; }
[ "public", "function", "getLink", "(", "$", "iLang", "=", "null", ")", "{", "if", "(", "$", "iLang", "===", "null", ")", "{", "$", "iLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", "->", "get...
return url to this recomm list page @param int $iLang language id [optional] @return string
[ "return", "url", "to", "this", "recomm", "list", "page" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RecommendationList.php#L438-L453
train
OXID-eSales/oxideshop_ce
source/Setup/View.php
View.setTemplateFileName
public function setTemplateFileName($templateFileName) { if (!file_exists($this->getPathToTemplateFileName($templateFileName))) { throw new TemplateNotFoundException($templateFileName); } $this->templateFileName = $templateFileName; }
php
public function setTemplateFileName($templateFileName) { if (!file_exists($this->getPathToTemplateFileName($templateFileName))) { throw new TemplateNotFoundException($templateFileName); } $this->templateFileName = $templateFileName; }
[ "public", "function", "setTemplateFileName", "(", "$", "templateFileName", ")", "{", "if", "(", "!", "file_exists", "(", "$", "this", "->", "getPathToTemplateFileName", "(", "$", "templateFileName", ")", ")", ")", "{", "throw", "new", "TemplateNotFoundException", ...
Defines name of template to be used in display method. @param string $templateFileName @throws TemplateNotFoundException
[ "Defines", "name", "of", "template", "to", "be", "used", "in", "display", "method", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/View.php#L47-L54
train
OXID-eSales/oxideshop_ce
source/Setup/View.php
View.setMessage
public function setMessage($sMessage, $blOverride = false) { if ($blOverride) { $this->_aMessages = []; } $this->_aMessages[] = $sMessage; }
php
public function setMessage($sMessage, $blOverride = false) { if ($blOverride) { $this->_aMessages = []; } $this->_aMessages[] = $sMessage; }
[ "public", "function", "setMessage", "(", "$", "sMessage", ",", "$", "blOverride", "=", "false", ")", "{", "if", "(", "$", "blOverride", ")", "{", "$", "this", "->", "_aMessages", "=", "[", "]", ";", "}", "$", "this", "->", "_aMessages", "[", "]", "...
Sets message to view @param string $sMessage message to write to view @param bool $blOverride if TRUE cleanups previously defined messages [optional]
[ "Sets", "message", "to", "view" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/View.php#L121-L128
train
OXID-eSales/oxideshop_ce
source/Setup/View.php
View.getSid
public function getSid($blPrint = true) { $sSid = $this->getInstance("Session")->getSid(); return $blPrint ? print($sSid) : $sSid; }
php
public function getSid($blPrint = true) { $sSid = $this->getInstance("Session")->getSid(); return $blPrint ? print($sSid) : $sSid; }
[ "public", "function", "getSid", "(", "$", "blPrint", "=", "true", ")", "{", "$", "sSid", "=", "$", "this", "->", "getInstance", "(", "\"Session\"", ")", "->", "getSid", "(", ")", ";", "return", "$", "blPrint", "?", "print", "(", "$", "sSid", ")", "...
Prints session id @param bool $blPrint if true - prints requested value [optional] @return null
[ "Prints", "session", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/View.php#L152-L157
train
OXID-eSales/oxideshop_ce
source/Setup/View.php
View.getViewParam
public function getViewParam($sName) { $sValue = null; if (isset($this->_aViewParams[$sName])) { $sValue = $this->_aViewParams[$sName]; } return $sValue; }
php
public function getViewParam($sName) { $sValue = null; if (isset($this->_aViewParams[$sName])) { $sValue = $this->_aViewParams[$sName]; } return $sValue; }
[ "public", "function", "getViewParam", "(", "$", "sName", ")", "{", "$", "sValue", "=", "null", ";", "if", "(", "isset", "(", "$", "this", "->", "_aViewParams", "[", "$", "sName", "]", ")", ")", "{", "$", "sValue", "=", "$", "this", "->", "_aViewPar...
Returns view parameter value @param string $sName view parameter name @return mixed
[ "Returns", "view", "parameter", "value" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/View.php#L177-L185
train
OXID-eSales/oxideshop_ce
source/Setup/View.php
View.getSetupStep
public function getSetupStep($sStepId, $blPrint = true) { $sStep = $this->getInstance("Setup")->getStep($sStepId); return $blPrint ? print($sStep) : $sStep; }
php
public function getSetupStep($sStepId, $blPrint = true) { $sStep = $this->getInstance("Setup")->getStep($sStepId); return $blPrint ? print($sStep) : $sStep; }
[ "public", "function", "getSetupStep", "(", "$", "sStepId", ",", "$", "blPrint", "=", "true", ")", "{", "$", "sStep", "=", "$", "this", "->", "getInstance", "(", "\"Setup\"", ")", "->", "getStep", "(", "$", "sStepId", ")", ";", "return", "$", "blPrint",...
Returns passed setup step number @param string $sStepId setup step id @param bool $blPrint if true - prints requested value [optional] @return int
[ "Returns", "passed", "setup", "step", "number" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/View.php#L195-L200
train
OXID-eSales/oxideshop_ce
source/Setup/View.php
View.isDeletedSetup
public function isDeletedSetup($aSetupConfig, $aDemoConfig) { /** @var Utilities $oUtils */ $oUtils = $this->getInstance("Utilities"); $sPath = getShopBasePath(); if (!isset($aDemoConfig['dbiDemoData']) || $aDemoConfig['dbiDemoData'] != '1') { // "/generated" cleanup $oUtils->removeDir($sPath . "out/pictures/generated", true); // "/master" cleanup, leaving nopic $oUtils->removeDir($sPath . "out/pictures/master", true, 1, ["nopic.jpg"]); } if (isset($aSetupConfig['blDelSetupDir']) && $aSetupConfig['blDelSetupDir']) { // removing setup files $blDeleted = $oUtils->removeDir($sPath . EditionPathProvider::SETUP_DIRECTORY, true); } else { $blDeleted = false; } return $blDeleted; }
php
public function isDeletedSetup($aSetupConfig, $aDemoConfig) { /** @var Utilities $oUtils */ $oUtils = $this->getInstance("Utilities"); $sPath = getShopBasePath(); if (!isset($aDemoConfig['dbiDemoData']) || $aDemoConfig['dbiDemoData'] != '1') { // "/generated" cleanup $oUtils->removeDir($sPath . "out/pictures/generated", true); // "/master" cleanup, leaving nopic $oUtils->removeDir($sPath . "out/pictures/master", true, 1, ["nopic.jpg"]); } if (isset($aSetupConfig['blDelSetupDir']) && $aSetupConfig['blDelSetupDir']) { // removing setup files $blDeleted = $oUtils->removeDir($sPath . EditionPathProvider::SETUP_DIRECTORY, true); } else { $blDeleted = false; } return $blDeleted; }
[ "public", "function", "isDeletedSetup", "(", "$", "aSetupConfig", ",", "$", "aDemoConfig", ")", "{", "/** @var Utilities $oUtils */", "$", "oUtils", "=", "$", "this", "->", "getInstance", "(", "\"Utilities\"", ")", ";", "$", "sPath", "=", "getShopBasePath", "(",...
If demo data installation is OFF, tries to delete demo pictures also checks if setup deletion is ON and deletes setup files if possible, return deletion status @param array $aSetupConfig if to delete setup directory. @param array $aDemoConfig database and demo data configuration. @return bool
[ "If", "demo", "data", "installation", "is", "OFF", "tries", "to", "delete", "demo", "pictures", "also", "checks", "if", "setup", "deletion", "is", "ON", "and", "deletes", "setup", "files", "if", "possible", "return", "deletion", "status" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/View.php#L242-L264
train
OXID-eSales/oxideshop_ce
source/Application/Model/UserList.php
UserList.loadWishlistUsers
public function loadWishlistUsers($sSearchStr) { $sSearchStr = trim($sSearchStr); if (!$sSearchStr) { return; } $quotedSearchStr = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote("%$sSearchStr%"); $sSelect = "select oxuser.oxid, oxuser.oxfname, oxuser.oxlname from oxuser "; $sSelect .= "left join oxuserbaskets on oxuserbaskets.oxuserid = oxuser.oxid "; $sSelect .= "where oxuserbaskets.oxid is not null and oxuserbaskets.oxtitle = 'wishlist' "; $sSelect .= "and oxuserbaskets.oxpublic = 1 "; $sSelect .= "and ( oxuser.oxusername like $quotedSearchStr or oxuser.oxlname like $quotedSearchStr)"; $sSelect .= "and ( select 1 from oxuserbasketitems where oxuserbasketitems.oxbasketid = oxuserbaskets.oxid limit 1)"; $this->selectString($sSelect); }
php
public function loadWishlistUsers($sSearchStr) { $sSearchStr = trim($sSearchStr); if (!$sSearchStr) { return; } $quotedSearchStr = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote("%$sSearchStr%"); $sSelect = "select oxuser.oxid, oxuser.oxfname, oxuser.oxlname from oxuser "; $sSelect .= "left join oxuserbaskets on oxuserbaskets.oxuserid = oxuser.oxid "; $sSelect .= "where oxuserbaskets.oxid is not null and oxuserbaskets.oxtitle = 'wishlist' "; $sSelect .= "and oxuserbaskets.oxpublic = 1 "; $sSelect .= "and ( oxuser.oxusername like $quotedSearchStr or oxuser.oxlname like $quotedSearchStr)"; $sSelect .= "and ( select 1 from oxuserbasketitems where oxuserbasketitems.oxbasketid = oxuserbaskets.oxid limit 1)"; $this->selectString($sSelect); }
[ "public", "function", "loadWishlistUsers", "(", "$", "sSearchStr", ")", "{", "$", "sSearchStr", "=", "trim", "(", "$", "sSearchStr", ")", ";", "if", "(", "!", "$", "sSearchStr", ")", "{", "return", ";", "}", "$", "quotedSearchStr", "=", "\\", "OxidEsales...
Load searched user list with wishlist @param string $sSearchStr Search string @return null;
[ "Load", "searched", "user", "list", "with", "wishlist" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/UserList.php#L33-L51
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleCrossselling.php
ArticleCrossselling.render
public function render() { parent::render(); $this->_aViewData['edit'] = $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); // crossselling $this->_createCategoryTree("artcattree"); // accessoires $this->_createCategoryTree("artcattree2"); $soxId = $this->getEditObjectId(); if (isset($soxId) && $soxId != "-1") { // load object $oArticle->load($soxId); if ($oArticle->isDerived()) { $this->_aViewData['readonly'] = true; } } $iAoc = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc"); if ($iAoc == 1) { $oArticleCrossellingAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ArticleCrosssellingAjax::class); $this->_aViewData['oxajax'] = $oArticleCrossellingAjax->getColumns(); return "popups/article_crossselling.tpl"; } elseif ($iAoc == 2) { $oArticleAccessoriesAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ArticleAccessoriesAjax::class); $this->_aViewData['oxajax'] = $oArticleAccessoriesAjax->getColumns(); return "popups/article_accessories.tpl"; } return "article_crossselling.tpl"; }
php
public function render() { parent::render(); $this->_aViewData['edit'] = $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); // crossselling $this->_createCategoryTree("artcattree"); // accessoires $this->_createCategoryTree("artcattree2"); $soxId = $this->getEditObjectId(); if (isset($soxId) && $soxId != "-1") { // load object $oArticle->load($soxId); if ($oArticle->isDerived()) { $this->_aViewData['readonly'] = true; } } $iAoc = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc"); if ($iAoc == 1) { $oArticleCrossellingAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ArticleCrosssellingAjax::class); $this->_aViewData['oxajax'] = $oArticleCrossellingAjax->getColumns(); return "popups/article_crossselling.tpl"; } elseif ($iAoc == 2) { $oArticleAccessoriesAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ArticleAccessoriesAjax::class); $this->_aViewData['oxajax'] = $oArticleAccessoriesAjax->getColumns(); return "popups/article_accessories.tpl"; } return "article_crossselling.tpl"; }
[ "public", "function", "render", "(", ")", "{", "parent", "::", "render", "(", ")", ";", "$", "this", "->", "_aViewData", "[", "'edit'", "]", "=", "$", "oArticle", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model",...
Collects article crosselling and attributes information, passes them to Smarty engine and returns name or template file "article_crossselling.tpl". @return string
[ "Collects", "article", "crosselling", "and", "attributes", "information", "passes", "them", "to", "Smarty", "engine", "and", "returns", "name", "or", "template", "file", "article_crossselling", ".", "tpl", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleCrossselling.php#L26-L62
train
OXID-eSales/oxideshop_ce
source/Core/WidgetControl.php
WidgetControl._runLast
protected function _runLast() { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if ($oConfig->hasActiveViewsChain()) { // Removing current active view. $oConfig->dropLastActiveView(); foreach ($this->parentsAdded as $sParentClassName) { $oConfig->dropLastActiveView(); } // Setting back last active view. $oSmarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty(); $oSmarty->assign('oView', $oConfig->getActiveView()); } }
php
protected function _runLast() { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if ($oConfig->hasActiveViewsChain()) { // Removing current active view. $oConfig->dropLastActiveView(); foreach ($this->parentsAdded as $sParentClassName) { $oConfig->dropLastActiveView(); } // Setting back last active view. $oSmarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty(); $oSmarty->assign('oView', $oConfig->getActiveView()); } }
[ "protected", "function", "_runLast", "(", ")", "{", "$", "oConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "if", "(", "$", "oConfig", "->", "hasActiveViewsChain", "(", ")", ")", "{", "/...
Runs actions that should be performed at the controller finish.
[ "Runs", "actions", "that", "should", "be", "performed", "at", "the", "controller", "finish", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/WidgetControl.php#L71-L87
train
OXID-eSales/oxideshop_ce
source/Core/WidgetControl.php
WidgetControl._initializeViewObject
protected function _initializeViewObject($class, $function, $parameters = null, $viewsChain = null) { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $activeViewsIds = $config->getActiveViewsIds(); $activeViewsIds = array_map("strtolower", $activeViewsIds); $classKey = Registry::getControllerClassNameResolver()->getIdByClassName($class); $classKey = !is_null($classKey) ? $classKey : $class; //fallback // if exists views chain, initializing these view at first if (is_array($viewsChain) && !empty($viewsChain)) { foreach ($viewsChain as $parentClassKey) { $parentClass = Registry::getControllerClassNameResolver()->getClassNameById($parentClassKey); if ($parentClassKey != $classKey && !in_array(strtolower($parentClassKey), $activeViewsIds) && $parentClass) { // creating parent view object $viewObject = oxNew($parentClass); if ('oxubase' != strtolower($parentClassKey)) { $viewObject->setClassKey($parentClassKey); } $config->setActiveView($viewObject); $this->parentsAdded[] = $parentClassKey; } } } $widgetViewObject = parent::_initializeViewObject($class, $function, $parameters, null); if (!is_a($widgetViewObject, WidgetController::class)) { /** @var ObjectException $exception */ $exception = oxNew(ObjectException::class, get_class($widgetViewObject) . ' is not an instance of ' . WidgetController::class); throw $exception; } // Set template name for current widget. if (!empty($parameters['oxwtemplate'])) { $widgetViewObject->setTemplateName($parameters['oxwtemplate']); } return $widgetViewObject; }
php
protected function _initializeViewObject($class, $function, $parameters = null, $viewsChain = null) { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $activeViewsIds = $config->getActiveViewsIds(); $activeViewsIds = array_map("strtolower", $activeViewsIds); $classKey = Registry::getControllerClassNameResolver()->getIdByClassName($class); $classKey = !is_null($classKey) ? $classKey : $class; //fallback // if exists views chain, initializing these view at first if (is_array($viewsChain) && !empty($viewsChain)) { foreach ($viewsChain as $parentClassKey) { $parentClass = Registry::getControllerClassNameResolver()->getClassNameById($parentClassKey); if ($parentClassKey != $classKey && !in_array(strtolower($parentClassKey), $activeViewsIds) && $parentClass) { // creating parent view object $viewObject = oxNew($parentClass); if ('oxubase' != strtolower($parentClassKey)) { $viewObject->setClassKey($parentClassKey); } $config->setActiveView($viewObject); $this->parentsAdded[] = $parentClassKey; } } } $widgetViewObject = parent::_initializeViewObject($class, $function, $parameters, null); if (!is_a($widgetViewObject, WidgetController::class)) { /** @var ObjectException $exception */ $exception = oxNew(ObjectException::class, get_class($widgetViewObject) . ' is not an instance of ' . WidgetController::class); throw $exception; } // Set template name for current widget. if (!empty($parameters['oxwtemplate'])) { $widgetViewObject->setTemplateName($parameters['oxwtemplate']); } return $widgetViewObject; }
[ "protected", "function", "_initializeViewObject", "(", "$", "class", ",", "$", "function", ",", "$", "parameters", "=", "null", ",", "$", "viewsChain", "=", "null", ")", "{", "$", "config", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Reg...
Initialize and return widget view object. @param string $class View class @param string $function Function name @param array $parameters Parameters array @param array $viewsChain Array of views keys that should be initialized as well @throws ObjectException @return \OxidEsales\Eshop\Core\Controller\BaseController Current active view
[ "Initialize", "and", "return", "widget", "view", "object", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/WidgetControl.php#L101-L140
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/NewsMain.php
NewsMain.save
public function save() { parent::save(); $soxId = $this->getEditObjectId(); $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); // checkbox handling if (!isset($aParams['oxnews__oxactive'])) { $aParams['oxnews__oxactive'] = 0; } // creating fake object to save correct time value if (!$aParams['oxnews__oxdate']) { $aParams['oxnews__oxdate'] = ""; } $oConvObject = new \OxidEsales\Eshop\Core\Field(); $oConvObject->fldmax_length = 0; $oConvObject->fldtype = "date"; $oConvObject->value = $aParams['oxnews__oxdate']; $aParams['oxnews__oxdate'] = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->convertDBDate($oConvObject, true); $oNews = oxNew(\OxidEsales\Eshop\Application\Model\News::class); if ($soxId != "-1") { $oNews->loadInLang($this->_iEditLang, $soxId); } else { $aParams['oxnews__oxid'] = null; } //Disable editing for derived items if ($oNews->isDerived()) { return; } //$aParams = $oNews->ConvertNameArray2Idx( $aParams); $oNews->setLanguage(0); $oNews->assign($aParams); $oNews->setLanguage($this->_iEditLang); $oNews->save(); // set oxid if inserted $this->setEditObjectId($oNews->getId()); }
php
public function save() { parent::save(); $soxId = $this->getEditObjectId(); $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); // checkbox handling if (!isset($aParams['oxnews__oxactive'])) { $aParams['oxnews__oxactive'] = 0; } // creating fake object to save correct time value if (!$aParams['oxnews__oxdate']) { $aParams['oxnews__oxdate'] = ""; } $oConvObject = new \OxidEsales\Eshop\Core\Field(); $oConvObject->fldmax_length = 0; $oConvObject->fldtype = "date"; $oConvObject->value = $aParams['oxnews__oxdate']; $aParams['oxnews__oxdate'] = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->convertDBDate($oConvObject, true); $oNews = oxNew(\OxidEsales\Eshop\Application\Model\News::class); if ($soxId != "-1") { $oNews->loadInLang($this->_iEditLang, $soxId); } else { $aParams['oxnews__oxid'] = null; } //Disable editing for derived items if ($oNews->isDerived()) { return; } //$aParams = $oNews->ConvertNameArray2Idx( $aParams); $oNews->setLanguage(0); $oNews->assign($aParams); $oNews->setLanguage($this->_iEditLang); $oNews->save(); // set oxid if inserted $this->setEditObjectId($oNews->getId()); }
[ "public", "function", "save", "(", ")", "{", "parent", "::", "save", "(", ")", ";", "$", "soxId", "=", "$", "this", "->", "getEditObjectId", "(", ")", ";", "$", "aParams", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", ...
Saves news parameters changes. @return mixed
[ "Saves", "news", "parameters", "changes", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/NewsMain.php#L76-L119
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.mapOxActionToFileCache
public function mapOxActionToFileCache($sOxActionId) { $aOxActionToCacheIds = [ 'oxbargain' => 'RSS_BARGAIN', 'oxtop5' => 'RSS_TopShop', 'oxnewest' => 'RSS_NewArts' ]; $sFileCacheName = $aOxActionToCacheIds[$sOxActionId]; if (is_null($sFileCacheName)) { $sFileCacheName = ''; } return $sFileCacheName; }
php
public function mapOxActionToFileCache($sOxActionId) { $aOxActionToCacheIds = [ 'oxbargain' => 'RSS_BARGAIN', 'oxtop5' => 'RSS_TopShop', 'oxnewest' => 'RSS_NewArts' ]; $sFileCacheName = $aOxActionToCacheIds[$sOxActionId]; if (is_null($sFileCacheName)) { $sFileCacheName = ''; } return $sFileCacheName; }
[ "public", "function", "mapOxActionToFileCache", "(", "$", "sOxActionId", ")", "{", "$", "aOxActionToCacheIds", "=", "[", "'oxbargain'", "=>", "'RSS_BARGAIN'", ",", "'oxtop5'", "=>", "'RSS_TopShop'", ",", "'oxnewest'", "=>", "'RSS_NewArts'", "]", ";", "$", "sFileCa...
Give back the cache file name for the given oxActionId. @param string $sOxActionId The oxaction we want the cache file name for. @return string The name of the corresponding file cache file.
[ "Give", "back", "the", "cache", "file", "name", "for", "the", "given", "oxActionId", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L52-L67
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._loadBaseChannel
protected function _loadBaseChannel() { $oShop = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveShop(); $this->_aChannel['title'] = $oShop->oxshops__oxname->value; $this->_aChannel['link'] = Registry::getUtilsUrl()->prepareUrlForNoSession(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl()); $this->_aChannel['description'] = ''; $oLang = Registry::getLang(); $aLangIds = $oLang->getLanguageIds(); $this->_aChannel['language'] = $aLangIds[$oLang->getBaseLanguage()]; $this->_aChannel['copyright'] = $oShop->oxshops__oxname->value; $this->_aChannel['selflink'] = ''; if (oxNew(\OxidEsales\Eshop\Core\MailValidator::class)->isValidEmail($oShop->oxshops__oxinfoemail->value)) { $this->_aChannel['managingEditor'] = $oShop->oxshops__oxinfoemail->value; if ($oShop->oxshops__oxfname) { $this->_aChannel['managingEditor'] .= " ({$oShop->oxshops__oxfname} {$oShop->oxshops__oxlname})"; } } $this->_aChannel['generator'] = $oShop->oxshops__oxname->value; $editionSelector = new EditionSelector(); $this->_aChannel['image']['url'] = \OxidEsales\Eshop\Core\Registry::getConfig()->getImageUrl() . 'logo_' . strtolower($editionSelector->getEdition()) . '.png'; $this->_aChannel['image']['title'] = $this->_aChannel['title']; $this->_aChannel['image']['link'] = $this->_aChannel['link']; }
php
protected function _loadBaseChannel() { $oShop = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveShop(); $this->_aChannel['title'] = $oShop->oxshops__oxname->value; $this->_aChannel['link'] = Registry::getUtilsUrl()->prepareUrlForNoSession(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl()); $this->_aChannel['description'] = ''; $oLang = Registry::getLang(); $aLangIds = $oLang->getLanguageIds(); $this->_aChannel['language'] = $aLangIds[$oLang->getBaseLanguage()]; $this->_aChannel['copyright'] = $oShop->oxshops__oxname->value; $this->_aChannel['selflink'] = ''; if (oxNew(\OxidEsales\Eshop\Core\MailValidator::class)->isValidEmail($oShop->oxshops__oxinfoemail->value)) { $this->_aChannel['managingEditor'] = $oShop->oxshops__oxinfoemail->value; if ($oShop->oxshops__oxfname) { $this->_aChannel['managingEditor'] .= " ({$oShop->oxshops__oxfname} {$oShop->oxshops__oxlname})"; } } $this->_aChannel['generator'] = $oShop->oxshops__oxname->value; $editionSelector = new EditionSelector(); $this->_aChannel['image']['url'] = \OxidEsales\Eshop\Core\Registry::getConfig()->getImageUrl() . 'logo_' . strtolower($editionSelector->getEdition()) . '.png'; $this->_aChannel['image']['title'] = $this->_aChannel['title']; $this->_aChannel['image']['link'] = $this->_aChannel['link']; }
[ "protected", "function", "_loadBaseChannel", "(", ")", "{", "$", "oShop", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getActiveShop", "(", ")", ";", "$", "this", "->", "_aChannel", "[", "'ti...
_loadBaseChannel loads basic channel data @access protected
[ "_loadBaseChannel", "loads", "basic", "channel", "data" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L98-L124
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._getCacheId
protected function _getCacheId($name) { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); return $name . '_' . $oConfig->getShopId() . '_' . Registry::getLang()->getBaseLanguage() . '_' . (int) $oConfig->getShopCurrency(); }
php
protected function _getCacheId($name) { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); return $name . '_' . $oConfig->getShopId() . '_' . Registry::getLang()->getBaseLanguage() . '_' . (int) $oConfig->getShopCurrency(); }
[ "protected", "function", "_getCacheId", "(", "$", "name", ")", "{", "$", "oConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "return", "$", "name", ".", "'_'", ".", "$", "oConfig", "->", ...
_getCacheId retrieve cache id @param string $name cache name @access protected @return string
[ "_getCacheId", "retrieve", "cache", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L134-L139
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._loadFromCache
protected function _loadFromCache($name) { if ($aRes = Registry::getUtils()->fromFileCache($this->_getCacheId($name))) { if ($aRes['timestamp'] > time() - self::CACHE_TTL) { return $aRes['content']; } } return false; }
php
protected function _loadFromCache($name) { if ($aRes = Registry::getUtils()->fromFileCache($this->_getCacheId($name))) { if ($aRes['timestamp'] > time() - self::CACHE_TTL) { return $aRes['content']; } } return false; }
[ "protected", "function", "_loadFromCache", "(", "$", "name", ")", "{", "if", "(", "$", "aRes", "=", "Registry", "::", "getUtils", "(", ")", "->", "fromFileCache", "(", "$", "this", "->", "_getCacheId", "(", "$", "name", ")", ")", ")", "{", "if", "(",...
_loadFromCache load data from cache, requires Rss data Id @param string $name Rss data Id @access protected @return array
[ "_loadFromCache", "load", "data", "from", "cache", "requires", "Rss", "data", "Id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L149-L158
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._getLastBuildDate
protected function _getLastBuildDate($name, $aData) { if ($aData2 = Registry::getUtils()->fromFileCache($this->_getCacheId($name))) { $sLastBuildDate = $aData2['content']['lastBuildDate']; $aData2['content']['lastBuildDate'] = ''; $aData['lastBuildDate'] = ''; if (!strcmp(serialize($aData), serialize($aData2['content']))) { return $sLastBuildDate; } } return date('D, d M Y H:i:s O'); }
php
protected function _getLastBuildDate($name, $aData) { if ($aData2 = Registry::getUtils()->fromFileCache($this->_getCacheId($name))) { $sLastBuildDate = $aData2['content']['lastBuildDate']; $aData2['content']['lastBuildDate'] = ''; $aData['lastBuildDate'] = ''; if (!strcmp(serialize($aData), serialize($aData2['content']))) { return $sLastBuildDate; } } return date('D, d M Y H:i:s O'); }
[ "protected", "function", "_getLastBuildDate", "(", "$", "name", ",", "$", "aData", ")", "{", "if", "(", "$", "aData2", "=", "Registry", "::", "getUtils", "(", ")", "->", "fromFileCache", "(", "$", "this", "->", "_getCacheId", "(", "$", "name", ")", ")"...
_getLastBuildDate check if changed data and renew last build date if needed returns result as string @param string $name Rss data Id @param array $aData channel data @access protected @return string
[ "_getLastBuildDate", "check", "if", "changed", "data", "and", "renew", "last", "build", "date", "if", "needed", "returns", "result", "as", "string" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L171-L183
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._saveToCache
protected function _saveToCache($name, $aContent) { $aData = ['timestamp' => time(), 'content' => $aContent]; return Registry::getUtils()->toFileCache($this->_getCacheId($name), $aData); }
php
protected function _saveToCache($name, $aContent) { $aData = ['timestamp' => time(), 'content' => $aContent]; return Registry::getUtils()->toFileCache($this->_getCacheId($name), $aData); }
[ "protected", "function", "_saveToCache", "(", "$", "name", ",", "$", "aContent", ")", "{", "$", "aData", "=", "[", "'timestamp'", "=>", "time", "(", ")", ",", "'content'", "=>", "$", "aContent", "]", ";", "return", "Registry", "::", "getUtils", "(", ")...
_saveToCache writes generated rss data to cache returns true on successfull write, false otherwise A successfull write means only write ok AND data has actually changed if give @param string $name cache name @param array $aContent data to be saved @access protected @return void
[ "_saveToCache", "writes", "generated", "rss", "data", "to", "cache", "returns", "true", "on", "successfull", "write", "false", "otherwise", "A", "successfull", "write", "means", "only", "write", "ok", "AND", "data", "has", "actually", "changed", "if", "give" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L197-L202
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._prepareUrl
protected function _prepareUrl($sUri, $sTitle) { $iLang = Registry::getLang()->getBaseLanguage(); $sUrl = $this->_getShopUrl(); $sUrl .= $sUri . '&amp;lang=' . $iLang; if (Registry::getUtils()->seoIsActive()) { $oEncoder = Registry::getSeoEncoder(); $sUrl = $oEncoder->getDynamicUrl($sUrl, "rss/{$sTitle}/", $iLang); } return Registry::getUtilsUrl()->prepareUrlForNoSession($sUrl); }
php
protected function _prepareUrl($sUri, $sTitle) { $iLang = Registry::getLang()->getBaseLanguage(); $sUrl = $this->_getShopUrl(); $sUrl .= $sUri . '&amp;lang=' . $iLang; if (Registry::getUtils()->seoIsActive()) { $oEncoder = Registry::getSeoEncoder(); $sUrl = $oEncoder->getDynamicUrl($sUrl, "rss/{$sTitle}/", $iLang); } return Registry::getUtilsUrl()->prepareUrlForNoSession($sUrl); }
[ "protected", "function", "_prepareUrl", "(", "$", "sUri", ",", "$", "sTitle", ")", "{", "$", "iLang", "=", "Registry", "::", "getLang", "(", ")", "->", "getBaseLanguage", "(", ")", ";", "$", "sUrl", "=", "$", "this", "->", "_getShopUrl", "(", ")", ";...
_prepareUrl make url from uri @param string $sUri standard uri @param string $sTitle page title @access protected @return string
[ "_prepareUrl", "make", "url", "from", "uri" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L283-L295
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._prepareFeedName
protected function _prepareFeedName($sTitle) { $oShop = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveShop(); return $oShop->oxshops__oxname->value . "/" . $sTitle; }
php
protected function _prepareFeedName($sTitle) { $oShop = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveShop(); return $oShop->oxshops__oxname->value . "/" . $sTitle; }
[ "protected", "function", "_prepareFeedName", "(", "$", "sTitle", ")", "{", "$", "oShop", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getActiveShop", "(", ")", ";", "return", "$", "oShop", "-...
_prepareFeedName adds shop name to feed title @param string $sTitle page title @access protected @return string
[ "_prepareFeedName", "adds", "shop", "name", "to", "feed", "title" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L306-L311
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._getShopUrl
protected function _getShopUrl() { $sUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl(); $oStr = getStr(); if ($oStr->strpos($sUrl, '?') !== false) { if (!$oStr->preg_match('/[?&](amp;)?$/i', $sUrl)) { $sUrl .= '&amp;'; } } else { $sUrl .= '?'; } return $sUrl; }
php
protected function _getShopUrl() { $sUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl(); $oStr = getStr(); if ($oStr->strpos($sUrl, '?') !== false) { if (!$oStr->preg_match('/[?&](amp;)?$/i', $sUrl)) { $sUrl .= '&amp;'; } } else { $sUrl .= '?'; } return $sUrl; }
[ "protected", "function", "_getShopUrl", "(", ")", "{", "$", "sUrl", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getShopUrl", "(", ")", ";", "$", "oStr", "=", "getStr", "(", ")", ";", "if...
_getShopUrl returns shop home url @access protected @return string
[ "_getShopUrl", "returns", "shop", "home", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L319-L332
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._loadData
protected function _loadData($sTag, $sTitle, $sDesc, $aItems, $sRssUrl, $sTargetUrl = null) { $this->_loadBaseChannel(); $this->_aChannel['selflink'] = $sRssUrl; if ($sTargetUrl) { $this->_aChannel['link'] = $this->_aChannel['image']['link'] = $sTargetUrl; } $this->_aChannel['image']['title'] = $this->_aChannel['title'] = $sTitle; $this->_aChannel['image']['description'] = $this->_aChannel['description'] = $sDesc; $this->_aChannel['items'] = $aItems; if ($sTag) { $this->_aChannel['lastBuildDate'] = $this->_getLastBuildDate($sTag, $this->_aChannel); $this->_saveToCache($sTag, $this->_aChannel); } else { $this->_aChannel['lastBuildDate'] = date('D, d M Y H:i:s O', Registry::getUtilsDate()->getTime()); } }
php
protected function _loadData($sTag, $sTitle, $sDesc, $aItems, $sRssUrl, $sTargetUrl = null) { $this->_loadBaseChannel(); $this->_aChannel['selflink'] = $sRssUrl; if ($sTargetUrl) { $this->_aChannel['link'] = $this->_aChannel['image']['link'] = $sTargetUrl; } $this->_aChannel['image']['title'] = $this->_aChannel['title'] = $sTitle; $this->_aChannel['image']['description'] = $this->_aChannel['description'] = $sDesc; $this->_aChannel['items'] = $aItems; if ($sTag) { $this->_aChannel['lastBuildDate'] = $this->_getLastBuildDate($sTag, $this->_aChannel); $this->_saveToCache($sTag, $this->_aChannel); } else { $this->_aChannel['lastBuildDate'] = date('D, d M Y H:i:s O', Registry::getUtilsDate()->getTime()); } }
[ "protected", "function", "_loadData", "(", "$", "sTag", ",", "$", "sTitle", ",", "$", "sDesc", ",", "$", "aItems", ",", "$", "sRssUrl", ",", "$", "sTargetUrl", "=", "null", ")", "{", "$", "this", "->", "_loadBaseChannel", "(", ")", ";", "$", "this", ...
_loadData loads given data to channel @param string $sTag tag @param string $sTitle object title @param string $sDesc object description @param array $aItems items data to be put to rss @param string $sRssUrl url of rss page @param string $sTargetUrl url of page rss represents @access protected
[ "_loadData", "loads", "given", "data", "to", "channel" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L346-L367
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.loadTopInShop
public function loadTopInShop() { if (($this->_aChannel = $this->_loadFromCache(self::RSS_TOPSHOP))) { return; } $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->loadTop5Articles(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount')); $oLang = Registry::getLang(); $this->_loadData( self::RSS_TOPSHOP, $this->getTopInShopTitle(), $oLang->translateString('TOP_SHOP_PRODUCTS', $oLang->getBaseLanguage()), $this->_getArticleItems($oArtList), $this->getTopInShopUrl() ); }
php
public function loadTopInShop() { if (($this->_aChannel = $this->_loadFromCache(self::RSS_TOPSHOP))) { return; } $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->loadTop5Articles(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount')); $oLang = Registry::getLang(); $this->_loadData( self::RSS_TOPSHOP, $this->getTopInShopTitle(), $oLang->translateString('TOP_SHOP_PRODUCTS', $oLang->getBaseLanguage()), $this->_getArticleItems($oArtList), $this->getTopInShopUrl() ); }
[ "public", "function", "loadTopInShop", "(", ")", "{", "if", "(", "(", "$", "this", "->", "_aChannel", "=", "$", "this", "->", "_loadFromCache", "(", "self", "::", "RSS_TOPSHOP", ")", ")", ")", "{", "return", ";", "}", "$", "oArtList", "=", "oxNew", "...
loadTopShop loads 'Top of the Shop' rss data @access public @return void
[ "loadTopShop", "loads", "Top", "of", "the", "Shop", "rss", "data" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L403-L420
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.getNewestArticlesTitle
public function getNewestArticlesTitle() { $oLang = Registry::getLang(); $iLang = $oLang->getBaseLanguage(); return $this->_prepareFeedName($oLang->translateString('NEWEST_SHOP_PRODUCTS', $iLang)); }
php
public function getNewestArticlesTitle() { $oLang = Registry::getLang(); $iLang = $oLang->getBaseLanguage(); return $this->_prepareFeedName($oLang->translateString('NEWEST_SHOP_PRODUCTS', $iLang)); }
[ "public", "function", "getNewestArticlesTitle", "(", ")", "{", "$", "oLang", "=", "Registry", "::", "getLang", "(", ")", ";", "$", "iLang", "=", "$", "oLang", "->", "getBaseLanguage", "(", ")", ";", "return", "$", "this", "->", "_prepareFeedName", "(", "...
get title for 'Newest Shop Articles' rss feed @access public @return string
[ "get", "title", "for", "Newest", "Shop", "Articles", "rss", "feed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L430-L436
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.loadNewestArticles
public function loadNewestArticles() { if (($this->_aChannel = $this->_loadFromCache(self::RSS_NEWARTS))) { return; } $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->loadNewestArticles(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount')); $oLang = Registry::getLang(); $this->_loadData( self::RSS_NEWARTS, $this->getNewestArticlesTitle(), $oLang->translateString('NEWEST_SHOP_PRODUCTS', $oLang->getBaseLanguage()), $this->_getArticleItems($oArtList), $this->getNewestArticlesUrl() ); }
php
public function loadNewestArticles() { if (($this->_aChannel = $this->_loadFromCache(self::RSS_NEWARTS))) { return; } $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->loadNewestArticles(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount')); $oLang = Registry::getLang(); $this->_loadData( self::RSS_NEWARTS, $this->getNewestArticlesTitle(), $oLang->translateString('NEWEST_SHOP_PRODUCTS', $oLang->getBaseLanguage()), $this->_getArticleItems($oArtList), $this->getNewestArticlesUrl() ); }
[ "public", "function", "loadNewestArticles", "(", ")", "{", "if", "(", "(", "$", "this", "->", "_aChannel", "=", "$", "this", "->", "_loadFromCache", "(", "self", "::", "RSS_NEWARTS", ")", ")", ")", "{", "return", ";", "}", "$", "oArtList", "=", "oxNew"...
loadNewestArticles loads 'Newest Shop Articles' rss data @access public @return void
[ "loadNewestArticles", "loads", "Newest", "Shop", "Articles", "rss", "data" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L457-L473
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.getCategoryArticlesTitle
public function getCategoryArticlesTitle(\OxidEsales\Eshop\Application\Model\Category $oCat) { $oLang = Registry::getLang(); $iLang = $oLang->getBaseLanguage(); $sTitle = $this->_getCatPath($oCat); return $this->_prepareFeedName($sTitle . $oLang->translateString('PRODUCTS', $iLang)); }
php
public function getCategoryArticlesTitle(\OxidEsales\Eshop\Application\Model\Category $oCat) { $oLang = Registry::getLang(); $iLang = $oLang->getBaseLanguage(); $sTitle = $this->_getCatPath($oCat); return $this->_prepareFeedName($sTitle . $oLang->translateString('PRODUCTS', $iLang)); }
[ "public", "function", "getCategoryArticlesTitle", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "Category", "$", "oCat", ")", "{", "$", "oLang", "=", "Registry", "::", "getLang", "(", ")", ";", "$", "iLang", "=", "$", ...
get title for 'Category Articles' rss feed @param \OxidEsales\Eshop\Application\Model\Category $oCat category object @access public @return string
[ "get", "title", "for", "Category", "Articles", "rss", "feed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L485-L492
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.getCategoryArticlesUrl
public function getCategoryArticlesUrl(\OxidEsales\Eshop\Application\Model\Category $oCat) { $oLang = Registry::getLang(); return $this->_prepareUrl( "cl=rss&amp;fnc=catarts&amp;cat=" . urlencode($oCat->getId()), sprintf($oLang->translateString('CATEGORY_PRODUCTS_S', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value) ); }
php
public function getCategoryArticlesUrl(\OxidEsales\Eshop\Application\Model\Category $oCat) { $oLang = Registry::getLang(); return $this->_prepareUrl( "cl=rss&amp;fnc=catarts&amp;cat=" . urlencode($oCat->getId()), sprintf($oLang->translateString('CATEGORY_PRODUCTS_S', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value) ); }
[ "public", "function", "getCategoryArticlesUrl", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "Category", "$", "oCat", ")", "{", "$", "oLang", "=", "Registry", "::", "getLang", "(", ")", ";", "return", "$", "this", "->",...
getCategoryArticlesUrl get url for 'Category Articles' rss feed @param \OxidEsales\Eshop\Application\Model\Category $oCat category object @access public @return string
[ "getCategoryArticlesUrl", "get", "url", "for", "Category", "Articles", "rss", "feed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L525-L533
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.loadCategoryArticles
public function loadCategoryArticles(\OxidEsales\Eshop\Application\Model\Category $oCat) { $sId = $oCat->getId(); if (($this->_aChannel = $this->_loadFromCache(self::RSS_CATARTS . $sId))) { return; } $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->setCustomSorting('oc.oxtimestamp desc'); $oArtList->loadCategoryArticles($oCat->getId(), null, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount')); $oLang = Registry::getLang(); $this->_loadData( self::RSS_CATARTS . $sId, $this->getCategoryArticlesTitle($oCat), sprintf($oLang->translateString('S_CATEGORY_PRODUCTS', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value), $this->_getArticleItems($oArtList), $this->getCategoryArticlesUrl($oCat), $oCat->getLink() ); }
php
public function loadCategoryArticles(\OxidEsales\Eshop\Application\Model\Category $oCat) { $sId = $oCat->getId(); if (($this->_aChannel = $this->_loadFromCache(self::RSS_CATARTS . $sId))) { return; } $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->setCustomSorting('oc.oxtimestamp desc'); $oArtList->loadCategoryArticles($oCat->getId(), null, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount')); $oLang = Registry::getLang(); $this->_loadData( self::RSS_CATARTS . $sId, $this->getCategoryArticlesTitle($oCat), sprintf($oLang->translateString('S_CATEGORY_PRODUCTS', $oLang->getBaseLanguage()), $oCat->oxcategories__oxtitle->value), $this->_getArticleItems($oArtList), $this->getCategoryArticlesUrl($oCat), $oCat->getLink() ); }
[ "public", "function", "loadCategoryArticles", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "Category", "$", "oCat", ")", "{", "$", "sId", "=", "$", "oCat", "->", "getId", "(", ")", ";", "if", "(", "(", "$", "this", ...
loadCategoryArticles loads 'Category Articles' rss data @param \OxidEsales\Eshop\Application\Model\Category $oCat category object @access public @return void
[ "loadCategoryArticles", "loads", "Category", "Articles", "rss", "data" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L544-L564
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.getSearchArticlesTitle
public function getSearchArticlesTitle($sSearch, $sCatId, $sVendorId, $sManufacturerId) { return $this->_prepareFeedName(getStr()->htmlspecialchars($this->_getSearchParamsTranslation('SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER', $sSearch, $sCatId, $sVendorId, $sManufacturerId))); }
php
public function getSearchArticlesTitle($sSearch, $sCatId, $sVendorId, $sManufacturerId) { return $this->_prepareFeedName(getStr()->htmlspecialchars($this->_getSearchParamsTranslation('SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER', $sSearch, $sCatId, $sVendorId, $sManufacturerId))); }
[ "public", "function", "getSearchArticlesTitle", "(", "$", "sSearch", ",", "$", "sCatId", ",", "$", "sVendorId", ",", "$", "sManufacturerId", ")", "{", "return", "$", "this", "->", "_prepareFeedName", "(", "getStr", "(", ")", "->", "htmlspecialchars", "(", "$...
get title for 'Search Articles' rss feed @param string $sSearch search string @param string $sCatId category id @param string $sVendorId vendor id @param string $sManufacturerId Manufacturer id @access public @return string
[ "get", "title", "for", "Search", "Articles", "rss", "feed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L579-L582
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._getSearchParamsUrl
protected function _getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId) { $sParams = "searchparam=" . urlencode($sSearch); if ($sCatId) { $sParams .= "&amp;searchcnid=" . urlencode($sCatId); } if ($sVendorId) { $sParams .= "&amp;searchvendor=" . urlencode($sVendorId); } if ($sManufacturerId) { $sParams .= "&amp;searchmanufacturer=" . urlencode($sManufacturerId); } return $sParams; }
php
protected function _getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId) { $sParams = "searchparam=" . urlencode($sSearch); if ($sCatId) { $sParams .= "&amp;searchcnid=" . urlencode($sCatId); } if ($sVendorId) { $sParams .= "&amp;searchvendor=" . urlencode($sVendorId); } if ($sManufacturerId) { $sParams .= "&amp;searchmanufacturer=" . urlencode($sManufacturerId); } return $sParams; }
[ "protected", "function", "_getSearchParamsUrl", "(", "$", "sSearch", ",", "$", "sCatId", ",", "$", "sVendorId", ",", "$", "sManufacturerId", ")", "{", "$", "sParams", "=", "\"searchparam=\"", ".", "urlencode", "(", "$", "sSearch", ")", ";", "if", "(", "$",...
_getSearchParamsUrl return search parameters for url @param string $sSearch search string @param string $sCatId category id @param string $sVendorId vendor id @param string $sManufacturerId Manufacturer id @access protected @return string
[ "_getSearchParamsUrl", "return", "search", "parameters", "for", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L596-L612
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._getObjectField
protected function _getObjectField($sId, $sObject, $sField) { if (!$sId) { return ''; } $oObj = oxNew($sObject); if ($oObj->load($sId)) { return $oObj->$sField->value; } return ''; }
php
protected function _getObjectField($sId, $sObject, $sField) { if (!$sId) { return ''; } $oObj = oxNew($sObject); if ($oObj->load($sId)) { return $oObj->$sField->value; } return ''; }
[ "protected", "function", "_getObjectField", "(", "$", "sId", ",", "$", "sObject", ",", "$", "sField", ")", "{", "if", "(", "!", "$", "sId", ")", "{", "return", "''", ";", "}", "$", "oObj", "=", "oxNew", "(", "$", "sObject", ")", ";", "if", "(", ...
loads object and returns specified field @param string $sId object id @param string $sObject object class @param string $sField object field to be taken @access protected @return string
[ "loads", "object", "and", "returns", "specified", "field" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L624-L635
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._getSearchParamsTranslation
protected function _getSearchParamsTranslation($sSearch, $sId, $sCatId, $sVendorId, $sManufacturerId) { $oLang = Registry::getLang(); $sCatTitle = ''; if ($sTitle = $this->_getObjectField($sCatId, 'oxcategory', 'oxcategories__oxtitle')) { $sCatTitle = sprintf($oLang->translateString('CATEGORY_S', $oLang->getBaseLanguage()), $sTitle); } $sVendorTitle = ''; if ($sTitle = $this->_getObjectField($sVendorId, 'oxvendor', 'oxvendor__oxtitle')) { $sVendorTitle = sprintf($oLang->translateString('VENDOR_S', $oLang->getBaseLanguage()), $sTitle); } $sManufacturerTitle = ''; if ($sTitle = $this->_getObjectField($sManufacturerId, 'oxmanufacturer', 'oxmanufacturers__oxtitle')) { $sManufacturerTitle = sprintf($oLang->translateString('MANUFACTURER_S', $oLang->getBaseLanguage()), $sTitle); } $sRet = sprintf($oLang->translateString($sSearch, $oLang->getBaseLanguage()), $sId); $sRet = str_replace('<TAG_CATEGORY>', $sCatTitle, $sRet); $sRet = str_replace('<TAG_VENDOR>', $sVendorTitle, $sRet); $sRet = str_replace('<TAG_MANUFACTURER>', $sManufacturerTitle, $sRet); return $sRet; }
php
protected function _getSearchParamsTranslation($sSearch, $sId, $sCatId, $sVendorId, $sManufacturerId) { $oLang = Registry::getLang(); $sCatTitle = ''; if ($sTitle = $this->_getObjectField($sCatId, 'oxcategory', 'oxcategories__oxtitle')) { $sCatTitle = sprintf($oLang->translateString('CATEGORY_S', $oLang->getBaseLanguage()), $sTitle); } $sVendorTitle = ''; if ($sTitle = $this->_getObjectField($sVendorId, 'oxvendor', 'oxvendor__oxtitle')) { $sVendorTitle = sprintf($oLang->translateString('VENDOR_S', $oLang->getBaseLanguage()), $sTitle); } $sManufacturerTitle = ''; if ($sTitle = $this->_getObjectField($sManufacturerId, 'oxmanufacturer', 'oxmanufacturers__oxtitle')) { $sManufacturerTitle = sprintf($oLang->translateString('MANUFACTURER_S', $oLang->getBaseLanguage()), $sTitle); } $sRet = sprintf($oLang->translateString($sSearch, $oLang->getBaseLanguage()), $sId); $sRet = str_replace('<TAG_CATEGORY>', $sCatTitle, $sRet); $sRet = str_replace('<TAG_VENDOR>', $sVendorTitle, $sRet); $sRet = str_replace('<TAG_MANUFACTURER>', $sManufacturerTitle, $sRet); return $sRet; }
[ "protected", "function", "_getSearchParamsTranslation", "(", "$", "sSearch", ",", "$", "sId", ",", "$", "sCatId", ",", "$", "sVendorId", ",", "$", "sManufacturerId", ")", "{", "$", "oLang", "=", "Registry", "::", "getLang", "(", ")", ";", "$", "sCatTitle",...
_getSearchParamsTranslation translates text for given lang id loads category and vendor to take their titles. @param string $sSearch search param @param string $sId language id @param string $sCatId category id @param string $sVendorId vendor id @param string $sManufacturerId Manufacturer id @access protected @return string
[ "_getSearchParamsTranslation", "translates", "text", "for", "given", "lang", "id", "loads", "category", "and", "vendor", "to", "take", "their", "titles", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L650-L673
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.getSearchArticlesUrl
public function getSearchArticlesUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId) { $oLang = Registry::getLang(); $sUrl = $this->_prepareUrl("cl=rss&amp;fnc=searcharts", $oLang->translateString('SEARCH', $oLang->getBaseLanguage())); $sJoin = '?'; if (strpos($sUrl, '?') !== false) { $sJoin = '&amp;'; } return $sUrl . $sJoin . $this->_getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId); }
php
public function getSearchArticlesUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId) { $oLang = Registry::getLang(); $sUrl = $this->_prepareUrl("cl=rss&amp;fnc=searcharts", $oLang->translateString('SEARCH', $oLang->getBaseLanguage())); $sJoin = '?'; if (strpos($sUrl, '?') !== false) { $sJoin = '&amp;'; } return $sUrl . $sJoin . $this->_getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId); }
[ "public", "function", "getSearchArticlesUrl", "(", "$", "sSearch", ",", "$", "sCatId", ",", "$", "sVendorId", ",", "$", "sManufacturerId", ")", "{", "$", "oLang", "=", "Registry", "::", "getLang", "(", ")", ";", "$", "sUrl", "=", "$", "this", "->", "_p...
getSearchArticlesUrl get url for 'Search Articles' rss feed @param string $sSearch search string @param string $sCatId category id @param string $sVendorId vendor id @param string $sManufacturerId Manufacturer id @access public @return string
[ "getSearchArticlesUrl", "get", "url", "for", "Search", "Articles", "rss", "feed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L687-L698
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.loadSearchArticles
public function loadSearchArticles($sSearch, $sCatId, $sVendorId, $sManufacturerId) { // dont use cache for search //if ($this->_aChannel = $this->_loadFromCache(self::RSS_SEARCHARTS.md5($sSearch.$sCatId.$sVendorId))) { // return; //} $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oConfig->setConfigParam('iNrofCatArticles', $oConfig->getConfigParam('iRssItemsCount')); $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\Search::class)->getSearchArticles($sSearch, $sCatId, $sVendorId, $sManufacturerId, oxNew(\OxidEsales\Eshop\Application\Model\Article::class)->getViewName() . '.oxtimestamp desc'); $this->_loadData( // dont use cache for search null, //self::RSS_SEARCHARTS.md5($sSearch.$sCatId.$sVendorId), $this->getSearchArticlesTitle($sSearch, $sCatId, $sVendorId, $sManufacturerId), $this->_getSearchParamsTranslation('SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER', getStr()->htmlspecialchars($sSearch), $sCatId, $sVendorId, $sManufacturerId), $this->_getArticleItems($oArtList), $this->getSearchArticlesUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId), $this->_getShopUrl() . "cl=search&amp;" . $this->_getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId) ); }
php
public function loadSearchArticles($sSearch, $sCatId, $sVendorId, $sManufacturerId) { // dont use cache for search //if ($this->_aChannel = $this->_loadFromCache(self::RSS_SEARCHARTS.md5($sSearch.$sCatId.$sVendorId))) { // return; //} $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oConfig->setConfigParam('iNrofCatArticles', $oConfig->getConfigParam('iRssItemsCount')); $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\Search::class)->getSearchArticles($sSearch, $sCatId, $sVendorId, $sManufacturerId, oxNew(\OxidEsales\Eshop\Application\Model\Article::class)->getViewName() . '.oxtimestamp desc'); $this->_loadData( // dont use cache for search null, //self::RSS_SEARCHARTS.md5($sSearch.$sCatId.$sVendorId), $this->getSearchArticlesTitle($sSearch, $sCatId, $sVendorId, $sManufacturerId), $this->_getSearchParamsTranslation('SEARCH_FOR_PRODUCTS_CATEGORY_VENDOR_MANUFACTURER', getStr()->htmlspecialchars($sSearch), $sCatId, $sVendorId, $sManufacturerId), $this->_getArticleItems($oArtList), $this->getSearchArticlesUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId), $this->_getShopUrl() . "cl=search&amp;" . $this->_getSearchParamsUrl($sSearch, $sCatId, $sVendorId, $sManufacturerId) ); }
[ "public", "function", "loadSearchArticles", "(", "$", "sSearch", ",", "$", "sCatId", ",", "$", "sVendorId", ",", "$", "sManufacturerId", ")", "{", "// dont use cache for search", "//if ($this->_aChannel = $this->_loadFromCache(self::RSS_SEARCHARTS.md5($sSearch.$sCatId.$sVendorId)...
loadSearchArticles loads 'Search Articles' rss data @param string $sSearch search string @param string $sCatId category id @param string $sVendorId vendor id @param string $sManufacturerId Manufacturer id @access public
[ "loadSearchArticles", "loads", "Search", "Articles", "rss", "data" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L710-L732
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.getRecommListsTitle
public function getRecommListsTitle(\OxidEsales\Eshop\Application\Model\Article $oArticle) { $oLang = Registry::getLang(); $iLang = $oLang->getBaseLanguage(); return $this->_prepareFeedName(sprintf($oLang->translateString('LISTMANIA_LIST_FOR', $iLang), $oArticle->oxarticles__oxtitle->value)); }
php
public function getRecommListsTitle(\OxidEsales\Eshop\Application\Model\Article $oArticle) { $oLang = Registry::getLang(); $iLang = $oLang->getBaseLanguage(); return $this->_prepareFeedName(sprintf($oLang->translateString('LISTMANIA_LIST_FOR', $iLang), $oArticle->oxarticles__oxtitle->value)); }
[ "public", "function", "getRecommListsTitle", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "Article", "$", "oArticle", ")", "{", "$", "oLang", "=", "Registry", "::", "getLang", "(", ")", ";", "$", "iLang", "=", "$", "o...
get title for 'Recommendation lists' rss feed @param \OxidEsales\Eshop\Application\Model\Article $oArticle load lists for this article @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. @return string
[ "get", "title", "for", "Recommendation", "lists", "rss", "feed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L743-L749
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed._getRecommListItems
protected function _getRecommListItems($oList) { $myUtilsUrl = Registry::getUtilsUrl(); $aItems = []; foreach ($oList as $oRecommList) { $oItem = new stdClass(); $oItem->title = $oRecommList->oxrecommlists__oxtitle->value; $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oRecommList->getLink()); $oItem->isGuidPermalink = true; $oItem->description = $oRecommList->oxrecommlists__oxdesc->value; $aItems[] = $oItem; } return $aItems; }
php
protected function _getRecommListItems($oList) { $myUtilsUrl = Registry::getUtilsUrl(); $aItems = []; foreach ($oList as $oRecommList) { $oItem = new stdClass(); $oItem->title = $oRecommList->oxrecommlists__oxtitle->value; $oItem->guid = $oItem->link = $myUtilsUrl->prepareUrlForNoSession($oRecommList->getLink()); $oItem->isGuidPermalink = true; $oItem->description = $oRecommList->oxrecommlists__oxdesc->value; $aItems[] = $oItem; } return $aItems; }
[ "protected", "function", "_getRecommListItems", "(", "$", "oList", ")", "{", "$", "myUtilsUrl", "=", "Registry", "::", "getUtilsUrl", "(", ")", ";", "$", "aItems", "=", "[", "]", ";", "foreach", "(", "$", "oList", "as", "$", "oRecommList", ")", "{", "$...
make rss data array from given oxlist @param \OxidEsales\Eshop\Core\Model\ListModel $oList recommlist object @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. @return array
[ "make", "rss", "data", "array", "from", "given", "oxlist" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L780-L795
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.getRecommListArticlesTitle
public function getRecommListArticlesTitle(\OxidEsales\Eshop\Application\Model\RecommendationList $oRecommList) { $oLang = Registry::getLang(); $iLang = $oLang->getBaseLanguage(); return $this->_prepareFeedName(sprintf($oLang->translateString('LISTMANIA_LIST_PRODUCTS', $iLang), $oRecommList->oxrecommlists__oxtitle->value)); }
php
public function getRecommListArticlesTitle(\OxidEsales\Eshop\Application\Model\RecommendationList $oRecommList) { $oLang = Registry::getLang(); $iLang = $oLang->getBaseLanguage(); return $this->_prepareFeedName(sprintf($oLang->translateString('LISTMANIA_LIST_PRODUCTS', $iLang), $oRecommList->oxrecommlists__oxtitle->value)); }
[ "public", "function", "getRecommListArticlesTitle", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "RecommendationList", "$", "oRecommList", ")", "{", "$", "oLang", "=", "Registry", "::", "getLang", "(", ")", ";", "$", "iLang...
get title for 'Recommendation list articles' rss feed @param \OxidEsales\Eshop\Application\Model\RecommendationList $oRecommList recomm list to load articles from @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. @return string
[ "get", "title", "for", "Recommendation", "list", "articles", "rss", "feed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L840-L846
train
OXID-eSales/oxideshop_ce
source/Application/Model/RssFeed.php
RssFeed.loadBargain
public function loadBargain() { if (($this->_aChannel = $this->_loadFromCache(self::RSS_BARGAIN))) { return; } $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->loadActionArticles('OXBARGAIN', \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount')); $oLang = Registry::getLang(); $this->_loadData( self::RSS_BARGAIN, $this->getBargainTitle(), $oLang->translateString('BARGAIN_PRODUCTS', $oLang->getBaseLanguage()), $this->_getArticleItems($oArtList), $this->getBargainUrl() ); }
php
public function loadBargain() { if (($this->_aChannel = $this->_loadFromCache(self::RSS_BARGAIN))) { return; } $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oArtList->loadActionArticles('OXBARGAIN', \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iRssItemsCount')); $oLang = Registry::getLang(); $this->_loadData( self::RSS_BARGAIN, $this->getBargainTitle(), $oLang->translateString('BARGAIN_PRODUCTS', $oLang->getBaseLanguage()), $this->_getArticleItems($oArtList), $this->getBargainUrl() ); }
[ "public", "function", "loadBargain", "(", ")", "{", "if", "(", "(", "$", "this", "->", "_aChannel", "=", "$", "this", "->", "_loadFromCache", "(", "self", "::", "RSS_BARGAIN", ")", ")", ")", "{", "return", ";", "}", "$", "oArtList", "=", "oxNew", "("...
loadBargain loads 'Bargain' rss data @access public @return void
[ "loadBargain", "loads", "Bargain", "rss", "data" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/RssFeed.php#L931-L948
train
OXID-eSales/oxideshop_ce
source/Internal/Application/BootstrapContainer/BootstrapContainerFactory.php
BootstrapContainerFactory.getBootstrapContainer
public static function getBootstrapContainer(): ContainerInterface { $symfonyContainer = new ContainerBuilder(); $symfonyContainer->addCompilerPass(new RegisterListenersPass(EventDispatcherInterface::class)); $loader = new YamlFileLoader($symfonyContainer, new \Symfony\Component\Config\FileLocator(__DIR__)); $loader->load('..' . DIRECTORY_SEPARATOR . 'services.yaml'); $symfonyContainer->compile(); return $symfonyContainer; }
php
public static function getBootstrapContainer(): ContainerInterface { $symfonyContainer = new ContainerBuilder(); $symfonyContainer->addCompilerPass(new RegisterListenersPass(EventDispatcherInterface::class)); $loader = new YamlFileLoader($symfonyContainer, new \Symfony\Component\Config\FileLocator(__DIR__)); $loader->load('..' . DIRECTORY_SEPARATOR . 'services.yaml'); $symfonyContainer->compile(); return $symfonyContainer; }
[ "public", "static", "function", "getBootstrapContainer", "(", ")", ":", "ContainerInterface", "{", "$", "symfonyContainer", "=", "new", "ContainerBuilder", "(", ")", ";", "$", "symfonyContainer", "->", "addCompilerPass", "(", "new", "RegisterListenersPass", "(", "Ev...
This is a minimal container that does not need the shop to be installed. @return ContainerInterface
[ "This", "is", "a", "minimal", "container", "that", "does", "not", "need", "the", "shop", "to", "be", "installed", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Application/BootstrapContainer/BootstrapContainerFactory.php#L26-L34
train
OXID-eSales/oxideshop_ce
source/Core/UtilsXml.php
UtilsXml.loadXml
public function loadXml($sXml, $oDomDocument = null) { if (!$oDomDocument) { $oDomDocument = new DOMDocument('1.0', 'utf-8'); } libxml_use_internal_errors(true); $oDomDocument->loadXML($sXml); $errors = libxml_get_errors(); $blLoaded = empty($errors); libxml_clear_errors(); if ($blLoaded) { return $oDomDocument; } return false; }
php
public function loadXml($sXml, $oDomDocument = null) { if (!$oDomDocument) { $oDomDocument = new DOMDocument('1.0', 'utf-8'); } libxml_use_internal_errors(true); $oDomDocument->loadXML($sXml); $errors = libxml_get_errors(); $blLoaded = empty($errors); libxml_clear_errors(); if ($blLoaded) { return $oDomDocument; } return false; }
[ "public", "function", "loadXml", "(", "$", "sXml", ",", "$", "oDomDocument", "=", "null", ")", "{", "if", "(", "!", "$", "oDomDocument", ")", "{", "$", "oDomDocument", "=", "new", "DOMDocument", "(", "'1.0'", ",", "'utf-8'", ")", ";", "}", "libxml_use_...
Takes XML string and makes DOMDocument Returns DOMDocument or false, if it can't be loaded @param string $sXml XML as a string @param DOMDocument $oDomDocument DOM handler @return DOMDocument|bool
[ "Takes", "XML", "string", "and", "makes", "DOMDocument", "Returns", "DOMDocument", "or", "false", "if", "it", "can", "t", "be", "loaded" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsXml.php#L25-L42
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleAttribute.php
ArticleAttribute.render
public function render() { parent::render(); $this->_aViewData['edit'] = $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $soxId = $this->getEditObjectId(); if (isset($soxId) && $soxId != "-1") { // load object $oArticle->load($soxId); if ($oArticle->isDerived()) { $this->_aViewData["readonly"] = true; } } $iAoc = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc"); if ($iAoc == 1) { $oArticleAttributeAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ArticleAttributeAjax::class); $this->_aViewData['oxajax'] = $oArticleAttributeAjax->getColumns(); return "popups/article_attribute.tpl"; } elseif ($iAoc == 2) { $oArticleSelectionAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ArticleSelectionAjax::class); $this->_aViewData['oxajax'] = $oArticleSelectionAjax->getColumns(); return "popups/article_selection.tpl"; } return "article_attribute.tpl"; }
php
public function render() { parent::render(); $this->_aViewData['edit'] = $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $soxId = $this->getEditObjectId(); if (isset($soxId) && $soxId != "-1") { // load object $oArticle->load($soxId); if ($oArticle->isDerived()) { $this->_aViewData["readonly"] = true; } } $iAoc = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc"); if ($iAoc == 1) { $oArticleAttributeAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ArticleAttributeAjax::class); $this->_aViewData['oxajax'] = $oArticleAttributeAjax->getColumns(); return "popups/article_attribute.tpl"; } elseif ($iAoc == 2) { $oArticleSelectionAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\ArticleSelectionAjax::class); $this->_aViewData['oxajax'] = $oArticleSelectionAjax->getColumns(); return "popups/article_selection.tpl"; } return "article_attribute.tpl"; }
[ "public", "function", "render", "(", ")", "{", "parent", "::", "render", "(", ")", ";", "$", "this", "->", "_aViewData", "[", "'edit'", "]", "=", "$", "oArticle", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model",...
Collects article attributes and selection lists, passes them to Smarty engine, returns name of template file "article_attribute.tpl". @return string
[ "Collects", "article", "attributes", "and", "selection", "lists", "passes", "them", "to", "Smarty", "engine", "returns", "name", "of", "template", "file", "article_attribute", ".", "tpl", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleAttribute.php#L25-L55
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleTemplateBlockRepository.php
ModuleTemplateBlockRepository.getBlocksCount
public function getBlocksCount($modulesId, $shopId) { $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $modulesIdQuery = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($modulesId)); $sql = "select COUNT(*) from oxtplblocks where oxactive=1 and oxshopid = ? and oxmodule in ( " . $modulesIdQuery . " )"; return $db->getOne($sql, [$shopId]); }
php
public function getBlocksCount($modulesId, $shopId) { $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $modulesIdQuery = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($modulesId)); $sql = "select COUNT(*) from oxtplblocks where oxactive=1 and oxshopid = ? and oxmodule in ( " . $modulesIdQuery . " )"; return $db->getOne($sql, [$shopId]); }
[ "public", "function", "getBlocksCount", "(", "$", "modulesId", ",", "$", "shopId", ")", "{", "$", "db", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "...
Return how many blocks of provided module overrides any template for active shop. @param array $modulesId list of modules to check if their template blocks overrides some shop block. @param string $shopId shop id to check if some module block overrides some template blocks in this Shop. @return string count of blocks for Shop=$shopId from modules=$modulesId.
[ "Return", "how", "many", "blocks", "of", "provided", "module", "overrides", "any", "template", "for", "active", "shop", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleTemplateBlockRepository.php#L25-L36
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleTemplateBlockRepository.php
ModuleTemplateBlockRepository.getBlocks
public function getBlocks($shopTemplateName, $activeModulesId, $shopId, $themesId = []) { $modulesId = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($activeModulesId)); $activeThemesIdQuery = $this->formActiveThemesIdQuery($themesId); $sql = "select * from oxtplblocks where oxactive=1 and oxshopid=? and oxtemplate=? and oxmodule in ( " . $modulesId . " ) and oxtheme in (" . $activeThemesIdQuery . ") order by oxpos asc, oxtheme asc, oxid asc"; $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); return $db->getAll($sql, [$shopId, $shopTemplateName]); }
php
public function getBlocks($shopTemplateName, $activeModulesId, $shopId, $themesId = []) { $modulesId = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($activeModulesId)); $activeThemesIdQuery = $this->formActiveThemesIdQuery($themesId); $sql = "select * from oxtplblocks where oxactive=1 and oxshopid=? and oxtemplate=? and oxmodule in ( " . $modulesId . " ) and oxtheme in (" . $activeThemesIdQuery . ") order by oxpos asc, oxtheme asc, oxid asc"; $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); return $db->getAll($sql, [$shopId, $shopTemplateName]); }
[ "public", "function", "getBlocks", "(", "$", "shopTemplateName", ",", "$", "activeModulesId", ",", "$", "shopId", ",", "$", "themesId", "=", "[", "]", ")", "{", "$", "modulesId", "=", "implode", "(", "\", \"", ",", "\\", "OxidEsales", "\\", "Eshop", "\\"...
Get modules template blocks information filtered by provided parameters. @param string $shopTemplateName shop template file name. @param array $activeModulesId list of modules to get information about. @param string $shopId in which Shop modules must be active. @param array $themesId list of themes to get information about. @return array
[ "Get", "modules", "template", "blocks", "information", "filtered", "by", "provided", "parameters", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleTemplateBlockRepository.php#L48-L64
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleTemplateBlockRepository.php
ModuleTemplateBlockRepository.formActiveThemesIdQuery
private function formActiveThemesIdQuery($activeThemeIds = []) { $defaultThemeIndicator = ''; array_unshift($activeThemeIds, $defaultThemeIndicator); return implode(', ', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($activeThemeIds)); }
php
private function formActiveThemesIdQuery($activeThemeIds = []) { $defaultThemeIndicator = ''; array_unshift($activeThemeIds, $defaultThemeIndicator); return implode(', ', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($activeThemeIds)); }
[ "private", "function", "formActiveThemesIdQuery", "(", "$", "activeThemeIds", "=", "[", "]", ")", "{", "$", "defaultThemeIndicator", "=", "''", ";", "array_unshift", "(", "$", "activeThemeIds", ",", "$", "defaultThemeIndicator", ")", ";", "return", "implode", "(...
To form sql query part for active themes. @param array $activeThemeIds @return string
[ "To", "form", "sql", "query", "part", "for", "active", "themes", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleTemplateBlockRepository.php#L73-L79
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/CategoryMain.php
CategoryMain.render
public function render() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); parent::render(); /** @var \OxidEsales\Eshop\Application\Model\Category $oCategory */ $oCategory = $this->createCategory(); $categoryId = $this->getEditObjectId(); $this->_aViewData["edit"] = $oCategory; $this->_aViewData["oxid"] = $categoryId; if (isset($categoryId) && $categoryId != self::NEW_CATEGORY_ID) { // generating category tree for select list $this->_createCategoryTree("artcattree", $categoryId); // load object $oCategory->loadInLang($this->_iEditLang, $categoryId); //Disable editing for derived items if ($oCategory->isDerived()) { $this->_aViewData['readonly_fields'] = true; } $oOtherLang = $oCategory->getAvailableInLangs(); if (!isset($oOtherLang[$this->_iEditLang])) { // echo "language entry doesn't exist! using: ".key($oOtherLang); $oCategory->loadInLang(key($oOtherLang), $categoryId); } // remove already created languages $aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang); if (count($aLang)) { $this->_aViewData["posslang"] = $aLang; } foreach ($oOtherLang as $id => $language) { $oLang = new stdClass(); $oLang->sLangDesc = $language; $oLang->selected = ($id == $this->_iEditLang); $this->_aViewData["otherlang"][$id] = clone $oLang; } if ($oCategory->oxcategories__oxparentid->value == 'oxrootid') { $oCategory->oxcategories__oxparentid->setValue(''); } $this->_getCategoryTree("cattree", $oCategory->oxcategories__oxparentid->value, $oCategory->oxcategories__oxid->value, true, $oCategory->oxcategories__oxshopid->value); $this->_aViewData["defsort"] = $oCategory->oxcategories__oxdefsort->value; } else { $this->_createCategoryTree("cattree", "", true, $myConfig->getShopId()); } $this->_aViewData["sortableFields"] = $this->getSortableFields(); if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc")) { /** @var \OxidEsales\Eshop\Application\Controller\Admin\CategoryMainAjax $oCategoryMainAjax */ $oCategoryMainAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\CategoryMainAjax::class); $this->_aViewData['oxajax'] = $oCategoryMainAjax->getColumns(); return "popups/category_main.tpl"; } return "category_main.tpl"; }
php
public function render() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); parent::render(); /** @var \OxidEsales\Eshop\Application\Model\Category $oCategory */ $oCategory = $this->createCategory(); $categoryId = $this->getEditObjectId(); $this->_aViewData["edit"] = $oCategory; $this->_aViewData["oxid"] = $categoryId; if (isset($categoryId) && $categoryId != self::NEW_CATEGORY_ID) { // generating category tree for select list $this->_createCategoryTree("artcattree", $categoryId); // load object $oCategory->loadInLang($this->_iEditLang, $categoryId); //Disable editing for derived items if ($oCategory->isDerived()) { $this->_aViewData['readonly_fields'] = true; } $oOtherLang = $oCategory->getAvailableInLangs(); if (!isset($oOtherLang[$this->_iEditLang])) { // echo "language entry doesn't exist! using: ".key($oOtherLang); $oCategory->loadInLang(key($oOtherLang), $categoryId); } // remove already created languages $aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang); if (count($aLang)) { $this->_aViewData["posslang"] = $aLang; } foreach ($oOtherLang as $id => $language) { $oLang = new stdClass(); $oLang->sLangDesc = $language; $oLang->selected = ($id == $this->_iEditLang); $this->_aViewData["otherlang"][$id] = clone $oLang; } if ($oCategory->oxcategories__oxparentid->value == 'oxrootid') { $oCategory->oxcategories__oxparentid->setValue(''); } $this->_getCategoryTree("cattree", $oCategory->oxcategories__oxparentid->value, $oCategory->oxcategories__oxid->value, true, $oCategory->oxcategories__oxshopid->value); $this->_aViewData["defsort"] = $oCategory->oxcategories__oxdefsort->value; } else { $this->_createCategoryTree("cattree", "", true, $myConfig->getShopId()); } $this->_aViewData["sortableFields"] = $this->getSortableFields(); if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc")) { /** @var \OxidEsales\Eshop\Application\Controller\Admin\CategoryMainAjax $oCategoryMainAjax */ $oCategoryMainAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\CategoryMainAjax::class); $this->_aViewData['oxajax'] = $oCategoryMainAjax->getColumns(); return "popups/category_main.tpl"; } return "category_main.tpl"; }
[ "public", "function", "render", "(", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "parent", "::", "render", "(", ")", ";", "/** @var \\OxidEsales\\Eshop\\Application\\Model...
Loads article category data, passes it to Smarty engine, returns name of template file "category_main.tpl". @return string
[ "Loads", "article", "category", "data", "passes", "it", "to", "Smarty", "engine", "returns", "name", "of", "template", "file", "category_main", ".", "tpl", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/CategoryMain.php#L36-L103
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/CategoryMain.php
CategoryMain.getSortableFields
public function getSortableFields() { $aSkipFields = ["OXID", "OXSHOPID", "OXMAPID", "OXPARENTID", "OXACTIVE", "OXACTIVEFROM" , "OXACTIVETO", "OXSHORTDESC" , "OXUNITNAME", "OXUNITQUANTITY", "OXEXTURL", "OXURLDESC", "OXURLIMG", "OXVAT" , "OXTHUMB", "OXPIC1", "OXPIC2", "OXPIC3", "OXPIC4", "OXPIC5" , "OXPIC6", "OXPIC7", "OXPIC8", "OXPIC9", "OXPIC10", "OXPIC11", "OXPIC12", "OXSTOCKFLAG" , "OXSTOCKTEXT", "OXNOSTOCKTEXT", "OXDELIVERY", "OXFILE", "OXSEARCHKEYS", "OXTEMPLATE" , "OXQUESTIONEMAIL", "OXISSEARCH", "OXISCONFIGURABLE", "OXBUNDLEID", "OXFOLDER", "OXSUBCLASS" , "OXREMINDACTIVE", "OXREMINDAMOUNT", "OXVENDORID", "OXMANUFACTURERID", "OXSKIPDISCOUNTS" , "OXBLFIXEDPRICE", "OXICON", "OXVARSELECT", "OXAMITEMID", "OXAMTASKID", "OXPIXIEXPORT", "OXPIXIEXPORTED", "OXSORT" , "OXUPDATEPRICE", "OXUPDATEPRICEA", "OXUPDATEPRICEB", "OXUPDATEPRICEC", "OXUPDATEPRICETIME", "OXISDOWNLOADABLE" , "OXVARMAXPRICE", "OXSHOWCUSTOMAGREEMENT" ]; /** @var \OxidEsales\Eshop\Core\DbMetaDataHandler $oDbHandler */ $oDbHandler = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class); $aFields = array_merge($oDbHandler->getMultilangFields('oxarticles'), array_keys($oDbHandler->getSinglelangFields('oxarticles', 0))); $aFields = array_diff($aFields, $aSkipFields); $aFields = array_unique($aFields); return $aFields; }
php
public function getSortableFields() { $aSkipFields = ["OXID", "OXSHOPID", "OXMAPID", "OXPARENTID", "OXACTIVE", "OXACTIVEFROM" , "OXACTIVETO", "OXSHORTDESC" , "OXUNITNAME", "OXUNITQUANTITY", "OXEXTURL", "OXURLDESC", "OXURLIMG", "OXVAT" , "OXTHUMB", "OXPIC1", "OXPIC2", "OXPIC3", "OXPIC4", "OXPIC5" , "OXPIC6", "OXPIC7", "OXPIC8", "OXPIC9", "OXPIC10", "OXPIC11", "OXPIC12", "OXSTOCKFLAG" , "OXSTOCKTEXT", "OXNOSTOCKTEXT", "OXDELIVERY", "OXFILE", "OXSEARCHKEYS", "OXTEMPLATE" , "OXQUESTIONEMAIL", "OXISSEARCH", "OXISCONFIGURABLE", "OXBUNDLEID", "OXFOLDER", "OXSUBCLASS" , "OXREMINDACTIVE", "OXREMINDAMOUNT", "OXVENDORID", "OXMANUFACTURERID", "OXSKIPDISCOUNTS" , "OXBLFIXEDPRICE", "OXICON", "OXVARSELECT", "OXAMITEMID", "OXAMTASKID", "OXPIXIEXPORT", "OXPIXIEXPORTED", "OXSORT" , "OXUPDATEPRICE", "OXUPDATEPRICEA", "OXUPDATEPRICEB", "OXUPDATEPRICEC", "OXUPDATEPRICETIME", "OXISDOWNLOADABLE" , "OXVARMAXPRICE", "OXSHOWCUSTOMAGREEMENT" ]; /** @var \OxidEsales\Eshop\Core\DbMetaDataHandler $oDbHandler */ $oDbHandler = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class); $aFields = array_merge($oDbHandler->getMultilangFields('oxarticles'), array_keys($oDbHandler->getSinglelangFields('oxarticles', 0))); $aFields = array_diff($aFields, $aSkipFields); $aFields = array_unique($aFields); return $aFields; }
[ "public", "function", "getSortableFields", "(", ")", "{", "$", "aSkipFields", "=", "[", "\"OXID\"", ",", "\"OXSHOPID\"", ",", "\"OXMAPID\"", ",", "\"OXPARENTID\"", ",", "\"OXACTIVE\"", ",", "\"OXACTIVEFROM\"", ",", "\"OXACTIVETO\"", ",", "\"OXSHORTDESC\"", ",", "\...
Returns an array of article object DB fields, without multi language and unsortible fields. @return array
[ "Returns", "an", "array", "of", "article", "object", "DB", "fields", "without", "multi", "language", "and", "unsortible", "fields", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/CategoryMain.php#L110-L131
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/CategoryMain.php
CategoryMain.save
public function save() { parent::save(); $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $soxId = $this->getEditObjectId(); $aParams = $this->_parseRequestParametersForSave( $myConfig->getRequestParameter("editval") ); /** @var \OxidEsales\Eshop\Application\Model\Category $oCategory */ $oCategory = $this->createCategory(); if ($soxId != self::NEW_CATEGORY_ID) { $this->resetCounter("catArticle", $soxId); $this->resetCategoryPictures($oCategory, $aParams, $soxId); } //Disable editing for derived items if ($oCategory->isDerived()) { return; } $oCategory = $this->updateCategoryOnSave($oCategory, $aParams); $oCategory->save(); $this->setEditObjectId($oCategory->getId()); }
php
public function save() { parent::save(); $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $soxId = $this->getEditObjectId(); $aParams = $this->_parseRequestParametersForSave( $myConfig->getRequestParameter("editval") ); /** @var \OxidEsales\Eshop\Application\Model\Category $oCategory */ $oCategory = $this->createCategory(); if ($soxId != self::NEW_CATEGORY_ID) { $this->resetCounter("catArticle", $soxId); $this->resetCategoryPictures($oCategory, $aParams, $soxId); } //Disable editing for derived items if ($oCategory->isDerived()) { return; } $oCategory = $this->updateCategoryOnSave($oCategory, $aParams); $oCategory->save(); $this->setEditObjectId($oCategory->getId()); }
[ "public", "function", "save", "(", ")", "{", "parent", "::", "save", "(", ")", ";", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "soxId", "=", "$", "this", "->", "ge...
Saves article category data. @return mixed
[ "Saves", "article", "category", "data", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/CategoryMain.php#L138-L168
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/CategoryMain.php
CategoryMain.deletePicture
public function deletePicture() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if ($myConfig->isDemoShop()) { // disabling uploading pictures if this is demo shop $oEx = new \OxidEsales\Eshop\Core\Exception\ExceptionToDisplay(); $oEx->setMessage('CATEGORY_PICTURES_UPLOADISDISABLED'); /** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */ $oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView(); $oUtilsView->addErrorToDisplay($oEx, false); return; } $sOxId = $this->getEditObjectId(); $sField = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('masterPicField'); if (empty($sField)) { return; } /** @var \OxidEsales\Eshop\Application\Model\Category $oItem */ $oItem = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); $oItem->load($sOxId); $this->_deleteCatPicture($oItem, $sField); }
php
public function deletePicture() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if ($myConfig->isDemoShop()) { // disabling uploading pictures if this is demo shop $oEx = new \OxidEsales\Eshop\Core\Exception\ExceptionToDisplay(); $oEx->setMessage('CATEGORY_PICTURES_UPLOADISDISABLED'); /** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */ $oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView(); $oUtilsView->addErrorToDisplay($oEx, false); return; } $sOxId = $this->getEditObjectId(); $sField = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('masterPicField'); if (empty($sField)) { return; } /** @var \OxidEsales\Eshop\Application\Model\Category $oItem */ $oItem = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); $oItem->load($sOxId); $this->_deleteCatPicture($oItem, $sField); }
[ "public", "function", "deletePicture", "(", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "if", "(", "$", "myConfig", "->", "isDemoShop", "(", ")", ")", "{", "// dis...
Deletes selected master picture. @return null
[ "Deletes", "selected", "master", "picture", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/CategoryMain.php#L196-L223
train