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/ArticleExtendAjax.php
ArticleExtendAjax.removeCat
public function removeCat() { $categoriesToRemove = $this->_getActionIds('oxcategories.oxid'); $oxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid'); $dataBase = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $categoriesTable = $this->_getViewName('oxcategories'); $categoriesToRemove = $this->_getAll($this->_addFilter("select {$categoriesTable}.oxid " . $this->_getQuery())); } // removing all if (is_array($categoriesToRemove) && count($categoriesToRemove)) { $query = "delete from oxobject2category where oxobject2category.oxobjectid= " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($oxId) . " and "; $query = $this->updateQueryForRemovingArticleFromCategory($query); $query .= " oxcatnid in (" . implode(', ', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($categoriesToRemove)) . ')'; $dataBase->Execute($query); // updating oxtime values $this->_updateOxTime($oxId); } $this->resetArtSeoUrl($oxId, $categoriesToRemove); $this->resetContentCache(); $this->onCategoriesRemoval($categoriesToRemove, $oxId); }
php
public function removeCat() { $categoriesToRemove = $this->_getActionIds('oxcategories.oxid'); $oxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid'); $dataBase = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $categoriesTable = $this->_getViewName('oxcategories'); $categoriesToRemove = $this->_getAll($this->_addFilter("select {$categoriesTable}.oxid " . $this->_getQuery())); } // removing all if (is_array($categoriesToRemove) && count($categoriesToRemove)) { $query = "delete from oxobject2category where oxobject2category.oxobjectid= " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($oxId) . " and "; $query = $this->updateQueryForRemovingArticleFromCategory($query); $query .= " oxcatnid in (" . implode(', ', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($categoriesToRemove)) . ')'; $dataBase->Execute($query); // updating oxtime values $this->_updateOxTime($oxId); } $this->resetArtSeoUrl($oxId, $categoriesToRemove); $this->resetContentCache(); $this->onCategoriesRemoval($categoriesToRemove, $oxId); }
[ "public", "function", "removeCat", "(", ")", "{", "$", "categoriesToRemove", "=", "$", "this", "->", "_getActionIds", "(", "'oxcategories.oxid'", ")", ";", "$", "oxId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig"...
Removes article from chosen category
[ "Removes", "article", "from", "chosen", "category" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleExtendAjax.php#L112-L141
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleExtendAjax.php
ArticleExtendAjax.addCat
public function addCat() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $categoriesToAdd = $this->_getActionIds('oxcategories.oxid'); $oxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid'); $shopId = $config->getShopId(); $objectToCategoryView = $this->_getViewName('oxobject2category'); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $categoriesTable = $this->_getViewName('oxcategories'); $categoriesToAdd = $this->_getAll($this->_addFilter("select $categoriesTable.oxid " . $this->_getQuery())); } if (isset($categoriesToAdd) && is_array($categoriesToAdd)) { // 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(); $objectToCategory = oxNew(\OxidEsales\Eshop\Application\Model\Object2Category::class); foreach ($categoriesToAdd as $sAdd) { // check, if it's already in, then don't add it again $sSelect = "select 1 from " . $objectToCategoryView . " as oxobject2category where oxobject2category.oxcatnid= " . $database->quote($sAdd) . " and oxobject2category.oxobjectid = " . $database->quote($oxId) . " "; if ($database->getOne($sSelect)) { continue; } $objectToCategory->setId(md5($oxId . $sAdd . $shopId)); $objectToCategory->oxobject2category__oxobjectid = new \OxidEsales\Eshop\Core\Field($oxId); $objectToCategory->oxobject2category__oxcatnid = new \OxidEsales\Eshop\Core\Field($sAdd); $objectToCategory->oxobject2category__oxtime = new \OxidEsales\Eshop\Core\Field(time()); $objectToCategory->save(); } $this->_updateOxTime($oxId); $this->resetArtSeoUrl($oxId); $this->resetContentCache(); $this->onCategoriesAdd($categoriesToAdd); } }
php
public function addCat() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $categoriesToAdd = $this->_getActionIds('oxcategories.oxid'); $oxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid'); $shopId = $config->getShopId(); $objectToCategoryView = $this->_getViewName('oxobject2category'); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $categoriesTable = $this->_getViewName('oxcategories'); $categoriesToAdd = $this->_getAll($this->_addFilter("select $categoriesTable.oxid " . $this->_getQuery())); } if (isset($categoriesToAdd) && is_array($categoriesToAdd)) { // 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(); $objectToCategory = oxNew(\OxidEsales\Eshop\Application\Model\Object2Category::class); foreach ($categoriesToAdd as $sAdd) { // check, if it's already in, then don't add it again $sSelect = "select 1 from " . $objectToCategoryView . " as oxobject2category where oxobject2category.oxcatnid= " . $database->quote($sAdd) . " and oxobject2category.oxobjectid = " . $database->quote($oxId) . " "; if ($database->getOne($sSelect)) { continue; } $objectToCategory->setId(md5($oxId . $sAdd . $shopId)); $objectToCategory->oxobject2category__oxobjectid = new \OxidEsales\Eshop\Core\Field($oxId); $objectToCategory->oxobject2category__oxcatnid = new \OxidEsales\Eshop\Core\Field($sAdd); $objectToCategory->oxobject2category__oxtime = new \OxidEsales\Eshop\Core\Field(time()); $objectToCategory->save(); } $this->_updateOxTime($oxId); $this->resetArtSeoUrl($oxId); $this->resetContentCache(); $this->onCategoriesAdd($categoriesToAdd); } }
[ "public", "function", "addCat", "(", ")", "{", "$", "config", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "categoriesToAdd", "=", "$", "this", "->", "_getActionIds", "(", "'oxcategories.oxi...
Adds article to chosen category @throws Exception
[ "Adds", "article", "to", "chosen", "category" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleExtendAjax.php#L148-L190
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleExtendAjax.php
ArticleExtendAjax._updateOxTime
protected function _updateOxTime($oxId) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $objectToCategoryView = $this->_getViewName('oxobject2category'); $oxId = $database->quote($oxId); $queryToEmbed = $this->formQueryToEmbedForUpdatingTime(); // updating oxtime values $query = "update oxobject2category set oxtime = 0 where oxobjectid = {$oxId} {$queryToEmbed} and oxid = ( select oxid from ( select oxid from {$objectToCategoryView} where oxobjectid = {$oxId} {$queryToEmbed} order by oxtime limit 1 ) as _tmp )"; $database->execute($query); }
php
protected function _updateOxTime($oxId) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $objectToCategoryView = $this->_getViewName('oxobject2category'); $oxId = $database->quote($oxId); $queryToEmbed = $this->formQueryToEmbedForUpdatingTime(); // updating oxtime values $query = "update oxobject2category set oxtime = 0 where oxobjectid = {$oxId} {$queryToEmbed} and oxid = ( select oxid from ( select oxid from {$objectToCategoryView} where oxobjectid = {$oxId} {$queryToEmbed} order by oxtime limit 1 ) as _tmp )"; $database->execute($query); }
[ "protected", "function", "_updateOxTime", "(", "$", "oxId", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "objectToCategoryView", "=", "$", "this", "->", "_getV...
Updates oxtime value for product @param string $oxId product id
[ "Updates", "oxtime", "value", "for", "product" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleExtendAjax.php#L197-L211
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleExtendAjax.php
ArticleExtendAjax.setAsDefault
public function setAsDefault() { $defCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("defcat"); $oxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid"); $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $quotedOxId = $database->quote($oxId); $quotedDefCat = $database->quote($defCat); $queryToEmbed = $this->formQueryToEmbedForSettingCategoryAsDefault(); // #0003650: increment all product references independent to active shop $query = "update oxobject2category set oxtime = oxtime + 10 where oxobjectid = {$quotedOxId} {$queryToEmbed}"; \OxidEsales\Eshop\Core\DatabaseProvider::getInstance()->getDb()->Execute($query); // set main category for active shop $query = "update oxobject2category set oxtime = 0 where oxobjectid = {$quotedOxId} " . "and oxcatnid = {$quotedDefCat} {$queryToEmbed}"; \OxidEsales\Eshop\Core\DatabaseProvider::getInstance()->getDb()->Execute($query); //echo "\n$sQ\n"; // #0003366: invalidate article SEO for all shops \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->markAsExpired($oxId, null, 1, null, "oxtype='oxarticle'"); $this->resetContentCache(); }
php
public function setAsDefault() { $defCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("defcat"); $oxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid"); $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $quotedOxId = $database->quote($oxId); $quotedDefCat = $database->quote($defCat); $queryToEmbed = $this->formQueryToEmbedForSettingCategoryAsDefault(); // #0003650: increment all product references independent to active shop $query = "update oxobject2category set oxtime = oxtime + 10 where oxobjectid = {$quotedOxId} {$queryToEmbed}"; \OxidEsales\Eshop\Core\DatabaseProvider::getInstance()->getDb()->Execute($query); // set main category for active shop $query = "update oxobject2category set oxtime = 0 where oxobjectid = {$quotedOxId} " . "and oxcatnid = {$quotedDefCat} {$queryToEmbed}"; \OxidEsales\Eshop\Core\DatabaseProvider::getInstance()->getDb()->Execute($query); //echo "\n$sQ\n"; // #0003366: invalidate article SEO for all shops \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->markAsExpired($oxId, null, 1, null, "oxtype='oxarticle'"); $this->resetContentCache(); }
[ "public", "function", "setAsDefault", "(", ")", "{", "$", "defCat", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestParameter", "(", "\"defcat\"", ")", ";", "$", "oxId", "=", "\\", "Ox...
Sets selected category as a default
[ "Sets", "selected", "category", "as", "a", "default" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleExtendAjax.php#L216-L240
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/NewsletterSelection.php
NewsletterSelection.save
public function save() { $soxId = $this->getEditObjectId(); $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $aParams['oxnewsletter__oxshopid'] = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $oNewsletter = oxNew(\OxidEsales\Eshop\Application\Model\Newsletter::class); if ($soxId != "-1") { $oNewsletter->load($soxId); } else { $aParams['oxnewsletter__oxid'] = null; } $oNewsletter->assign($aParams); $oNewsletter->save(); // set oxid if inserted $this->setEditObjectId($oNewsletter->getId()); }
php
public function save() { $soxId = $this->getEditObjectId(); $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $aParams['oxnewsletter__oxshopid'] = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $oNewsletter = oxNew(\OxidEsales\Eshop\Application\Model\Newsletter::class); if ($soxId != "-1") { $oNewsletter->load($soxId); } else { $aParams['oxnewsletter__oxid'] = null; } $oNewsletter->assign($aParams); $oNewsletter->save(); // set oxid if inserted $this->setEditObjectId($oNewsletter->getId()); }
[ "public", "function", "save", "(", ")", "{", "$", "soxId", "=", "$", "this", "->", "getEditObjectId", "(", ")", ";", "$", "aParams", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestP...
Saves newsletter selection changes.
[ "Saves", "newsletter", "selection", "changes", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/NewsletterSelection.php#L110-L128
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/CategoryOrder.php
CategoryOrder.render
public function render() { parent::render(); $this->_aViewData['edit'] = $oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); // resetting \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('neworder_sess', null); $soxId = $this->getEditObjectId(); if (isset($soxId) && $soxId != "-1") { // load object $oCategory->load($soxId); //Disable editing for derived items if ($oCategory->isDerived()) { $this->_aViewData['readonly'] = true; } } if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc")) { $oCategoryOrderAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\CategoryOrderAjax::class); $this->_aViewData['oxajax'] = $oCategoryOrderAjax->getColumns(); return "popups/category_order.tpl"; } return "category_order.tpl"; }
php
public function render() { parent::render(); $this->_aViewData['edit'] = $oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); // resetting \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('neworder_sess', null); $soxId = $this->getEditObjectId(); if (isset($soxId) && $soxId != "-1") { // load object $oCategory->load($soxId); //Disable editing for derived items if ($oCategory->isDerived()) { $this->_aViewData['readonly'] = true; } } if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc")) { $oCategoryOrderAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\CategoryOrderAjax::class); $this->_aViewData['oxajax'] = $oCategoryOrderAjax->getColumns(); return "popups/category_order.tpl"; } return "category_order.tpl"; }
[ "public", "function", "render", "(", ")", "{", "parent", "::", "render", "(", ")", ";", "$", "this", "->", "_aViewData", "[", "'edit'", "]", "=", "$", "oCategory", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model"...
Loads article category ordering info, passes it to Smarty engine and returns name of template file "category_order.tpl". @return string
[ "Loads", "article", "category", "ordering", "info", "passes", "it", "to", "Smarty", "engine", "and", "returns", "name", "of", "template", "file", "category_order", ".", "tpl", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/CategoryOrder.php#L24-L52
train
OXID-eSales/oxideshop_ce
source/Internal/Module/Setup/Handler/ControllersModuleSettingHandler.php
ControllersModuleSettingHandler.controllerKeysToLowercase
private function controllerKeysToLowercase(array $controllers) : array { $result = []; foreach ($controllers as $controllerKey => $controllerClass) { $result[strtolower($controllerKey)] = $controllerClass; } return $result; }
php
private function controllerKeysToLowercase(array $controllers) : array { $result = []; foreach ($controllers as $controllerKey => $controllerClass) { $result[strtolower($controllerKey)] = $controllerClass; } return $result; }
[ "private", "function", "controllerKeysToLowercase", "(", "array", "$", "controllers", ")", ":", "array", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "controllers", "as", "$", "controllerKey", "=>", "$", "controllerClass", ")", "{", "$", "r...
Change the controller keys to lower case. @param array $controllers The controllers array of one module. @return array The given controllers array with the controller keys in lower case.
[ "Change", "the", "controller", "keys", "to", "lower", "case", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Module/Setup/Handler/ControllersModuleSettingHandler.php#L126-L135
train
OXID-eSales/oxideshop_ce
source/Application/Model/VendorList.php
VendorList.loadVendorList
public function loadVendorList() { $oBaseObject = $this->getBaseObject(); $sFieldList = $oBaseObject->getSelectFields(); $sViewName = $oBaseObject->getViewName(); $this->getBaseObject()->setShowArticleCnt($this->_blShowVendorArticleCnt); $sWhere = ''; if (!$this->isAdmin()) { $sWhere = $oBaseObject->getSqlActiveSnippet(); $sWhere = $sWhere ? " where $sWhere and " : ' where '; $sWhere .= "{$sViewName}.oxtitle != '' "; } $sSelect = "select {$sFieldList} from {$sViewName} {$sWhere} order by {$sViewName}.oxtitle"; $this->selectString($sSelect); }
php
public function loadVendorList() { $oBaseObject = $this->getBaseObject(); $sFieldList = $oBaseObject->getSelectFields(); $sViewName = $oBaseObject->getViewName(); $this->getBaseObject()->setShowArticleCnt($this->_blShowVendorArticleCnt); $sWhere = ''; if (!$this->isAdmin()) { $sWhere = $oBaseObject->getSqlActiveSnippet(); $sWhere = $sWhere ? " where $sWhere and " : ' where '; $sWhere .= "{$sViewName}.oxtitle != '' "; } $sSelect = "select {$sFieldList} from {$sViewName} {$sWhere} order by {$sViewName}.oxtitle"; $this->selectString($sSelect); }
[ "public", "function", "loadVendorList", "(", ")", "{", "$", "oBaseObject", "=", "$", "this", "->", "getBaseObject", "(", ")", ";", "$", "sFieldList", "=", "$", "oBaseObject", "->", "getSelectFields", "(", ")", ";", "$", "sViewName", "=", "$", "oBaseObject"...
Loads simple vendor list
[ "Loads", "simple", "vendor", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VendorList.php#L69-L85
train
OXID-eSales/oxideshop_ce
source/Application/Model/VendorList.php
VendorList.buildVendorTree
public function buildVendorTree($sLinkTarget, $sActCat, $sShopHomeUrl) { $sActCat = str_replace('v_', '', $sActCat); //Load vendor list $this->loadVendorList(); //Create fake vendor root category $this->_oRoot = oxNew(\OxidEsales\Eshop\Application\Model\Vendor::class); $this->_oRoot->load('root'); //category fields $this->_addCategoryFields($this->_oRoot); $this->_aPath[] = $this->_oRoot; foreach ($this as $sVndId => $oVendor) { // storing active vendor object if ($sVndId == $sActCat) { $this->setClickVendor($oVendor); } $this->_addCategoryFields($oVendor); if ($sActCat == $oVendor->oxvendor__oxid->value) { $this->_aPath[] = $oVendor; } } $this->_seoSetVendorData(); }
php
public function buildVendorTree($sLinkTarget, $sActCat, $sShopHomeUrl) { $sActCat = str_replace('v_', '', $sActCat); //Load vendor list $this->loadVendorList(); //Create fake vendor root category $this->_oRoot = oxNew(\OxidEsales\Eshop\Application\Model\Vendor::class); $this->_oRoot->load('root'); //category fields $this->_addCategoryFields($this->_oRoot); $this->_aPath[] = $this->_oRoot; foreach ($this as $sVndId => $oVendor) { // storing active vendor object if ($sVndId == $sActCat) { $this->setClickVendor($oVendor); } $this->_addCategoryFields($oVendor); if ($sActCat == $oVendor->oxvendor__oxid->value) { $this->_aPath[] = $oVendor; } } $this->_seoSetVendorData(); }
[ "public", "function", "buildVendorTree", "(", "$", "sLinkTarget", ",", "$", "sActCat", ",", "$", "sShopHomeUrl", ")", "{", "$", "sActCat", "=", "str_replace", "(", "'v_'", ",", "''", ",", "$", "sActCat", ")", ";", "//Load vendor list", "$", "this", "->", ...
Creates fake root for vendor tree, and ads category list fileds for each vendor item @param string $sLinkTarget Name of class, responsible for category rendering @param string $sActCat Active category @param string $sShopHomeUrl base shop url ($myConfig->getShopHomeUrl())
[ "Creates", "fake", "root", "for", "vendor", "tree", "and", "ads", "category", "list", "fileds", "for", "each", "vendor", "item" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VendorList.php#L94-L123
train
OXID-eSales/oxideshop_ce
source/Application/Model/VendorList.php
VendorList._addCategoryFields
protected function _addCategoryFields($oVendor) { $oVendor->oxcategories__oxid = new \OxidEsales\Eshop\Core\Field("v_" . $oVendor->oxvendor__oxid->value); $oVendor->oxcategories__oxicon = $oVendor->oxvendor__oxicon; $oVendor->oxcategories__oxtitle = $oVendor->oxvendor__oxtitle; $oVendor->oxcategories__oxdesc = $oVendor->oxvendor__oxshortdesc; $oVendor->setIsVisible(true); $oVendor->setHasVisibleSubCats(false); }
php
protected function _addCategoryFields($oVendor) { $oVendor->oxcategories__oxid = new \OxidEsales\Eshop\Core\Field("v_" . $oVendor->oxvendor__oxid->value); $oVendor->oxcategories__oxicon = $oVendor->oxvendor__oxicon; $oVendor->oxcategories__oxtitle = $oVendor->oxvendor__oxtitle; $oVendor->oxcategories__oxdesc = $oVendor->oxvendor__oxshortdesc; $oVendor->setIsVisible(true); $oVendor->setHasVisibleSubCats(false); }
[ "protected", "function", "_addCategoryFields", "(", "$", "oVendor", ")", "{", "$", "oVendor", "->", "oxcategories__oxid", "=", "new", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Field", "(", "\"v_\"", ".", "$", "oVendor", "->", "oxvendor__oxid", ...
Adds category specific fields to vendor object @param object $oVendor vendor object
[ "Adds", "category", "specific", "fields", "to", "vendor", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VendorList.php#L150-L159
train
OXID-eSales/oxideshop_ce
source/Application/Model/VendorList.php
VendorList._seoSetVendorData
protected function _seoSetVendorData() { // only when SEO id on and in front end if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive() && !$this->isAdmin()) { $oEncoder = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderVendor::class); // preparing root vendor category if ($this->_oRoot) { $oEncoder->getVendorUrl($this->_oRoot); } // encoding vendor category foreach ($this as $sVndId => $value) { $oEncoder->getVendorUrl($this->_aArray[$sVndId]); } } }
php
protected function _seoSetVendorData() { // only when SEO id on and in front end if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive() && !$this->isAdmin()) { $oEncoder = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderVendor::class); // preparing root vendor category if ($this->_oRoot) { $oEncoder->getVendorUrl($this->_oRoot); } // encoding vendor category foreach ($this as $sVndId => $value) { $oEncoder->getVendorUrl($this->_aArray[$sVndId]); } } }
[ "protected", "function", "_seoSetVendorData", "(", ")", "{", "// only when SEO id on and in front end", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getUtils", "(", ")", "->", "seoIsActive", "(", ")", "&&", "!", "$", "th...
Processes vendor category URLs
[ "Processes", "vendor", "category", "URLs" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VendorList.php#L184-L200
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.getCatArticleCount
public function getCatArticleCount($sCatId) { // current status unique ident $sActIdent = $this->_getUserViewId(); // loading from cache $aCatData = $this->_getCatCache(); if (!$aCatData || !isset($aCatData[$sCatId][$sActIdent])) { $iCnt = $this->setCatArticleCount($aCatData, $sCatId, $sActIdent); } else { $iCnt = $aCatData[$sCatId][$sActIdent]; } return $iCnt; }
php
public function getCatArticleCount($sCatId) { // current status unique ident $sActIdent = $this->_getUserViewId(); // loading from cache $aCatData = $this->_getCatCache(); if (!$aCatData || !isset($aCatData[$sCatId][$sActIdent])) { $iCnt = $this->setCatArticleCount($aCatData, $sCatId, $sActIdent); } else { $iCnt = $aCatData[$sCatId][$sActIdent]; } return $iCnt; }
[ "public", "function", "getCatArticleCount", "(", "$", "sCatId", ")", "{", "// current status unique ident", "$", "sActIdent", "=", "$", "this", "->", "_getUserViewId", "(", ")", ";", "// loading from cache", "$", "aCatData", "=", "$", "this", "->", "_getCatCache",...
Returns category article count @param string $sCatId Category Id @return int
[ "Returns", "category", "article", "count" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L28-L43
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.getPriceCatArticleCount
public function getPriceCatArticleCount($sCatId, $dPriceFrom, $dPriceTo) { // current status unique ident $sActIdent = $this->_getUserViewId(); // loading from cache $aCatData = $this->_getCatCache(); if (!$aCatData || !isset($aCatData[$sCatId][$sActIdent])) { $iCnt = $this->setPriceCatArticleCount($aCatData, $sCatId, $sActIdent, $dPriceFrom, $dPriceTo); } else { $iCnt = $aCatData[$sCatId][$sActIdent]; } return $iCnt; }
php
public function getPriceCatArticleCount($sCatId, $dPriceFrom, $dPriceTo) { // current status unique ident $sActIdent = $this->_getUserViewId(); // loading from cache $aCatData = $this->_getCatCache(); if (!$aCatData || !isset($aCatData[$sCatId][$sActIdent])) { $iCnt = $this->setPriceCatArticleCount($aCatData, $sCatId, $sActIdent, $dPriceFrom, $dPriceTo); } else { $iCnt = $aCatData[$sCatId][$sActIdent]; } return $iCnt; }
[ "public", "function", "getPriceCatArticleCount", "(", "$", "sCatId", ",", "$", "dPriceFrom", ",", "$", "dPriceTo", ")", "{", "// current status unique ident", "$", "sActIdent", "=", "$", "this", "->", "_getUserViewId", "(", ")", ";", "// loading from cache", "$", ...
Returns category article count price @param string $sCatId Category Id @param double $dPriceFrom from price @param double $dPriceTo to price @return int
[ "Returns", "category", "article", "count", "price" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L54-L69
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.getVendorArticleCount
public function getVendorArticleCount($sVendorId) { // current category unique ident $sActIdent = $this->_getUserViewId(); // loading from cache $aVendorData = $this->_getVendorCache(); if (!$aVendorData || !isset($aVendorData[$sVendorId][$sActIdent])) { $iCnt = $this->setVendorArticleCount($aVendorData, $sVendorId, $sActIdent); } else { $iCnt = $aVendorData[$sVendorId][$sActIdent]; } return $iCnt; }
php
public function getVendorArticleCount($sVendorId) { // current category unique ident $sActIdent = $this->_getUserViewId(); // loading from cache $aVendorData = $this->_getVendorCache(); if (!$aVendorData || !isset($aVendorData[$sVendorId][$sActIdent])) { $iCnt = $this->setVendorArticleCount($aVendorData, $sVendorId, $sActIdent); } else { $iCnt = $aVendorData[$sVendorId][$sActIdent]; } return $iCnt; }
[ "public", "function", "getVendorArticleCount", "(", "$", "sVendorId", ")", "{", "// current category unique ident", "$", "sActIdent", "=", "$", "this", "->", "_getUserViewId", "(", ")", ";", "// loading from cache", "$", "aVendorData", "=", "$", "this", "->", "_ge...
Returns vendor article count @param string $sVendorId Vendor category Id @return int
[ "Returns", "vendor", "article", "count" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L78-L93
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.getManufacturerArticleCount
public function getManufacturerArticleCount($sManufacturerId) { // current category unique ident $sActIdent = $this->_getUserViewId(); // loading from cache $aManufacturerData = $this->_getManufacturerCache(); if (!$aManufacturerData || !isset($aManufacturerData[$sManufacturerId][$sActIdent])) { $iCnt = $this->setManufacturerArticleCount($aManufacturerData, $sManufacturerId, $sActIdent); } else { $iCnt = $aManufacturerData[$sManufacturerId][$sActIdent]; } return $iCnt; }
php
public function getManufacturerArticleCount($sManufacturerId) { // current category unique ident $sActIdent = $this->_getUserViewId(); // loading from cache $aManufacturerData = $this->_getManufacturerCache(); if (!$aManufacturerData || !isset($aManufacturerData[$sManufacturerId][$sActIdent])) { $iCnt = $this->setManufacturerArticleCount($aManufacturerData, $sManufacturerId, $sActIdent); } else { $iCnt = $aManufacturerData[$sManufacturerId][$sActIdent]; } return $iCnt; }
[ "public", "function", "getManufacturerArticleCount", "(", "$", "sManufacturerId", ")", "{", "// current category unique ident", "$", "sActIdent", "=", "$", "this", "->", "_getUserViewId", "(", ")", ";", "// loading from cache", "$", "aManufacturerData", "=", "$", "thi...
Returns Manufacturer article count @param string $sManufacturerId Manufacturer category Id @return int
[ "Returns", "Manufacturer", "article", "count" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L102-L116
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.setCatArticleCount
public function setCatArticleCount($aCache, $sCatId, $sActIdent) { $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $sTable = $oArticle->getViewName(); $sO2CView = getViewName('oxobject2category'); $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); // we use distinct if article is assigned to category twice $sQ = "SELECT COUNT( DISTINCT $sTable.`oxid` ) FROM $sO2CView INNER JOIN $sTable ON $sO2CView.`oxobjectid` = $sTable.`oxid` AND $sTable.`oxparentid` = '' WHERE $sO2CView.`oxcatnid` = " . $oDb->quote($sCatId) . " AND " . $oArticle->getSqlActiveSnippet(); $aCache[$sCatId][$sActIdent] = $oDb->getOne($sQ); $this->_setCatCache($aCache); return $aCache[$sCatId][$sActIdent]; }
php
public function setCatArticleCount($aCache, $sCatId, $sActIdent) { $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $sTable = $oArticle->getViewName(); $sO2CView = getViewName('oxobject2category'); $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); // we use distinct if article is assigned to category twice $sQ = "SELECT COUNT( DISTINCT $sTable.`oxid` ) FROM $sO2CView INNER JOIN $sTable ON $sO2CView.`oxobjectid` = $sTable.`oxid` AND $sTable.`oxparentid` = '' WHERE $sO2CView.`oxcatnid` = " . $oDb->quote($sCatId) . " AND " . $oArticle->getSqlActiveSnippet(); $aCache[$sCatId][$sActIdent] = $oDb->getOne($sQ); $this->_setCatCache($aCache); return $aCache[$sCatId][$sActIdent]; }
[ "public", "function", "setCatArticleCount", "(", "$", "aCache", ",", "$", "sCatId", ",", "$", "sActIdent", ")", "{", "$", "oArticle", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "Article", "::", "class", ...
Saves and returns category article count into cache @param array $aCache Category cache data @param string $sCatId Unique category identifier @param string $sActIdent ID @return int
[ "Saves", "and", "returns", "category", "article", "count", "into", "cache" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L127-L145
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.setVendorArticleCount
public function setVendorArticleCount($aCache, $sCatId, $sActIdent) { // if vendor/category name is 'root', skip counting if ($sCatId == 'root') { return 0; } $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $sTable = $oArticle->getViewName(); // select each vendor articles count $sQ = "select $sTable.oxvendorid AS vendorId, count(*) from $sTable where "; $sQ .= "$sTable.oxvendorid <> '' and $sTable.oxparentid = '' and " . $oArticle->getSqlActiveSnippet() . " group by $sTable.oxvendorid "; $aDbResult = $this->getAssoc($sQ); foreach ($aDbResult as $sKey => $sValue) { $aCache[$sKey][$sActIdent] = $sValue; } $this->_setVendorCache($aCache); return isset($aCache[$sCatId][$sActIdent]) ? $aCache[$sCatId][$sActIdent] : 0; }
php
public function setVendorArticleCount($aCache, $sCatId, $sActIdent) { // if vendor/category name is 'root', skip counting if ($sCatId == 'root') { return 0; } $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $sTable = $oArticle->getViewName(); // select each vendor articles count $sQ = "select $sTable.oxvendorid AS vendorId, count(*) from $sTable where "; $sQ .= "$sTable.oxvendorid <> '' and $sTable.oxparentid = '' and " . $oArticle->getSqlActiveSnippet() . " group by $sTable.oxvendorid "; $aDbResult = $this->getAssoc($sQ); foreach ($aDbResult as $sKey => $sValue) { $aCache[$sKey][$sActIdent] = $sValue; } $this->_setVendorCache($aCache); return isset($aCache[$sCatId][$sActIdent]) ? $aCache[$sCatId][$sActIdent] : 0; }
[ "public", "function", "setVendorArticleCount", "(", "$", "aCache", ",", "$", "sCatId", ",", "$", "sActIdent", ")", "{", "// if vendor/category name is 'root', skip counting", "if", "(", "$", "sCatId", "==", "'root'", ")", "{", "return", "0", ";", "}", "$", "oA...
Saves and returns vendors category article count into cache @param array $aCache Category cache data @param string $sCatId Unique vendor category ident @param string $sActIdent Vendor category ID @return int
[ "Saves", "and", "returns", "vendors", "category", "article", "count", "into", "cache" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L184-L206
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.getAssoc
protected function getAssoc($query, $parameters = []) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $resultSet = $database->select($query, $parameters); $rows = $resultSet->fetchAll(); if (!$rows) { return []; } $result = []; foreach ($rows as $row) { $firstColumn = array_keys($row)[0]; $key = $row[$firstColumn]; $values = array_values($row); if (2 <= count($values)) { $result[$key] = $values[1]; } } return $result; }
php
protected function getAssoc($query, $parameters = []) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $resultSet = $database->select($query, $parameters); $rows = $resultSet->fetchAll(); if (!$rows) { return []; } $result = []; foreach ($rows as $row) { $firstColumn = array_keys($row)[0]; $key = $row[$firstColumn]; $values = array_values($row); if (2 <= count($values)) { $result[$key] = $values[1]; } } return $result; }
[ "protected", "function", "getAssoc", "(", "$", "query", ",", "$", "parameters", "=", "[", "]", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", "\\", "OxidEsales", "\\", "Eshop...
Returns the query result as a two dimensional associative array. The keys of the first level are the firsts value of each row. The values of the first level arrays with numeric key that hold the all the values of each row but the first one, which is used a a key in the first level. @param string $query @param array $parameters @return array
[ "Returns", "the", "query", "result", "as", "a", "two", "dimensional", "associative", "array", ".", "The", "keys", "of", "the", "first", "level", "are", "the", "firsts", "value", "of", "each", "row", ".", "The", "values", "of", "the", "first", "level", "a...
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L219-L245
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.setManufacturerArticleCount
public function setManufacturerArticleCount($aCache, $sMnfId, $sActIdent) { // if Manufacturer/category name is 'root', skip counting if ($sMnfId == 'root') { return 0; } $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $sArtTable = $oArticle->getViewName(); // select each Manufacturer articles count //#3485 $sQ = "select count($sArtTable.oxid) from $sArtTable where $sArtTable.oxparentid = '' and oxmanufacturerid = '$sMnfId' and " . $oArticle->getSqlActiveSnippet(); $iValue = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sQ); $aCache[$sMnfId][$sActIdent] = (int) $iValue; $this->_setManufacturerCache($aCache); return $aCache[$sMnfId][$sActIdent]; }
php
public function setManufacturerArticleCount($aCache, $sMnfId, $sActIdent) { // if Manufacturer/category name is 'root', skip counting if ($sMnfId == 'root') { return 0; } $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $sArtTable = $oArticle->getViewName(); // select each Manufacturer articles count //#3485 $sQ = "select count($sArtTable.oxid) from $sArtTable where $sArtTable.oxparentid = '' and oxmanufacturerid = '$sMnfId' and " . $oArticle->getSqlActiveSnippet(); $iValue = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sQ); $aCache[$sMnfId][$sActIdent] = (int) $iValue; $this->_setManufacturerCache($aCache); return $aCache[$sMnfId][$sActIdent]; }
[ "public", "function", "setManufacturerArticleCount", "(", "$", "aCache", ",", "$", "sMnfId", ",", "$", "sActIdent", ")", "{", "// if Manufacturer/category name is 'root', skip counting", "if", "(", "$", "sMnfId", "==", "'root'", ")", "{", "return", "0", ";", "}", ...
Saves and returns Manufacturers category article count into cache @param array $aCache Category cache data @param string $sMnfId Unique Manufacturer ident @param string $sActIdent Unique user context ID @return int
[ "Saves", "and", "returns", "Manufacturers", "category", "article", "count", "into", "cache" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L256-L277
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount.resetPriceCatArticleCount
public function resetPriceCatArticleCount($iPrice) { // loading from cache if ($aCatData = $this->_getCatCache()) { $sTable = getViewName('oxcategories'); $sSelect = "select $sTable.oxid from $sTable where " . (double) $iPrice . " >= $sTable.oxpricefrom and " . (double) $iPrice . " <= $sTable.oxpriceto "; // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $rs = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster()->select($sSelect, false); if ($rs != false && $rs->count() > 0) { while (!$rs->EOF) { if (isset($aCatData[$rs->fields[0]])) { unset($aCatData[$rs->fields[0]]); } $rs->fetchRow(); } // writing back to cache $this->_setCatCache($aCatData); } } }
php
public function resetPriceCatArticleCount($iPrice) { // loading from cache if ($aCatData = $this->_getCatCache()) { $sTable = getViewName('oxcategories'); $sSelect = "select $sTable.oxid from $sTable where " . (double) $iPrice . " >= $sTable.oxpricefrom and " . (double) $iPrice . " <= $sTable.oxpriceto "; // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $rs = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster()->select($sSelect, false); if ($rs != false && $rs->count() > 0) { while (!$rs->EOF) { if (isset($aCatData[$rs->fields[0]])) { unset($aCatData[$rs->fields[0]]); } $rs->fetchRow(); } // writing back to cache $this->_setCatCache($aCatData); } } }
[ "public", "function", "resetPriceCatArticleCount", "(", "$", "iPrice", ")", "{", "// loading from cache", "if", "(", "$", "aCatData", "=", "$", "this", "->", "_getCatCache", "(", ")", ")", "{", "$", "sTable", "=", "getViewName", "(", "'oxcategories'", ")", "...
Resets price categories article count @param int $iPrice article price
[ "Resets", "price", "categories", "article", "count" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L304-L325
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount._getCatCache
protected function _getCatCache() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // first look at the local cache $aLocalCatCache = $myConfig->getGlobalParameter('aLocalCatCache'); // if local cache is not set - loading from file cache if (!$aLocalCatCache) { $sLocalCatCache = \OxidEsales\Eshop\Core\Registry::getUtils()->fromFileCache('aLocalCatCache'); if ($sLocalCatCache) { $aLocalCatCache = $sLocalCatCache; } else { $aLocalCatCache = null; } $myConfig->setGlobalParameter('aLocalCatCache', $aLocalCatCache); } return $aLocalCatCache; }
php
protected function _getCatCache() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // first look at the local cache $aLocalCatCache = $myConfig->getGlobalParameter('aLocalCatCache'); // if local cache is not set - loading from file cache if (!$aLocalCatCache) { $sLocalCatCache = \OxidEsales\Eshop\Core\Registry::getUtils()->fromFileCache('aLocalCatCache'); if ($sLocalCatCache) { $aLocalCatCache = $sLocalCatCache; } else { $aLocalCatCache = null; } $myConfig->setGlobalParameter('aLocalCatCache', $aLocalCatCache); } return $aLocalCatCache; }
[ "protected", "function", "_getCatCache", "(", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "// first look at the local cache", "$", "aLocalCatCache", "=", "$", "myConfig", ...
Loads and returns category cache data array @return array
[ "Loads", "and", "returns", "category", "cache", "data", "array" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L372-L391
train
OXID-eSales/oxideshop_ce
source/Core/UtilsCount.php
UtilsCount._setCatCache
protected function _setCatCache($aCache) { \OxidEsales\Eshop\Core\Registry::getConfig()->setGlobalParameter('aLocalCatCache', $aCache); \OxidEsales\Eshop\Core\Registry::getUtils()->toFileCache('aLocalCatCache', $aCache); }
php
protected function _setCatCache($aCache) { \OxidEsales\Eshop\Core\Registry::getConfig()->setGlobalParameter('aLocalCatCache', $aCache); \OxidEsales\Eshop\Core\Registry::getUtils()->toFileCache('aLocalCatCache', $aCache); }
[ "protected", "function", "_setCatCache", "(", "$", "aCache", ")", "{", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "setGlobalParameter", "(", "'aLocalCatCache'", ",", "$", "aCache", ")", ";", "\\", ...
Writes category data into cache @param array $aCache A cacheable data
[ "Writes", "category", "data", "into", "cache" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsCount.php#L398-L402
train
OXID-eSales/oxideshop_ce
source/Core/Counter.php
Counter.getNext
public function getNext($ident) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); /** Current counter retrieval needs to be encapsulated in transaction */ $database->startTransaction(); try { /** Block row for reading until the counter is updated */ $query = "SELECT `oxcount` FROM `oxcounters` WHERE `oxident` = ? FOR UPDATE"; $currentCounter = (int) $database->getOne($query, [$ident]); $nextCounter = $currentCounter + 1; /** Insert or increment the the counter */ $query = "INSERT INTO `oxcounters` (`oxident`, `oxcount`) VALUES (?, 1) ON DUPLICATE KEY UPDATE `oxcount` = `oxcount` + 1"; $database->execute($query, [$ident]); $database->commitTransaction(); } catch (Exception $exception) { $database->rollbackTransaction(); throw $exception; } return $nextCounter; }
php
public function getNext($ident) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); /** Current counter retrieval needs to be encapsulated in transaction */ $database->startTransaction(); try { /** Block row for reading until the counter is updated */ $query = "SELECT `oxcount` FROM `oxcounters` WHERE `oxident` = ? FOR UPDATE"; $currentCounter = (int) $database->getOne($query, [$ident]); $nextCounter = $currentCounter + 1; /** Insert or increment the the counter */ $query = "INSERT INTO `oxcounters` (`oxident`, `oxcount`) VALUES (?, 1) ON DUPLICATE KEY UPDATE `oxcount` = `oxcount` + 1"; $database->execute($query, [$ident]); $database->commitTransaction(); } catch (Exception $exception) { $database->rollbackTransaction(); throw $exception; } return $nextCounter; }
[ "public", "function", "getNext", "(", "$", "ident", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "/** Current counter retrieval needs to be encapsulated in transaction */", "...
Return the next counter value for a given type of counter @param string $ident Identifies the type of counter. E.g. 'oxOrder' @throws Exception @return int Next counter value
[ "Return", "the", "next", "counter", "value", "for", "a", "given", "type", "of", "counter" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Counter.php#L26-L50
train
OXID-eSales/oxideshop_ce
source/Core/Counter.php
Counter.update
public function update($ident, $count) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); /** Current counter retrieval needs to be encapsulated in transaction */ $database->startTransaction(); try { /** Block row for reading until the counter is updated */ $query = "SELECT `oxcount` FROM `oxcounters` WHERE `oxident` = ? FOR UPDATE"; $database->getOne($query, [$ident]); /** Insert or update the counter, if the value to be updated is greater, than the current value */ $query = "INSERT INTO `oxcounters` (`oxident`, `oxcount`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `oxcount` = IF(? > oxcount, ?, oxcount)"; $result = $database->execute($query, [$ident, $count, $count, $count ]); $database->commitTransaction(); } catch (Exception $exception) { $database->rollbackTransaction(); throw $exception; } return $result; }
php
public function update($ident, $count) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); /** Current counter retrieval needs to be encapsulated in transaction */ $database->startTransaction(); try { /** Block row for reading until the counter is updated */ $query = "SELECT `oxcount` FROM `oxcounters` WHERE `oxident` = ? FOR UPDATE"; $database->getOne($query, [$ident]); /** Insert or update the counter, if the value to be updated is greater, than the current value */ $query = "INSERT INTO `oxcounters` (`oxident`, `oxcount`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `oxcount` = IF(? > oxcount, ?, oxcount)"; $result = $database->execute($query, [$ident, $count, $count, $count ]); $database->commitTransaction(); } catch (Exception $exception) { $database->rollbackTransaction(); throw $exception; } return $result; }
[ "public", "function", "update", "(", "$", "ident", ",", "$", "count", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "/** Current counter retrieval needs to be encapsulated...
Update the counter value for a given type of counter, but only when it is greater than the current value @param string $ident Identifies the type of counter. E.g. 'oxOrder' @param integer $count New counter value @throws Exception @return int Number of affected rows
[ "Update", "the", "counter", "value", "for", "a", "given", "type", "of", "counter", "but", "only", "when", "it", "is", "greater", "than", "the", "current", "value" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Counter.php#L62-L85
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.render
public function render() { parent::render(); $oSmarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty(); // #2873: In demoshop for RSS we set php_handling to SMARTY_PHP_PASSTHRU // as SMARTY_PHP_REMOVE removes not only php tags, but also xml if (\OxidEsales\Eshop\Core\Registry::getConfig()->isDemoShop()) { $oSmarty->php_handling = SMARTY_PHP_PASSTHRU; } foreach (array_keys($this->_aViewData) as $sViewName) { $oSmarty->assign($sViewName, $this->_aViewData[$sViewName]); } // return rss xml, no further processing $sCharset = \OxidEsales\Eshop\Core\Registry::getLang()->translateString("charset"); \OxidEsales\Eshop\Core\Registry::getUtils()->setHeader("Content-Type: text/xml; charset=" . $sCharset); \OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit( $this->_processOutput( $oSmarty->fetch($this->_sThisTemplate, $this->getViewId()) ) ); }
php
public function render() { parent::render(); $oSmarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty(); // #2873: In demoshop for RSS we set php_handling to SMARTY_PHP_PASSTHRU // as SMARTY_PHP_REMOVE removes not only php tags, but also xml if (\OxidEsales\Eshop\Core\Registry::getConfig()->isDemoShop()) { $oSmarty->php_handling = SMARTY_PHP_PASSTHRU; } foreach (array_keys($this->_aViewData) as $sViewName) { $oSmarty->assign($sViewName, $this->_aViewData[$sViewName]); } // return rss xml, no further processing $sCharset = \OxidEsales\Eshop\Core\Registry::getLang()->translateString("charset"); \OxidEsales\Eshop\Core\Registry::getUtils()->setHeader("Content-Type: text/xml; charset=" . $sCharset); \OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit( $this->_processOutput( $oSmarty->fetch($this->_sThisTemplate, $this->getViewId()) ) ); }
[ "public", "function", "render", "(", ")", "{", "parent", "::", "render", "(", ")", ";", "$", "oSmarty", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getUtilsView", "(", ")", "->", "getSmarty", "(", ")", ";", "// #2873:...
Renders requested RSS feed Template variables: <b>rss</b>
[ "Renders", "requested", "RSS", "feed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L66-L90
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.topshop
public function topshop() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssTopShop')) { $this->_getRssFeed()->loadTopInShop(); } else { error_404_handler(); } }
php
public function topshop() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssTopShop')) { $this->_getRssFeed()->loadTopInShop(); } else { error_404_handler(); } }
[ "public", "function", "topshop", "(", ")", "{", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'bl_rssTopShop'", ")", ")", "{", "$", "this", "->", "_getRssFeed", "(...
getTopShop loads top shop articles to rss @access public
[ "getTopShop", "loads", "top", "shop", "articles", "to", "rss" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L109-L116
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.newarts
public function newarts() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssNewest')) { $this->_getRssFeed()->loadNewestArticles(); } else { error_404_handler(); } }
php
public function newarts() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssNewest')) { $this->_getRssFeed()->loadNewestArticles(); } else { error_404_handler(); } }
[ "public", "function", "newarts", "(", ")", "{", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'bl_rssNewest'", ")", ")", "{", "$", "this", "->", "_getRssFeed", "("...
loads newest shop articles @access public
[ "loads", "newest", "shop", "articles" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L123-L130
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.catarts
public function catarts() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssCategories')) { $oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); if ($oCat->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cat'))) { $this->_getRssFeed()->loadCategoryArticles($oCat); } } else { error_404_handler(); } }
php
public function catarts() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssCategories')) { $oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class); if ($oCat->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cat'))) { $this->_getRssFeed()->loadCategoryArticles($oCat); } } else { error_404_handler(); } }
[ "public", "function", "catarts", "(", ")", "{", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'bl_rssCategories'", ")", ")", "{", "$", "oCat", "=", "oxNew", "(", ...
loads category articles @access public
[ "loads", "category", "articles" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L137-L147
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.searcharts
public function searcharts() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssSearch')) { $sSearchParameter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam', true); $sCatId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchcnid'); $sVendorId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchvendor'); $sManufacturerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchmanufacturer'); $this->_getRssFeed()->loadSearchArticles($sSearchParameter, $sCatId, $sVendorId, $sManufacturerId); } else { error_404_handler(); } }
php
public function searcharts() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssSearch')) { $sSearchParameter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam', true); $sCatId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchcnid'); $sVendorId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchvendor'); $sManufacturerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchmanufacturer'); $this->_getRssFeed()->loadSearchArticles($sSearchParameter, $sCatId, $sVendorId, $sManufacturerId); } else { error_404_handler(); } }
[ "public", "function", "searcharts", "(", ")", "{", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'bl_rssSearch'", ")", ")", "{", "$", "sSearchParameter", "=", "\\", ...
loads search articles @access public
[ "loads", "search", "articles" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L154-L166
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.recommlists
public function recommlists() { if ($this->getViewConfig()->getShowListmania() && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssRecommLists')) { $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if ($oArticle->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid'))) { $this->_getRssFeed()->loadRecommLists($oArticle); return; } } error_404_handler(); }
php
public function recommlists() { if ($this->getViewConfig()->getShowListmania() && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssRecommLists')) { $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if ($oArticle->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid'))) { $this->_getRssFeed()->loadRecommLists($oArticle); return; } } error_404_handler(); }
[ "public", "function", "recommlists", "(", ")", "{", "if", "(", "$", "this", "->", "getViewConfig", "(", ")", "->", "getShowListmania", "(", ")", "&&", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", ...
loads recommendation lists @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. @access public @return void
[ "loads", "recommendation", "lists" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L176-L187
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.recommlistarts
public function recommlistarts() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssRecommListArts')) { $oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class); if ($oRecommList->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommid'))) { $this->_getRssFeed()->loadRecommListArticles($oRecommList); return; } } error_404_handler(); }
php
public function recommlistarts() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssRecommListArts')) { $oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class); if ($oRecommList->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommid'))) { $this->_getRssFeed()->loadRecommListArticles($oRecommList); return; } } error_404_handler(); }
[ "public", "function", "recommlistarts", "(", ")", "{", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'bl_rssRecommListArts'", ")", ")", "{", "$", "oRecommList", "=", ...
loads recommendation list articles @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. @access public @return void
[ "loads", "recommendation", "list", "articles" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L197-L208
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.bargain
public function bargain() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssBargain')) { $this->_getRssFeed()->loadBargain(); } else { error_404_handler(); } }
php
public function bargain() { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_rssBargain')) { $this->_getRssFeed()->loadBargain(); } else { error_404_handler(); } }
[ "public", "function", "bargain", "(", ")", "{", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'bl_rssBargain'", ")", ")", "{", "$", "this", "->", "_getRssFeed", "(...
getBargain loads top shop articles to rss @access public
[ "getBargain", "loads", "top", "shop", "articles", "to", "rss" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L215-L222
train
OXID-eSales/oxideshop_ce
source/Application/Controller/RssController.php
RssController.getChannel
public function getChannel() { if ($this->_oChannel === null) { $this->_oChannel = $this->_getRssFeed()->getChannel(); } return $this->_oChannel; }
php
public function getChannel() { if ($this->_oChannel === null) { $this->_oChannel = $this->_getRssFeed()->getChannel(); } return $this->_oChannel; }
[ "public", "function", "getChannel", "(", ")", "{", "if", "(", "$", "this", "->", "_oChannel", "===", "null", ")", "{", "$", "this", "->", "_oChannel", "=", "$", "this", "->", "_getRssFeed", "(", ")", "->", "getChannel", "(", ")", ";", "}", "return", ...
Template variable getter. Returns rss channel @return object
[ "Template", "variable", "getter", ".", "Returns", "rss", "channel" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/RssController.php#L229-L236
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/AttributeMain.php
AttributeMain.render
public function render() { parent::render(); $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oAttr = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class); $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId(); // copy this tree for our article choose if (isset($soxId) && $soxId != "-1") { // generating category tree for select list $this->_createCategoryTree("artcattree", $soxId); // load object $oAttr->loadInLang($this->_iEditLang, $soxId); //Disable editing for derived items if ($oAttr->isDerived()) { $this->_aViewData['readonly'] = true; } $oOtherLang = $oAttr->getAvailableInLangs(); if (!isset($oOtherLang[$this->_iEditLang])) { // echo "language entry doesn't exist! using: ".key($oOtherLang); $oAttr->loadInLang(key($oOtherLang), $soxId); } // 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; } } $this->_aViewData["edit"] = $oAttr; if ($myConfig->getRequestParameter("aoc")) { $oAttributeMainAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\AttributeMainAjax::class); $this->_aViewData['oxajax'] = $oAttributeMainAjax->getColumns(); return "popups/attribute_main.tpl"; } return "attribute_main.tpl"; }
php
public function render() { parent::render(); $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oAttr = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class); $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId(); // copy this tree for our article choose if (isset($soxId) && $soxId != "-1") { // generating category tree for select list $this->_createCategoryTree("artcattree", $soxId); // load object $oAttr->loadInLang($this->_iEditLang, $soxId); //Disable editing for derived items if ($oAttr->isDerived()) { $this->_aViewData['readonly'] = true; } $oOtherLang = $oAttr->getAvailableInLangs(); if (!isset($oOtherLang[$this->_iEditLang])) { // echo "language entry doesn't exist! using: ".key($oOtherLang); $oAttr->loadInLang(key($oOtherLang), $soxId); } // 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; } } $this->_aViewData["edit"] = $oAttr; if ($myConfig->getRequestParameter("aoc")) { $oAttributeMainAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\AttributeMainAjax::class); $this->_aViewData['oxajax'] = $oAttributeMainAjax->getColumns(); return "popups/attribute_main.tpl"; } return "attribute_main.tpl"; }
[ "public", "function", "render", "(", ")", "{", "parent", "::", "render", "(", ")", ";", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "oAttr", "=", "oxNew", "(", "\\", ...
Loads article Attributes info, passes it to Smarty engine and returns name of template file "attribute_main.tpl". @return string
[ "Loads", "article", "Attributes", "info", "passes", "it", "to", "Smarty", "engine", "and", "returns", "name", "of", "template", "file", "attribute_main", ".", "tpl", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/AttributeMain.php#L26-L77
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/DiscountItemAjax.php
DiscountItemAjax._getQueryCols
protected function _getQueryCols() { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $sLangTag = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageTag(); $sQ = ''; $blSep = false; $aVisiblecols = $this->_getVisibleColNames(); foreach ($aVisiblecols as $iCnt => $aCol) { if ($blSep) { $sQ .= ', '; } $sViewTable = $this->_getViewName($aCol[1]); // multilanguage $sCol = $aCol[0]; if ($oConfig->getConfigParam('blVariantsSelection') && $aCol[0] == 'oxtitle') { $sVarSelect = "$sViewTable.oxvarselect" . $sLangTag; $sQ .= " IF( $sViewTable.$sCol != '', $sViewTable.$sCol, CONCAT((select oxart.$sCol from $sViewTable as oxart where oxart.oxid = $sViewTable.oxparentid),', ',$sVarSelect)) as _" . $iCnt; } else { $sQ .= $sViewTable . '.' . $sCol . ' as _' . $iCnt; } $blSep = true; } $aIdentCols = $this->_getIdentColNames(); foreach ($aIdentCols as $iCnt => $aCol) { if ($blSep) { $sQ .= ', '; } // multilanguage $sCol = $aCol[0]; $sQ .= $this->_getViewName($aCol[1]) . '.' . $sCol . ' as _' . $iCnt; } return " $sQ "; }
php
protected function _getQueryCols() { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $sLangTag = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageTag(); $sQ = ''; $blSep = false; $aVisiblecols = $this->_getVisibleColNames(); foreach ($aVisiblecols as $iCnt => $aCol) { if ($blSep) { $sQ .= ', '; } $sViewTable = $this->_getViewName($aCol[1]); // multilanguage $sCol = $aCol[0]; if ($oConfig->getConfigParam('blVariantsSelection') && $aCol[0] == 'oxtitle') { $sVarSelect = "$sViewTable.oxvarselect" . $sLangTag; $sQ .= " IF( $sViewTable.$sCol != '', $sViewTable.$sCol, CONCAT((select oxart.$sCol from $sViewTable as oxart where oxart.oxid = $sViewTable.oxparentid),', ',$sVarSelect)) as _" . $iCnt; } else { $sQ .= $sViewTable . '.' . $sCol . ' as _' . $iCnt; } $blSep = true; } $aIdentCols = $this->_getIdentColNames(); foreach ($aIdentCols as $iCnt => $aCol) { if ($blSep) { $sQ .= ', '; } // multilanguage $sCol = $aCol[0]; $sQ .= $this->_getViewName($aCol[1]) . '.' . $sCol . ' as _' . $iCnt; } return " $sQ "; }
[ "protected", "function", "_getQueryCols", "(", ")", "{", "$", "oConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "sLangTag", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\"...
Formats and returns chunk of SQL query string with definition of fields to load from DB. Adds subselect to get variant title from parent article @return string
[ "Formats", "and", "returns", "chunk", "of", "SQL", "query", "string", "with", "definition", "of", "fields", "to", "load", "from", "DB", ".", "Adds", "subselect", "to", "get", "variant", "title", "from", "parent", "article" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DiscountItemAjax.php#L134-L173
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.getActiveModuleInfo
public function getActiveModuleInfo() { $aModulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS); // Extract module paths from extended classes if (!is_array($aModulePaths) || count($aModulePaths) < 1) { $aModulePaths = $this->extractModulePaths(); } $aDisabledModules = $this->getDisabledModules(); if (is_array($aDisabledModules) && count($aDisabledModules) > 0 && count($aModulePaths) > 0) { $aModulePaths = array_diff_key($aModulePaths, array_flip($aDisabledModules)); } return $aModulePaths; }
php
public function getActiveModuleInfo() { $aModulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS); // Extract module paths from extended classes if (!is_array($aModulePaths) || count($aModulePaths) < 1) { $aModulePaths = $this->extractModulePaths(); } $aDisabledModules = $this->getDisabledModules(); if (is_array($aDisabledModules) && count($aDisabledModules) > 0 && count($aModulePaths) > 0) { $aModulePaths = array_diff_key($aModulePaths, array_flip($aDisabledModules)); } return $aModulePaths; }
[ "public", "function", "getActiveModuleInfo", "(", ")", "{", "$", "aModulePaths", "=", "$", "this", "->", "getModuleConfigParametersByKey", "(", "static", "::", "MODULE_KEY_PATHS", ")", ";", "// Extract module paths from extended classes", "if", "(", "!", "is_array", "...
Get active modules path info @return array
[ "Get", "active", "modules", "path", "info" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L72-L87
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.getDisabledModuleInfo
public function getDisabledModuleInfo() { $aDisabledModules = $this->getDisabledModules(); $aModulePaths = []; if (is_array($aDisabledModules) && count($aDisabledModules) > 0) { $aModulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS); // Extract module paths from extended classes if (!is_array($aModulePaths) || count($aModulePaths) < 1) { $aModulePaths = $this->extractModulePaths(); } if (is_array($aModulePaths) || count($aModulePaths) > 0) { $aModulePaths = array_intersect_key($aModulePaths, array_flip($aDisabledModules)); } } return $aModulePaths; }
php
public function getDisabledModuleInfo() { $aDisabledModules = $this->getDisabledModules(); $aModulePaths = []; if (is_array($aDisabledModules) && count($aDisabledModules) > 0) { $aModulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS); // Extract module paths from extended classes if (!is_array($aModulePaths) || count($aModulePaths) < 1) { $aModulePaths = $this->extractModulePaths(); } if (is_array($aModulePaths) || count($aModulePaths) > 0) { $aModulePaths = array_intersect_key($aModulePaths, array_flip($aDisabledModules)); } } return $aModulePaths; }
[ "public", "function", "getDisabledModuleInfo", "(", ")", "{", "$", "aDisabledModules", "=", "$", "this", "->", "getDisabledModules", "(", ")", ";", "$", "aModulePaths", "=", "[", "]", ";", "if", "(", "is_array", "(", "$", "aDisabledModules", ")", "&&", "co...
Get disabled module paths @return array
[ "Get", "disabled", "module", "paths" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L94-L113
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.extractModulePaths
public function extractModulePaths() { $aModules = $this->getModulesWithExtendedClass(); $aModulePaths = []; if (is_array($aModules) && count($aModules) > 0) { foreach ($aModules as $aModuleClasses) { foreach ($aModuleClasses as $sModule) { $sModuleId = substr($sModule, 0, strpos($sModule, "/")); $aModulePaths[$sModuleId] = $sModuleId; } } } return $aModulePaths; }
php
public function extractModulePaths() { $aModules = $this->getModulesWithExtendedClass(); $aModulePaths = []; if (is_array($aModules) && count($aModules) > 0) { foreach ($aModules as $aModuleClasses) { foreach ($aModuleClasses as $sModule) { $sModuleId = substr($sModule, 0, strpos($sModule, "/")); $aModulePaths[$sModuleId] = $sModuleId; } } } return $aModulePaths; }
[ "public", "function", "extractModulePaths", "(", ")", "{", "$", "aModules", "=", "$", "this", "->", "getModulesWithExtendedClass", "(", ")", ";", "$", "aModulePaths", "=", "[", "]", ";", "if", "(", "is_array", "(", "$", "aModules", ")", "&&", "count", "(...
Extract module id's with paths from extended classes. @return array
[ "Extract", "module", "id", "s", "with", "paths", "from", "extended", "classes", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L173-L188
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.getDisabledModuleClasses
public function getDisabledModuleClasses() { $disabledModules = $this->getDisabledModules(); $disabledModuleClasses = []; if (isset($disabledModules) && is_array($disabledModules)) { //get all disabled module paths $extensions = $this->getModuleConfigParametersByKey(static::MODULE_KEY_EXTENSIONS); $modules = $this->getModulesWithExtendedClass(); $modulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS); foreach ($disabledModules as $moduleId) { if (!array_key_exists($moduleId, $extensions)) { $path = $modulePaths[$moduleId]; if (!isset($path)) { $path = $moduleId; } foreach ($modules as $moduleClasses) { foreach ($moduleClasses as $moduleClass) { if (strpos($moduleClass, $path . "/") === 0) { $disabledModuleClasses[] = $moduleClass; } } } } else { $disabledModuleClasses = array_merge($disabledModuleClasses, $extensions[$moduleId]); } } } return $disabledModuleClasses; }
php
public function getDisabledModuleClasses() { $disabledModules = $this->getDisabledModules(); $disabledModuleClasses = []; if (isset($disabledModules) && is_array($disabledModules)) { //get all disabled module paths $extensions = $this->getModuleConfigParametersByKey(static::MODULE_KEY_EXTENSIONS); $modules = $this->getModulesWithExtendedClass(); $modulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS); foreach ($disabledModules as $moduleId) { if (!array_key_exists($moduleId, $extensions)) { $path = $modulePaths[$moduleId]; if (!isset($path)) { $path = $moduleId; } foreach ($modules as $moduleClasses) { foreach ($moduleClasses as $moduleClass) { if (strpos($moduleClass, $path . "/") === 0) { $disabledModuleClasses[] = $moduleClass; } } } } else { $disabledModuleClasses = array_merge($disabledModuleClasses, $extensions[$moduleId]); } } } return $disabledModuleClasses; }
[ "public", "function", "getDisabledModuleClasses", "(", ")", "{", "$", "disabledModules", "=", "$", "this", "->", "getDisabledModules", "(", ")", ";", "$", "disabledModuleClasses", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "disabledModules", ")", "&&"...
Returns disabled module classes with path using config aModules and aModulePaths. aModules has all extended classes aModulePaths has module id to main path array @return array
[ "Returns", "disabled", "module", "classes", "with", "path", "using", "config", "aModules", "and", "aModulePaths", ".", "aModules", "has", "all", "extended", "classes", "aModulePaths", "has", "module", "id", "to", "main", "path", "array" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L220-L250
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.cleanup
public function cleanup() { $aDeletedModules = $this->getDeletedExtensions(); //collecting deleted extension IDs $aDeletedModuleIds = array_keys($aDeletedModules); // removing from aModules config array $this->_removeExtensions($aDeletedModuleIds); // removing from aDisabledModules array $this->_removeFromDisabledModulesArray($aDeletedModuleIds); // removing from aModulePaths array $this->removeFromModulesArray(static::MODULE_KEY_PATHS, $aDeletedModuleIds); // removing from aModuleEvents array $this->removeFromModulesArray(static::MODULE_KEY_EVENTS, $aDeletedModuleIds); // removing from aModuleVersions array $this->removeFromModulesArray(static::MODULE_KEY_VERSIONS, $aDeletedModuleIds); // removing from aModuleExtensions array $this->removeFromModulesArray(static::MODULE_KEY_EXTENSIONS, $aDeletedModuleIds); // removing from aModuleFiles array $this->removeFromModulesArray(static::MODULE_KEY_FILES, $aDeletedModuleIds); // removing from aModuleTemplates array $this->removeFromModulesArray(static::MODULE_KEY_TEMPLATES, $aDeletedModuleIds); // removing from aModuleControllers array $this->removeFromModulesArray(static::MODULE_KEY_CONTROLLERS, $aDeletedModuleIds); //removing from config tables and templates blocks table $this->_removeFromDatabase($aDeletedModuleIds); //Remove from caches. \OxidEsales\Eshop\Core\Module\ModuleVariablesLocator::resetModuleVariables(); }
php
public function cleanup() { $aDeletedModules = $this->getDeletedExtensions(); //collecting deleted extension IDs $aDeletedModuleIds = array_keys($aDeletedModules); // removing from aModules config array $this->_removeExtensions($aDeletedModuleIds); // removing from aDisabledModules array $this->_removeFromDisabledModulesArray($aDeletedModuleIds); // removing from aModulePaths array $this->removeFromModulesArray(static::MODULE_KEY_PATHS, $aDeletedModuleIds); // removing from aModuleEvents array $this->removeFromModulesArray(static::MODULE_KEY_EVENTS, $aDeletedModuleIds); // removing from aModuleVersions array $this->removeFromModulesArray(static::MODULE_KEY_VERSIONS, $aDeletedModuleIds); // removing from aModuleExtensions array $this->removeFromModulesArray(static::MODULE_KEY_EXTENSIONS, $aDeletedModuleIds); // removing from aModuleFiles array $this->removeFromModulesArray(static::MODULE_KEY_FILES, $aDeletedModuleIds); // removing from aModuleTemplates array $this->removeFromModulesArray(static::MODULE_KEY_TEMPLATES, $aDeletedModuleIds); // removing from aModuleControllers array $this->removeFromModulesArray(static::MODULE_KEY_CONTROLLERS, $aDeletedModuleIds); //removing from config tables and templates blocks table $this->_removeFromDatabase($aDeletedModuleIds); //Remove from caches. \OxidEsales\Eshop\Core\Module\ModuleVariablesLocator::resetModuleVariables(); }
[ "public", "function", "cleanup", "(", ")", "{", "$", "aDeletedModules", "=", "$", "this", "->", "getDeletedExtensions", "(", ")", ";", "//collecting deleted extension IDs", "$", "aDeletedModuleIds", "=", "array_keys", "(", "$", "aDeletedModules", ")", ";", "// rem...
Removes extension metadata from shop.
[ "Removes", "extension", "metadata", "from", "shop", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L255-L294
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.getDeletedExtensions
public function getDeletedExtensions() { $oModuleValidatorFactory = $this->getModuleValidatorFactory(); $oModuleMetadataValidator = $oModuleValidatorFactory->getModuleMetadataValidator(); $aModulesIds = $this->getModuleIds(); $oModule = $this->getModule(); $aDeletedExt = []; foreach ($aModulesIds as $sModuleId) { $oModule->setModuleData(['id' => $sModuleId]); if (!$oModuleMetadataValidator->validate($oModule)) { $aDeletedExt[$sModuleId]['files'] = [$sModuleId . '/metadata.php']; } else { $aInvalidExtensions = $this->_getInvalidExtensions($sModuleId); if ($aInvalidExtensions) { $aDeletedExt[$sModuleId]['extensions'] = $aInvalidExtensions; } } } return $aDeletedExt; }
php
public function getDeletedExtensions() { $oModuleValidatorFactory = $this->getModuleValidatorFactory(); $oModuleMetadataValidator = $oModuleValidatorFactory->getModuleMetadataValidator(); $aModulesIds = $this->getModuleIds(); $oModule = $this->getModule(); $aDeletedExt = []; foreach ($aModulesIds as $sModuleId) { $oModule->setModuleData(['id' => $sModuleId]); if (!$oModuleMetadataValidator->validate($oModule)) { $aDeletedExt[$sModuleId]['files'] = [$sModuleId . '/metadata.php']; } else { $aInvalidExtensions = $this->_getInvalidExtensions($sModuleId); if ($aInvalidExtensions) { $aDeletedExt[$sModuleId]['extensions'] = $aInvalidExtensions; } } } return $aDeletedExt; }
[ "public", "function", "getDeletedExtensions", "(", ")", "{", "$", "oModuleValidatorFactory", "=", "$", "this", "->", "getModuleValidatorFactory", "(", ")", ";", "$", "oModuleMetadataValidator", "=", "$", "oModuleValidatorFactory", "->", "getModuleMetadataValidator", "("...
Checks module list - if there is extensions that are registered, but extension directory is missing @return array
[ "Checks", "module", "list", "-", "if", "there", "is", "extensions", "that", "are", "registered", "but", "extension", "directory", "is", "missing" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L301-L322
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.buildModuleChains
public function buildModuleChains($aModuleArray) { $aModules = []; if (is_array($aModuleArray)) { foreach ($aModuleArray as $sClass => $aModuleChain) { $aModules[$sClass] = implode('&', $aModuleChain); } } return $aModules; }
php
public function buildModuleChains($aModuleArray) { $aModules = []; if (is_array($aModuleArray)) { foreach ($aModuleArray as $sClass => $aModuleChain) { $aModules[$sClass] = implode('&', $aModuleChain); } } return $aModules; }
[ "public", "function", "buildModuleChains", "(", "$", "aModuleArray", ")", "{", "$", "aModules", "=", "[", "]", ";", "if", "(", "is_array", "(", "$", "aModuleArray", ")", ")", "{", "foreach", "(", "$", "aModuleArray", "as", "$", "sClass", "=>", "$", "aM...
Build module chains from nested array @param array $aModuleArray Module array (nested format) @return array
[ "Build", "module", "chains", "from", "nested", "array" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L369-L379
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList._removeExtensions
protected function _removeExtensions($aModuleIds) { $aModuleExtensions = $this->getModulesWithExtendedClass(); $aExtensionsToDelete = []; foreach ($aModuleIds as $sModuleId) { $aExtensionsToDelete = array_merge_recursive($aExtensionsToDelete, $this->getModuleExtensions($sModuleId)); } $aUpdatedExtensions = $this->diffModuleArrays($aModuleExtensions, $aExtensionsToDelete); $aUpdatedExtensionsChains = $this->buildModuleChains($aUpdatedExtensions); \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModules', $aUpdatedExtensionsChains); }
php
protected function _removeExtensions($aModuleIds) { $aModuleExtensions = $this->getModulesWithExtendedClass(); $aExtensionsToDelete = []; foreach ($aModuleIds as $sModuleId) { $aExtensionsToDelete = array_merge_recursive($aExtensionsToDelete, $this->getModuleExtensions($sModuleId)); } $aUpdatedExtensions = $this->diffModuleArrays($aModuleExtensions, $aExtensionsToDelete); $aUpdatedExtensionsChains = $this->buildModuleChains($aUpdatedExtensions); \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModules', $aUpdatedExtensionsChains); }
[ "protected", "function", "_removeExtensions", "(", "$", "aModuleIds", ")", "{", "$", "aModuleExtensions", "=", "$", "this", "->", "getModulesWithExtendedClass", "(", ")", ";", "$", "aExtensionsToDelete", "=", "[", "]", ";", "foreach", "(", "$", "aModuleIds", "...
Removes extension by given modules ids. @param array $aModuleIds Modules ids which must be deleted from config.
[ "Removes", "extension", "by", "given", "modules", "ids", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L421-L433
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList._removeFromDisabledModulesArray
protected function _removeFromDisabledModulesArray($aDeletedExtIds) { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $aDisabledExtensionIds = $this->getDisabledModules(); $aDisabledExtensionIds = array_diff($aDisabledExtensionIds, $aDeletedExtIds); $oConfig->saveShopConfVar('arr', 'aDisabledModules', $aDisabledExtensionIds); }
php
protected function _removeFromDisabledModulesArray($aDeletedExtIds) { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $aDisabledExtensionIds = $this->getDisabledModules(); $aDisabledExtensionIds = array_diff($aDisabledExtensionIds, $aDeletedExtIds); $oConfig->saveShopConfVar('arr', 'aDisabledModules', $aDisabledExtensionIds); }
[ "protected", "function", "_removeFromDisabledModulesArray", "(", "$", "aDeletedExtIds", ")", "{", "$", "oConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "aDisabledExtensionIds", "=", "$", ...
Removes extension from disabled modules array @param array $aDeletedExtIds Deleted extension id's of array
[ "Removes", "extension", "from", "disabled", "modules", "array" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L440-L446
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.removeFromModulesArray
protected function removeFromModulesArray($key, $aDeletedModule) { $array = $this->getModuleConfigParametersByKey($key); foreach ($aDeletedModule as $sDeletedModuleId) { if (isset($array[$sDeletedModuleId])) { unset($array[$sDeletedModuleId]); } } \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModule' . $key, $array); }
php
protected function removeFromModulesArray($key, $aDeletedModule) { $array = $this->getModuleConfigParametersByKey($key); foreach ($aDeletedModule as $sDeletedModuleId) { if (isset($array[$sDeletedModuleId])) { unset($array[$sDeletedModuleId]); } } \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModule' . $key, $array); }
[ "protected", "function", "removeFromModulesArray", "(", "$", "key", ",", "$", "aDeletedModule", ")", "{", "$", "array", "=", "$", "this", "->", "getModuleConfigParametersByKey", "(", "$", "key", ")", ";", "foreach", "(", "$", "aDeletedModule", "as", "$", "sD...
Removes extension from given modules array. @param string $key Module array key. @param array $aDeletedModule Deleted extensions ID's.
[ "Removes", "extension", "from", "given", "modules", "array", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L454-L465
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList._removeFromDatabase
protected function _removeFromDatabase($aDeletedExtIds) { if (!is_array($aDeletedExtIds) || !count($aDeletedExtIds)) { return; } $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $aConfigIds = $sDelExtIds = []; foreach ($aDeletedExtIds as $sDeletedExtId) { $aConfigIds[] = $oDb->quote('module:' . $sDeletedExtId); $sDelExtIds[] = $oDb->quote($sDeletedExtId); } $sConfigIds = implode(', ', $aConfigIds); $sDelExtIds = implode(', ', $sDelExtIds); $aSql[] = "DELETE FROM oxconfig where oxmodule IN ($sConfigIds)"; $aSql[] = "DELETE FROM oxconfigdisplay where oxcfgmodule IN ($sConfigIds)"; $aSql[] = "DELETE FROM oxtplblocks where oxmodule IN ($sDelExtIds)"; foreach ($aSql as $sQuery) { $oDb->execute($sQuery); } }
php
protected function _removeFromDatabase($aDeletedExtIds) { if (!is_array($aDeletedExtIds) || !count($aDeletedExtIds)) { return; } $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $aConfigIds = $sDelExtIds = []; foreach ($aDeletedExtIds as $sDeletedExtId) { $aConfigIds[] = $oDb->quote('module:' . $sDeletedExtId); $sDelExtIds[] = $oDb->quote($sDeletedExtId); } $sConfigIds = implode(', ', $aConfigIds); $sDelExtIds = implode(', ', $sDelExtIds); $aSql[] = "DELETE FROM oxconfig where oxmodule IN ($sConfigIds)"; $aSql[] = "DELETE FROM oxconfigdisplay where oxcfgmodule IN ($sConfigIds)"; $aSql[] = "DELETE FROM oxtplblocks where oxmodule IN ($sDelExtIds)"; foreach ($aSql as $sQuery) { $oDb->execute($sQuery); } }
[ "protected", "function", "_removeFromDatabase", "(", "$", "aDeletedExtIds", ")", "{", "if", "(", "!", "is_array", "(", "$", "aDeletedExtIds", ")", "||", "!", "count", "(", "$", "aDeletedExtIds", ")", ")", "{", "return", ";", "}", "$", "oDb", "=", "\\", ...
Removes extension from database - oxConfig, oxConfigDisplay and oxTplBlocks tables @todo extract oxtplblocks query to ModuleTemplateBlockRepository @param array $aDeletedExtIds deleted extensions ID's @return null
[ "Removes", "extension", "from", "database", "-", "oxConfig", "oxConfigDisplay", "and", "oxTplBlocks", "tables" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L490-L514
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.getModuleIds
public function getModuleIds() { $aModuleIdsFromExtensions = $this->_getModuleIdsFromExtensions($this->getModulesWithExtendedClass()); $aModuleIdsFromFiles = array_keys($this->getModuleConfigParametersByKey(static::MODULE_KEY_FILES)); return array_unique(array_merge($aModuleIdsFromExtensions, $aModuleIdsFromFiles)); }
php
public function getModuleIds() { $aModuleIdsFromExtensions = $this->_getModuleIdsFromExtensions($this->getModulesWithExtendedClass()); $aModuleIdsFromFiles = array_keys($this->getModuleConfigParametersByKey(static::MODULE_KEY_FILES)); return array_unique(array_merge($aModuleIdsFromExtensions, $aModuleIdsFromFiles)); }
[ "public", "function", "getModuleIds", "(", ")", "{", "$", "aModuleIdsFromExtensions", "=", "$", "this", "->", "_getModuleIdsFromExtensions", "(", "$", "this", "->", "getModulesWithExtendedClass", "(", ")", ")", ";", "$", "aModuleIdsFromFiles", "=", "array_keys", "...
Returns module ids which have extensions or files. @return array
[ "Returns", "module", "ids", "which", "have", "extensions", "or", "files", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L593-L599
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList.getModuleExtensions
public function getModuleExtensions($sModuleId) { if (!isset($this->_aModuleExtensions)) { $aModuleExtension = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesWithExtendedClass(); $oModule = $this->getModule(); $aExtension = []; foreach ($aModuleExtension as $sOxClass => $aFiles) { foreach ($aFiles as $sFilePath) { $sId = $oModule->getIdByPath($sFilePath); $aExtension[$sId][$sOxClass][] = $sFilePath; } } $this->_aModuleExtensions = $aExtension; } return $this->_aModuleExtensions[$sModuleId] ? $this->_aModuleExtensions[$sModuleId] : []; }
php
public function getModuleExtensions($sModuleId) { if (!isset($this->_aModuleExtensions)) { $aModuleExtension = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesWithExtendedClass(); $oModule = $this->getModule(); $aExtension = []; foreach ($aModuleExtension as $sOxClass => $aFiles) { foreach ($aFiles as $sFilePath) { $sId = $oModule->getIdByPath($sFilePath); $aExtension[$sId][$sOxClass][] = $sFilePath; } } $this->_aModuleExtensions = $aExtension; } return $this->_aModuleExtensions[$sModuleId] ? $this->_aModuleExtensions[$sModuleId] : []; }
[ "public", "function", "getModuleExtensions", "(", "$", "sModuleId", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_aModuleExtensions", ")", ")", "{", "$", "aModuleExtension", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Regist...
Returns module extensions. @param string $sModuleId @return array
[ "Returns", "module", "extensions", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L608-L625
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList._isVendorDir
protected function _isVendorDir($sModuleDir) { if (!is_dir($sModuleDir)) { return false; } $currentDirectoryContents = scandir($sModuleDir); $currentDirectoryContents = array_diff($currentDirectoryContents, ['.', '..']); foreach ($currentDirectoryContents as $entry) { if (is_dir("$sModuleDir/$entry") && file_exists("$sModuleDir/$entry/metadata.php")) { return true; } } return false; }
php
protected function _isVendorDir($sModuleDir) { if (!is_dir($sModuleDir)) { return false; } $currentDirectoryContents = scandir($sModuleDir); $currentDirectoryContents = array_diff($currentDirectoryContents, ['.', '..']); foreach ($currentDirectoryContents as $entry) { if (is_dir("$sModuleDir/$entry") && file_exists("$sModuleDir/$entry/metadata.php")) { return true; } } return false; }
[ "protected", "function", "_isVendorDir", "(", "$", "sModuleDir", ")", "{", "if", "(", "!", "is_dir", "(", "$", "sModuleDir", ")", ")", "{", "return", "false", ";", "}", "$", "currentDirectoryContents", "=", "scandir", "(", "$", "sModuleDir", ")", ";", "$...
Checks if directory is vendor directory. @param string $sModuleDir dir path @return bool
[ "Checks", "if", "directory", "is", "vendor", "directory", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L647-L662
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList._extendsClasses
protected function _extendsClasses($sModuleDir) { $aModules = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModules'); if (is_array($aModules)) { $sModules = implode('&', $aModules); if (preg_match("@(^|&+)" . $sModuleDir . "\b@", $sModules)) { return true; } } return false; }
php
protected function _extendsClasses($sModuleDir) { $aModules = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModules'); if (is_array($aModules)) { $sModules = implode('&', $aModules); if (preg_match("@(^|&+)" . $sModuleDir . "\b@", $sModules)) { return true; } } return false; }
[ "protected", "function", "_extendsClasses", "(", "$", "sModuleDir", ")", "{", "$", "aModules", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'aModules'", ")", ";", "if", "...
Checks if module extends any shop class. @param string $sModuleDir dir path @return bool
[ "Checks", "if", "module", "extends", "any", "shop", "class", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L671-L683
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList._saveModulePath
protected function _saveModulePath($sModuleId, $sModulePath) { $aModulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS); $aModulePaths[$sModuleId] = $sModulePath; \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModulePaths', $aModulePaths); }
php
protected function _saveModulePath($sModuleId, $sModulePath) { $aModulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS); $aModulePaths[$sModuleId] = $sModulePath; \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModulePaths', $aModulePaths); }
[ "protected", "function", "_saveModulePath", "(", "$", "sModuleId", ",", "$", "sModulePath", ")", "{", "$", "aModulePaths", "=", "$", "this", "->", "getModuleConfigParametersByKey", "(", "static", "::", "MODULE_KEY_PATHS", ")", ";", "$", "aModulePaths", "[", "$",...
Saving module path info. Module path is saved to config variable "aModulePaths". @param string $sModuleId Module ID @param string $sModulePath Module path
[ "Saving", "module", "path", "info", ".", "Module", "path", "is", "saved", "to", "config", "variable", "aModulePaths", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L691-L697
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList._getModuleIdsFromExtensions
private function _getModuleIdsFromExtensions($aData) { $aModuleIds = []; $oModule = $this->getModule(); foreach ($aData as $aModule) { foreach ($aModule as $sFilePath) { $sModuleId = $oModule->getIdByPath($sFilePath); $aModuleIds[] = $sModuleId; } } return $aModuleIds; }
php
private function _getModuleIdsFromExtensions($aData) { $aModuleIds = []; $oModule = $this->getModule(); foreach ($aData as $aModule) { foreach ($aModule as $sFilePath) { $sModuleId = $oModule->getIdByPath($sFilePath); $aModuleIds[] = $sModuleId; } } return $aModuleIds; }
[ "private", "function", "_getModuleIdsFromExtensions", "(", "$", "aData", ")", "{", "$", "aModuleIds", "=", "[", "]", ";", "$", "oModule", "=", "$", "this", "->", "getModule", "(", ")", ";", "foreach", "(", "$", "aData", "as", "$", "aModule", ")", "{", ...
Returns module ids which have extensions. @param array $aData Data @return array
[ "Returns", "module", "ids", "which", "have", "extensions", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L706-L718
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleList.php
ModuleList._getInvalidExtensions
private function _getInvalidExtensions($moduleId) { $extendedShopClasses = $this->getModuleExtensions($moduleId); $invalidModuleClasses = []; foreach ($extendedShopClasses as $extendedShopClass => $moduleClasses) { foreach ($moduleClasses as $moduleClass) { if (\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($moduleClass)) { /** @var \Composer\Autoload\ClassLoader $composerClassLoader */ $composerClassLoader = include VENDOR_PATH . 'autoload.php'; if (!$composerClassLoader->findFile($moduleClass)) { $invalidModuleClasses[$extendedShopClass][] = $moduleClass; } } else { /** Note: $aDeletedExt is passed by reference */ $this->backwardsCompatibleGetInvalidExtensions($moduleClass, $invalidModuleClasses, $extendedShopClass); } } } return $invalidModuleClasses; }
php
private function _getInvalidExtensions($moduleId) { $extendedShopClasses = $this->getModuleExtensions($moduleId); $invalidModuleClasses = []; foreach ($extendedShopClasses as $extendedShopClass => $moduleClasses) { foreach ($moduleClasses as $moduleClass) { if (\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($moduleClass)) { /** @var \Composer\Autoload\ClassLoader $composerClassLoader */ $composerClassLoader = include VENDOR_PATH . 'autoload.php'; if (!$composerClassLoader->findFile($moduleClass)) { $invalidModuleClasses[$extendedShopClass][] = $moduleClass; } } else { /** Note: $aDeletedExt is passed by reference */ $this->backwardsCompatibleGetInvalidExtensions($moduleClass, $invalidModuleClasses, $extendedShopClass); } } } return $invalidModuleClasses; }
[ "private", "function", "_getInvalidExtensions", "(", "$", "moduleId", ")", "{", "$", "extendedShopClasses", "=", "$", "this", "->", "getModuleExtensions", "(", "$", "moduleId", ")", ";", "$", "invalidModuleClasses", "=", "[", "]", ";", "foreach", "(", "$", "...
Returns shop classes and associated invalid module classes for a given module id @param string $moduleId Module id @return array
[ "Returns", "shop", "classes", "and", "associated", "invalid", "module", "classes", "for", "a", "given", "module", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleList.php#L727-L748
train
OXID-eSales/oxideshop_ce
source/Application/Model/OrderFile.php
OrderFile.setFile
public function setFile($sFileName, $sFileId, $iMaxDownloadCounts, $iExpirationTime, $iExpirationDownloadTime) { $sNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime(); $sDate = date('Y-m-d G:i', $sNow + $iExpirationTime * 3600); $this->oxorderfiles__oxfileid = new \OxidEsales\Eshop\Core\Field($sFileId); $this->oxorderfiles__oxfilename = new \OxidEsales\Eshop\Core\Field($sFileName); $this->oxorderfiles__oxmaxdownloadcount = new \OxidEsales\Eshop\Core\Field($iMaxDownloadCounts); $this->oxorderfiles__oxlinkexpirationtime = new \OxidEsales\Eshop\Core\Field($iExpirationTime); $this->oxorderfiles__oxdownloadexpirationtime = new \OxidEsales\Eshop\Core\Field($iExpirationDownloadTime); $this->oxorderfiles__oxvaliduntil = new \OxidEsales\Eshop\Core\Field($sDate); }
php
public function setFile($sFileName, $sFileId, $iMaxDownloadCounts, $iExpirationTime, $iExpirationDownloadTime) { $sNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime(); $sDate = date('Y-m-d G:i', $sNow + $iExpirationTime * 3600); $this->oxorderfiles__oxfileid = new \OxidEsales\Eshop\Core\Field($sFileId); $this->oxorderfiles__oxfilename = new \OxidEsales\Eshop\Core\Field($sFileName); $this->oxorderfiles__oxmaxdownloadcount = new \OxidEsales\Eshop\Core\Field($iMaxDownloadCounts); $this->oxorderfiles__oxlinkexpirationtime = new \OxidEsales\Eshop\Core\Field($iExpirationTime); $this->oxorderfiles__oxdownloadexpirationtime = new \OxidEsales\Eshop\Core\Field($iExpirationDownloadTime); $this->oxorderfiles__oxvaliduntil = new \OxidEsales\Eshop\Core\Field($sDate); }
[ "public", "function", "setFile", "(", "$", "sFileName", ",", "$", "sFileId", ",", "$", "iMaxDownloadCounts", ",", "$", "iExpirationTime", ",", "$", "iExpirationDownloadTime", ")", "{", "$", "sNow", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", ...
Set file and download options @param string $sFileName file name @param string $sFileId file id @param int $iMaxDownloadCounts max download count @param int $iExpirationTime main download time after order in times @param int $iExpirationDownloadTime download time after first download in hours
[ "Set", "file", "and", "download", "options" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/OrderFile.php#L102-L113
train
OXID-eSales/oxideshop_ce
source/Application/Model/OrderFile.php
OrderFile.getFileSize
public function getFileSize() { $oFile = oxNew(\OxidEsales\Eshop\Application\Model\File::class); $oFile->load($this->oxorderfiles__oxfileid->value); return $oFile->getSize(); }
php
public function getFileSize() { $oFile = oxNew(\OxidEsales\Eshop\Application\Model\File::class); $oFile->load($this->oxorderfiles__oxfileid->value); return $oFile->getSize(); }
[ "public", "function", "getFileSize", "(", ")", "{", "$", "oFile", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "File", "::", "class", ")", ";", "$", "oFile", "->", "load", "(", "$", "this", "->", "ox...
Returns downloadable file size in bytes. @return int
[ "Returns", "downloadable", "file", "size", "in", "bytes", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/OrderFile.php#L120-L126
train
OXID-eSales/oxideshop_ce
source/Application/Model/OrderFile.php
OrderFile._getFieldLongName
protected function _getFieldLongName($sFieldName) { $aFieldNames = [ 'oxorderfiles__oxarticletitle', 'oxorderfiles__oxarticleartnum', 'oxorderfiles__oxordernr', 'oxorderfiles__oxorderdate', 'oxorderfiles__oxispaid', 'oxorderfiles__oxpurchasedonly' ]; if (in_array($sFieldName, $aFieldNames)) { return $sFieldName; } return parent::_getFieldLongName($sFieldName); }
php
protected function _getFieldLongName($sFieldName) { $aFieldNames = [ 'oxorderfiles__oxarticletitle', 'oxorderfiles__oxarticleartnum', 'oxorderfiles__oxordernr', 'oxorderfiles__oxorderdate', 'oxorderfiles__oxispaid', 'oxorderfiles__oxpurchasedonly' ]; if (in_array($sFieldName, $aFieldNames)) { return $sFieldName; } return parent::_getFieldLongName($sFieldName); }
[ "protected", "function", "_getFieldLongName", "(", "$", "sFieldName", ")", "{", "$", "aFieldNames", "=", "[", "'oxorderfiles__oxarticletitle'", ",", "'oxorderfiles__oxarticleartnum'", ",", "'oxorderfiles__oxordernr'", ",", "'oxorderfiles__oxorderdate'", ",", "'oxorderfiles__o...
returns long name @param string $sFieldName - field name @return string
[ "returns", "long", "name" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/OrderFile.php#L135-L151
train
OXID-eSales/oxideshop_ce
source/Application/Model/OrderFile.php
OrderFile.isValid
public function isValid() { if (!$this->oxorderfiles__oxmaxdownloadcount->value || ($this->oxorderfiles__oxdownloadcount->value < $this->oxorderfiles__oxmaxdownloadcount->value)) { if (!$this->oxorderfiles__oxlinkexpirationtime->value && !$this->oxorderfiles__oxdownloadxpirationtime->value) { return true; } else { $sNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime(); $iTimestamp = strtotime($this->oxorderfiles__oxvaliduntil->value); if (!$iTimestamp || ($iTimestamp > $sNow)) { return true; } } } return false; }
php
public function isValid() { if (!$this->oxorderfiles__oxmaxdownloadcount->value || ($this->oxorderfiles__oxdownloadcount->value < $this->oxorderfiles__oxmaxdownloadcount->value)) { if (!$this->oxorderfiles__oxlinkexpirationtime->value && !$this->oxorderfiles__oxdownloadxpirationtime->value) { return true; } else { $sNow = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime(); $iTimestamp = strtotime($this->oxorderfiles__oxvaliduntil->value); if (!$iTimestamp || ($iTimestamp > $sNow)) { return true; } } } return false; }
[ "public", "function", "isValid", "(", ")", "{", "if", "(", "!", "$", "this", "->", "oxorderfiles__oxmaxdownloadcount", "->", "value", "||", "(", "$", "this", "->", "oxorderfiles__oxdownloadcount", "->", "value", "<", "$", "this", "->", "oxorderfiles__oxmaxdownlo...
Checks if order file is still available to download @return bool
[ "Checks", "if", "order", "file", "is", "still", "available", "to", "download" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/OrderFile.php#L158-L173
train
OXID-eSales/oxideshop_ce
source/Application/Model/OrderFile.php
OrderFile.getLeftDownloadCount
public function getLeftDownloadCount() { $iLeft = $this->oxorderfiles__oxmaxdownloadcount->value - $this->oxorderfiles__oxdownloadcount->value; if ($iLeft < 0) { $iLeft = 0; } return $iLeft; }
php
public function getLeftDownloadCount() { $iLeft = $this->oxorderfiles__oxmaxdownloadcount->value - $this->oxorderfiles__oxdownloadcount->value; if ($iLeft < 0) { $iLeft = 0; } return $iLeft; }
[ "public", "function", "getLeftDownloadCount", "(", ")", "{", "$", "iLeft", "=", "$", "this", "->", "oxorderfiles__oxmaxdownloadcount", "->", "value", "-", "$", "this", "->", "oxorderfiles__oxdownloadcount", "->", "value", ";", "if", "(", "$", "iLeft", "<", "0"...
returns date ant time @return bool
[ "returns", "date", "ant", "time" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/OrderFile.php#L200-L208
train
OXID-eSales/oxideshop_ce
source/Application/Model/OrderFile.php
OrderFile.processOrderFile
public function processOrderFile() { if ($this->isValid()) { //first download if (!$this->oxorderfiles__oxdownloadcount->value) { $this->oxorderfiles__oxdownloadcount = new \OxidEsales\Eshop\Core\Field(1); $iExpirationTime = $this->oxorderfiles__oxdownloadexpirationtime->value * 3600; $iTime = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime(); $this->oxorderfiles__oxvaliduntil = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', $iTime + $iExpirationTime)); $this->oxorderfiles__oxfirstdownload = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', $iTime)); $this->oxorderfiles__oxlastdownload = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', $iTime)); } else { $this->oxorderfiles__oxdownloadcount = new \OxidEsales\Eshop\Core\Field($this->oxorderfiles__oxdownloadcount->value + 1); $iTime = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime(); $this->oxorderfiles__oxlastdownload = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', $iTime)); } $this->save(); return $this->oxorderfiles__oxfileid->value; } return false; }
php
public function processOrderFile() { if ($this->isValid()) { //first download if (!$this->oxorderfiles__oxdownloadcount->value) { $this->oxorderfiles__oxdownloadcount = new \OxidEsales\Eshop\Core\Field(1); $iExpirationTime = $this->oxorderfiles__oxdownloadexpirationtime->value * 3600; $iTime = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime(); $this->oxorderfiles__oxvaliduntil = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', $iTime + $iExpirationTime)); $this->oxorderfiles__oxfirstdownload = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', $iTime)); $this->oxorderfiles__oxlastdownload = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', $iTime)); } else { $this->oxorderfiles__oxdownloadcount = new \OxidEsales\Eshop\Core\Field($this->oxorderfiles__oxdownloadcount->value + 1); $iTime = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime(); $this->oxorderfiles__oxlastdownload = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s', $iTime)); } $this->save(); return $this->oxorderfiles__oxfileid->value; } return false; }
[ "public", "function", "processOrderFile", "(", ")", "{", "if", "(", "$", "this", "->", "isValid", "(", ")", ")", "{", "//first download", "if", "(", "!", "$", "this", "->", "oxorderfiles__oxdownloadcount", "->", "value", ")", "{", "$", "this", "->", "oxo...
Checks if download link is valid, changes count, if first download changes valid until @return bool
[ "Checks", "if", "download", "link", "is", "valid", "changes", "count", "if", "first", "download", "changes", "valid", "until" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/OrderFile.php#L215-L240
train
OXID-eSales/oxideshop_ce
source/Core/OnlineRequest.php
OnlineRequest._getClusterId
private function _getClusterId() { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $sBaseShop = $oConfig->getBaseShopId(); $sClusterId = $oConfig->getShopConfVar('sClusterId', $sBaseShop); if (!$sClusterId) { $oUUIDGenerator = oxNew(\OxidEsales\Eshop\Core\UniversallyUniqueIdGenerator::class); $sClusterId = $oUUIDGenerator->generate(); $oConfig->saveShopConfVar("str", 'sClusterId', $sClusterId, $sBaseShop); } return $sClusterId; }
php
private function _getClusterId() { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $sBaseShop = $oConfig->getBaseShopId(); $sClusterId = $oConfig->getShopConfVar('sClusterId', $sBaseShop); if (!$sClusterId) { $oUUIDGenerator = oxNew(\OxidEsales\Eshop\Core\UniversallyUniqueIdGenerator::class); $sClusterId = $oUUIDGenerator->generate(); $oConfig->saveShopConfVar("str", 'sClusterId', $sClusterId, $sBaseShop); } return $sClusterId; }
[ "private", "function", "_getClusterId", "(", ")", "{", "$", "oConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "sBaseShop", "=", "$", "oConfig", "->", "getBaseShopId", "(", ")", ";", ...
Returns cluster id. Takes cluster id from configuration if set, otherwise generates it. @return string
[ "Returns", "cluster", "id", ".", "Takes", "cluster", "id", "from", "configuration", "if", "set", "otherwise", "generates", "it", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineRequest.php#L77-L89
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getConfigParam
public function getConfigParam($name, $default = null) { $this->init(); if (isset($this->_aConfigParams[$name])) { $value = $this->_aConfigParams[$name]; } elseif (isset($this->$name)) { $value = $this->$name; } else { $value = $default; } return $value; }
php
public function getConfigParam($name, $default = null) { $this->init(); if (isset($this->_aConfigParams[$name])) { $value = $this->_aConfigParams[$name]; } elseif (isset($this->$name)) { $value = $this->$name; } else { $value = $default; } return $value; }
[ "public", "function", "getConfigParam", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "$", "this", "->", "init", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "_aConfigParams", "[", "$", "name", "]", ")", ")", "{", "$...
Returns config parameter value if such parameter exists @param string $name config parameter name @param mixed $default default value if no config var is found default null @return mixed
[ "Returns", "config", "parameter", "value", "if", "such", "parameter", "exists" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L322-L335
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.setConfigParam
public function setConfigParam($name, $value) { if (isset($this->_aConfigParams[$name])) { $this->_aConfigParams[$name] = $value; } elseif (isset($this->$name)) { $this->$name = $value; } else { $this->_aConfigParams[$name] = $value; } }
php
public function setConfigParam($name, $value) { if (isset($this->_aConfigParams[$name])) { $this->_aConfigParams[$name] = $value; } elseif (isset($this->$name)) { $this->$name = $value; } else { $this->_aConfigParams[$name] = $value; } }
[ "public", "function", "setConfigParam", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_aConfigParams", "[", "$", "name", "]", ")", ")", "{", "$", "this", "->", "_aConfigParams", "[", "$", "name", "]", "...
Stores config parameter value in config @param string $name config parameter name @param mixed $value config parameter value
[ "Stores", "config", "parameter", "value", "in", "config" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L343-L352
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.initVars
public function initVars($shopID) { $this->_loadVarsFromFile(); $this->_setDefaults(); $configLoaded = $this->_loadVarsFromDb($shopID); // loading shop config if (empty($shopID) || !$configLoaded) { // if no config values where loaded (some problems with DB), throwing an exception $exception = new \OxidEsales\Eshop\Core\Exception\DatabaseException( "Unable to load shop config values from database", 0, new \Exception() ); throw $exception; } // loading theme config options $this->_loadVarsFromDb($shopID, null, Config::OXMODULE_THEME_PREFIX . $this->getConfigParam('sTheme')); // checking if custom theme (which has defined parent theme) config options should be loaded over parent theme (#3362) if ($this->getConfigParam('sCustomTheme')) { $this->_loadVarsFromDb($shopID, null, Config::OXMODULE_THEME_PREFIX . $this->getConfigParam('sCustomTheme')); } // loading modules config $this->_loadVarsFromDb($shopID, null, Config::OXMODULE_MODULE_PREFIX); $this->loadAdditionalConfiguration(); // Admin handling $this->setConfigParam('blAdmin', isAdmin()); if (defined('OX_ADMIN_DIR')) { $this->setConfigParam('sAdminDir', OX_ADMIN_DIR); } $this->_loadVarsFromFile(); }
php
public function initVars($shopID) { $this->_loadVarsFromFile(); $this->_setDefaults(); $configLoaded = $this->_loadVarsFromDb($shopID); // loading shop config if (empty($shopID) || !$configLoaded) { // if no config values where loaded (some problems with DB), throwing an exception $exception = new \OxidEsales\Eshop\Core\Exception\DatabaseException( "Unable to load shop config values from database", 0, new \Exception() ); throw $exception; } // loading theme config options $this->_loadVarsFromDb($shopID, null, Config::OXMODULE_THEME_PREFIX . $this->getConfigParam('sTheme')); // checking if custom theme (which has defined parent theme) config options should be loaded over parent theme (#3362) if ($this->getConfigParam('sCustomTheme')) { $this->_loadVarsFromDb($shopID, null, Config::OXMODULE_THEME_PREFIX . $this->getConfigParam('sCustomTheme')); } // loading modules config $this->_loadVarsFromDb($shopID, null, Config::OXMODULE_MODULE_PREFIX); $this->loadAdditionalConfiguration(); // Admin handling $this->setConfigParam('blAdmin', isAdmin()); if (defined('OX_ADMIN_DIR')) { $this->setConfigParam('sAdminDir', OX_ADMIN_DIR); } $this->_loadVarsFromFile(); }
[ "public", "function", "initVars", "(", "$", "shopID", ")", "{", "$", "this", "->", "_loadVarsFromFile", "(", ")", ";", "$", "this", "->", "_setDefaults", "(", ")", ";", "$", "configLoaded", "=", "$", "this", "->", "_loadVarsFromDb", "(", "$", "shopID", ...
Initialize configuration variables @throws \OxidEsales\Eshop\Core\Exception\DatabaseException @param int $shopID
[ "Initialize", "configuration", "variables" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L371-L410
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.init
public function init() { // Duplicated init protection if ($this->_blInit) { return; } $this->_blInit = true; try { // config params initialization $this->initVars($this->getShopId()); // application initialization $this->initializeShop(); $this->_oStart = oxNew(\OxidEsales\Eshop\Application\Controller\OxidStartController::class); $this->_oStart->appInit(); } catch (\OxidEsales\Eshop\Core\Exception\DatabaseException $exception) { $this->_handleDbConnectionException($exception); } catch (\OxidEsales\Eshop\Core\Exception\CookieException $exception) { $this->_handleCookieException($exception); } }
php
public function init() { // Duplicated init protection if ($this->_blInit) { return; } $this->_blInit = true; try { // config params initialization $this->initVars($this->getShopId()); // application initialization $this->initializeShop(); $this->_oStart = oxNew(\OxidEsales\Eshop\Application\Controller\OxidStartController::class); $this->_oStart->appInit(); } catch (\OxidEsales\Eshop\Core\Exception\DatabaseException $exception) { $this->_handleDbConnectionException($exception); } catch (\OxidEsales\Eshop\Core\Exception\CookieException $exception) { $this->_handleCookieException($exception); } }
[ "public", "function", "init", "(", ")", "{", "// Duplicated init protection", "if", "(", "$", "this", "->", "_blInit", ")", "{", "return", ";", "}", "$", "this", "->", "_blInit", "=", "true", ";", "try", "{", "// config params initialization", "$", "this", ...
Starts session manager @return null
[ "Starts", "session", "manager" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L417-L438
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config._loadVarsFromFile
protected function _loadVarsFromFile() { //config variables from config.inc.php takes priority over the ones loaded from db include getShopBasePath() . '/config.inc.php'; //adding trailing slashes $fileUtils = Registry::getUtilsFile(); $this->sShopDir = $fileUtils->normalizeDir($this->sShopDir); $this->sCompileDir = $fileUtils->normalizeDir($this->sCompileDir); $this->sShopURL = $fileUtils->normalizeDir($this->sShopURL); $this->sSSLShopURL = $fileUtils->normalizeDir($this->sSSLShopURL); $this->sAdminSSLURL = $fileUtils->normalizeDir($this->sAdminSSLURL); $this->_loadCustomConfig(); }
php
protected function _loadVarsFromFile() { //config variables from config.inc.php takes priority over the ones loaded from db include getShopBasePath() . '/config.inc.php'; //adding trailing slashes $fileUtils = Registry::getUtilsFile(); $this->sShopDir = $fileUtils->normalizeDir($this->sShopDir); $this->sCompileDir = $fileUtils->normalizeDir($this->sCompileDir); $this->sShopURL = $fileUtils->normalizeDir($this->sShopURL); $this->sSSLShopURL = $fileUtils->normalizeDir($this->sSSLShopURL); $this->sAdminSSLURL = $fileUtils->normalizeDir($this->sAdminSSLURL); $this->_loadCustomConfig(); }
[ "protected", "function", "_loadVarsFromFile", "(", ")", "{", "//config variables from config.inc.php takes priority over the ones loaded from db", "include", "getShopBasePath", "(", ")", ".", "'/config.inc.php'", ";", "//adding trailing slashes", "$", "fileUtils", "=", "Registry"...
Loads vars from default config file
[ "Loads", "vars", "from", "default", "config", "file" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L468-L482
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config._setDefaults
protected function _setDefaults() { $this->setConfigParam('sTheme', 'azure'); if (is_null($this->getConfigParam('sDefaultLang'))) { $this->setConfigParam('sDefaultLang', 0); } if (is_null($this->getConfigParam('blLogChangesInAdmin'))) { $this->setConfigParam('blLogChangesInAdmin', false); } if (is_null($this->getConfigParam('blCheckTemplates'))) { $this->setConfigParam('blCheckTemplates', false); } if (is_null($this->getConfigParam('blAllowArticlesubclass'))) { $this->setConfigParam('blAllowArticlesubclass', false); } if (is_null($this->getConfigParam('iAdminListSize'))) { $this->setConfigParam('iAdminListSize', 9); } // #1173M for EE - not all pic are deleted if (is_null($this->getConfigParam('iPicCount'))) { $this->setConfigParam('iPicCount', 12); } if (is_null($this->getConfigParam('iZoomPicCount'))) { $this->setConfigParam('iZoomPicCount', 4); } if (is_null($this->getConfigParam('iDebug'))) { $this->setConfigParam('iDebug', $this->isProductiveMode() ? 0 : -1); } $this->setConfigParam('sCoreDir', __DIR__ . DIRECTORY_SEPARATOR); }
php
protected function _setDefaults() { $this->setConfigParam('sTheme', 'azure'); if (is_null($this->getConfigParam('sDefaultLang'))) { $this->setConfigParam('sDefaultLang', 0); } if (is_null($this->getConfigParam('blLogChangesInAdmin'))) { $this->setConfigParam('blLogChangesInAdmin', false); } if (is_null($this->getConfigParam('blCheckTemplates'))) { $this->setConfigParam('blCheckTemplates', false); } if (is_null($this->getConfigParam('blAllowArticlesubclass'))) { $this->setConfigParam('blAllowArticlesubclass', false); } if (is_null($this->getConfigParam('iAdminListSize'))) { $this->setConfigParam('iAdminListSize', 9); } // #1173M for EE - not all pic are deleted if (is_null($this->getConfigParam('iPicCount'))) { $this->setConfigParam('iPicCount', 12); } if (is_null($this->getConfigParam('iZoomPicCount'))) { $this->setConfigParam('iZoomPicCount', 4); } if (is_null($this->getConfigParam('iDebug'))) { $this->setConfigParam('iDebug', $this->isProductiveMode() ? 0 : -1); } $this->setConfigParam('sCoreDir', __DIR__ . DIRECTORY_SEPARATOR); }
[ "protected", "function", "_setDefaults", "(", ")", "{", "$", "this", "->", "setConfigParam", "(", "'sTheme'", ",", "'azure'", ")", ";", "if", "(", "is_null", "(", "$", "this", "->", "getConfigParam", "(", "'sDefaultLang'", ")", ")", ")", "{", "$", "this"...
Set important defaults.
[ "Set", "important", "defaults", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L487-L525
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config._loadVarsFromDb
protected function _loadVarsFromDb($shopID, $onlyVars = null, $module = '') { $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $moduleSql = $module ? " oxmodule LIKE " . $db->quote($module . "%") : " oxmodule='' "; $onlyVarsSql = $this->_getConfigParamsSelectSnippet($onlyVars); $select = "select oxvarname, oxvartype, " . $this->getDecodeValueQuery() . " as oxvarvalue from oxconfig where oxshopid = '$shopID' and " . $moduleSql . $onlyVarsSql; $result = $db->getAll($select); foreach ($result as $value) { $varName = $value[0]; $varType = $value[1]; $varVal = $value[2]; $this->_setConfVarFromDb($varName, $varType, $varVal); //setting theme options array if ($module) { $this->_aThemeConfigParams[$varName] = $module; } } return (bool) count($result); }
php
protected function _loadVarsFromDb($shopID, $onlyVars = null, $module = '') { $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $moduleSql = $module ? " oxmodule LIKE " . $db->quote($module . "%") : " oxmodule='' "; $onlyVarsSql = $this->_getConfigParamsSelectSnippet($onlyVars); $select = "select oxvarname, oxvartype, " . $this->getDecodeValueQuery() . " as oxvarvalue from oxconfig where oxshopid = '$shopID' and " . $moduleSql . $onlyVarsSql; $result = $db->getAll($select); foreach ($result as $value) { $varName = $value[0]; $varType = $value[1]; $varVal = $value[2]; $this->_setConfVarFromDb($varName, $varType, $varVal); //setting theme options array if ($module) { $this->_aThemeConfigParams[$varName] = $module; } } return (bool) count($result); }
[ "protected", "function", "_loadVarsFromDb", "(", "$", "shopID", ",", "$", "onlyVars", "=", "null", ",", "$", "module", "=", "''", ")", "{", "$", "db", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", "...
Load config values from DB @param string $shopID shop ID to load parameters @param array $onlyVars array of params to load (optional) @param string $module module vars to load, empty for base options @return bool
[ "Load", "config", "values", "from", "DB" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L547-L575
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config._getConfigParamsSelectSnippet
protected function _getConfigParamsSelectSnippet($vars) { $select = ''; if (is_array($vars) && !empty($vars)) { foreach ($vars as &$field) { $field = '"' . $field . '"'; } $select = ' and oxvarname in ( ' . implode(', ', $vars) . ' ) '; } return $select; }
php
protected function _getConfigParamsSelectSnippet($vars) { $select = ''; if (is_array($vars) && !empty($vars)) { foreach ($vars as &$field) { $field = '"' . $field . '"'; } $select = ' and oxvarname in ( ' . implode(', ', $vars) . ' ) '; } return $select; }
[ "protected", "function", "_getConfigParamsSelectSnippet", "(", "$", "vars", ")", "{", "$", "select", "=", "''", ";", "if", "(", "is_array", "(", "$", "vars", ")", "&&", "!", "empty", "(", "$", "vars", ")", ")", "{", "foreach", "(", "$", "vars", "as",...
Allow loading from some vars only from baseshop @param array $vars @return string
[ "Allow", "loading", "from", "some", "vars", "only", "from", "baseshop" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L584-L595
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config._setConfVarFromDb
protected function _setConfVarFromDb($varName, $varType, $varVal) { if (($varName == 'sShopURL' || $varName == 'sSSLShopURL') && (!$varVal || $this->isAdmin() === true) ) { return; } switch ($varType) { case 'arr': case 'aarr': $this->setConfigParam($varName, unserialize($varVal)); break; case 'bool': $this->setConfigParam($varName, ($varVal == 'true' || $varVal == '1')); break; default: $this->setConfigParam($varName, $varVal); break; } }
php
protected function _setConfVarFromDb($varName, $varType, $varVal) { if (($varName == 'sShopURL' || $varName == 'sSSLShopURL') && (!$varVal || $this->isAdmin() === true) ) { return; } switch ($varType) { case 'arr': case 'aarr': $this->setConfigParam($varName, unserialize($varVal)); break; case 'bool': $this->setConfigParam($varName, ($varVal == 'true' || $varVal == '1')); break; default: $this->setConfigParam($varName, $varVal); break; } }
[ "protected", "function", "_setConfVarFromDb", "(", "$", "varName", ",", "$", "varType", ",", "$", "varVal", ")", "{", "if", "(", "(", "$", "varName", "==", "'sShopURL'", "||", "$", "varName", "==", "'sSSLShopURL'", ")", "&&", "(", "!", "$", "varVal", "...
Sets config variable to config object, first unserializing it by given type. sShopURL and sSSLShopURL are skipped for admin or when URL values are not set @param string $varName variable name @param string $varType variable type - arr, aarr, bool or str @param string $varVal serialized by type value @return null
[ "Sets", "config", "variable", "to", "config", "object", "first", "unserializing", "it", "by", "given", "type", ".", "sShopURL", "and", "sSSLShopURL", "are", "skipped", "for", "admin", "or", "when", "URL", "values", "are", "not", "set" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L607-L627
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getRequestControllerClass
public function getRequestControllerClass() { $controllerId = $this->getRequestControllerId(); $controllerClass = Registry::getControllerClassNameResolver()->getClassNameById($controllerId); return $controllerClass; }
php
public function getRequestControllerClass() { $controllerId = $this->getRequestControllerId(); $controllerClass = Registry::getControllerClassNameResolver()->getClassNameById($controllerId); return $controllerClass; }
[ "public", "function", "getRequestControllerClass", "(", ")", "{", "$", "controllerId", "=", "$", "this", "->", "getRequestControllerId", "(", ")", ";", "$", "controllerClass", "=", "Registry", "::", "getControllerClassNameResolver", "(", ")", "->", "getClassNameById...
Use this function to get the controller class hidden behind the request's 'cl' parameter. @return mixed
[ "Use", "this", "function", "to", "get", "the", "controller", "class", "hidden", "behind", "the", "request", "s", "cl", "parameter", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L708-L714
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getGlobalParameter
public function getGlobalParameter($name) { if (isset($this->_aGlobalParams[$name])) { return $this->_aGlobalParams[$name]; } else { return null; } }
php
public function getGlobalParameter($name) { if (isset($this->_aGlobalParams[$name])) { return $this->_aGlobalParams[$name]; } else { return null; } }
[ "public", "function", "getGlobalParameter", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_aGlobalParams", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "_aGlobalParams", "[", "$", "name", "]", ";", "}"...
Returns global parameter value @param string $name name of cached parameter @return mixed
[ "Returns", "global", "parameter", "value" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L746-L753
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getShopId
public function getShopId() { if (is_null($this->_iShopId)) { $shopId = $this->calculateActiveShopId(); $this->setShopId($shopId); if (!$this->_isValidShopId($shopId)) { $shopId = $this->getBaseShopId(); } $this->setShopId($shopId); } return $this->_iShopId; }
php
public function getShopId() { if (is_null($this->_iShopId)) { $shopId = $this->calculateActiveShopId(); $this->setShopId($shopId); if (!$this->_isValidShopId($shopId)) { $shopId = $this->getBaseShopId(); } $this->setShopId($shopId); } return $this->_iShopId; }
[ "public", "function", "getShopId", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "_iShopId", ")", ")", "{", "$", "shopId", "=", "$", "this", "->", "calculateActiveShopId", "(", ")", ";", "$", "this", "->", "setShopId", "(", "$", "shopI...
Returns active shop ID. @return int
[ "Returns", "active", "shop", "ID", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L785-L798
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config._checkSsl
protected function _checkSsl() { $myUtilsServer = Registry::getUtilsServer(); $serverVars = $myUtilsServer->getServerVar(); $httpsServerVar = $myUtilsServer->getServerVar('HTTPS'); $this->setIsSsl(); if (isset($httpsServerVar) && ($httpsServerVar === 'on' || $httpsServerVar === 'ON' || $httpsServerVar == '1')) { // "1&1" hoster provides "1" $this->setIsSsl($this->getConfigParam('sSSLShopURL') || $this->getConfigParam('sMallSSLShopURL')); if ($this->isAdmin() && !$this->_blIsSsl) { //#4026 $this->setIsSsl(!is_null($this->getConfigParam('sAdminSSLURL'))); } } //additional special handling for profihost customers if (isset($serverVars['HTTP_X_FORWARDED_SERVER']) && (strpos($serverVars['HTTP_X_FORWARDED_SERVER'], 'ssl') !== false || strpos($serverVars['HTTP_X_FORWARDED_SERVER'], 'secure-online-shopping.de') !== false) ) { $this->setIsSsl(true); } }
php
protected function _checkSsl() { $myUtilsServer = Registry::getUtilsServer(); $serverVars = $myUtilsServer->getServerVar(); $httpsServerVar = $myUtilsServer->getServerVar('HTTPS'); $this->setIsSsl(); if (isset($httpsServerVar) && ($httpsServerVar === 'on' || $httpsServerVar === 'ON' || $httpsServerVar == '1')) { // "1&1" hoster provides "1" $this->setIsSsl($this->getConfigParam('sSSLShopURL') || $this->getConfigParam('sMallSSLShopURL')); if ($this->isAdmin() && !$this->_blIsSsl) { //#4026 $this->setIsSsl(!is_null($this->getConfigParam('sAdminSSLURL'))); } } //additional special handling for profihost customers if (isset($serverVars['HTTP_X_FORWARDED_SERVER']) && (strpos($serverVars['HTTP_X_FORWARDED_SERVER'], 'ssl') !== false || strpos($serverVars['HTTP_X_FORWARDED_SERVER'], 'secure-online-shopping.de') !== false) ) { $this->setIsSsl(true); } }
[ "protected", "function", "_checkSsl", "(", ")", "{", "$", "myUtilsServer", "=", "Registry", "::", "getUtilsServer", "(", ")", ";", "$", "serverVars", "=", "$", "myUtilsServer", "->", "getServerVar", "(", ")", ";", "$", "httpsServerVar", "=", "$", "myUtilsSer...
Checks if WEB session is SSL.
[ "Checks", "if", "WEB", "session", "is", "SSL", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L813-L836
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.isCurrentProtocol
public function isCurrentProtocol($url) { // Missing protocol, cannot proceed, assuming true. if (!$url || (strpos($url, "http") !== 0)) { return true; } return (strpos($url, "https:") === 0) == $this->isSsl(); }
php
public function isCurrentProtocol($url) { // Missing protocol, cannot proceed, assuming true. if (!$url || (strpos($url, "http") !== 0)) { return true; } return (strpos($url, "https:") === 0) == $this->isSsl(); }
[ "public", "function", "isCurrentProtocol", "(", "$", "url", ")", "{", "// Missing protocol, cannot proceed, assuming true.", "if", "(", "!", "$", "url", "||", "(", "strpos", "(", "$", "url", ",", "\"http\"", ")", "!==", "0", ")", ")", "{", "return", "true", ...
Compares current protocol to supplied url string @param string $url URL @return bool true if $url is equal to current page URL
[ "Compares", "current", "protocol", "to", "supplied", "url", "string" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L885-L893
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getShopUrl
public function getShopUrl($lang = null, $admin = null) { $url = null; $admin = isset($admin) ? $admin : $this->isAdmin(); if (!$admin) { $url = $this->getShopUrlByLanguage($lang); if (!$url) { $url = $this->getMallShopUrl(); } } if (!$url) { $url = $this->getConfigParam('sShopURL'); } return $url; }
php
public function getShopUrl($lang = null, $admin = null) { $url = null; $admin = isset($admin) ? $admin : $this->isAdmin(); if (!$admin) { $url = $this->getShopUrlByLanguage($lang); if (!$url) { $url = $this->getMallShopUrl(); } } if (!$url) { $url = $this->getConfigParam('sShopURL'); } return $url; }
[ "public", "function", "getShopUrl", "(", "$", "lang", "=", "null", ",", "$", "admin", "=", "null", ")", "{", "$", "url", "=", "null", ";", "$", "admin", "=", "isset", "(", "$", "admin", ")", "?", "$", "admin", ":", "$", "this", "->", "isAdmin", ...
Returns config sShopURL or sMallShopURL if secondary shop @param int $lang language @param bool $admin if set true, function returns shop url without checking language/subshops for different url. @return string
[ "Returns", "config", "sShopURL", "or", "sMallShopURL", "if", "secondary", "shop" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L903-L920
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getSslShopUrl
public function getSslShopUrl($lang = null) { $url = $this->getShopUrlByLanguage($lang, true); if (!$url) { $url = $this->getMallShopUrl(true); } if (!$url) { $url = $this->getMallShopUrl(); } //normal section if (!$url) { $url = $this->getConfigParam('sSSLShopURL'); } if (!$url) { $url = $this->getShopUrl($lang); } return $url; }
php
public function getSslShopUrl($lang = null) { $url = $this->getShopUrlByLanguage($lang, true); if (!$url) { $url = $this->getMallShopUrl(true); } if (!$url) { $url = $this->getMallShopUrl(); } //normal section if (!$url) { $url = $this->getConfigParam('sSSLShopURL'); } if (!$url) { $url = $this->getShopUrl($lang); } return $url; }
[ "public", "function", "getSslShopUrl", "(", "$", "lang", "=", "null", ")", "{", "$", "url", "=", "$", "this", "->", "getShopUrlByLanguage", "(", "$", "lang", ",", "true", ")", ";", "if", "(", "!", "$", "url", ")", "{", "$", "url", "=", "$", "this...
Returns config sSSLShopURL or sMallSSLShopURL if secondary shop @param int $lang language (default is null) @return string
[ "Returns", "config", "sSSLShopURL", "or", "sMallSSLShopURL", "if", "secondary", "shop" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L929-L951
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getShopCurrentUrl
public function getShopCurrentUrl($lang = null) { if ($this->isSsl()) { $url = $this->getSSLShopURL($lang); } else { $url = $this->getShopURL($lang); } return Registry::getUtilsUrl()->processUrl($url . 'index.php', false); }
php
public function getShopCurrentUrl($lang = null) { if ($this->isSsl()) { $url = $this->getSSLShopURL($lang); } else { $url = $this->getShopURL($lang); } return Registry::getUtilsUrl()->processUrl($url . 'index.php', false); }
[ "public", "function", "getShopCurrentUrl", "(", "$", "lang", "=", "null", ")", "{", "if", "(", "$", "this", "->", "isSsl", "(", ")", ")", "{", "$", "url", "=", "$", "this", "->", "getSSLShopURL", "(", "$", "lang", ")", ";", "}", "else", "{", "$",...
Returns SSL or not SSL shop URL with index.php and sid @param int $lang language (optional) @return string
[ "Returns", "SSL", "or", "not", "SSL", "shop", "URL", "with", "index", ".", "php", "and", "sid" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L999-L1008
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getShopHomeUrl
public function getShopHomeUrl($lang = null, $admin = null) { return Registry::getUtilsUrl()->processUrl($this->getShopUrl($lang, $admin) . 'index.php', false); }
php
public function getShopHomeUrl($lang = null, $admin = null) { return Registry::getUtilsUrl()->processUrl($this->getShopUrl($lang, $admin) . 'index.php', false); }
[ "public", "function", "getShopHomeUrl", "(", "$", "lang", "=", "null", ",", "$", "admin", "=", "null", ")", "{", "return", "Registry", "::", "getUtilsUrl", "(", ")", "->", "processUrl", "(", "$", "this", "->", "getShopUrl", "(", "$", "lang", ",", "$", ...
Returns shop non SSL URL including index.php and sid. @param int $lang language @param bool $admin if admin @return string
[ "Returns", "shop", "non", "SSL", "URL", "including", "index", ".", "php", "and", "sid", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1018-L1021
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getWidgetUrl
public function getWidgetUrl($languageId = null, $inAdmin = null, $urlParameters = []) { $utilsUrl = Registry::getUtilsUrl(); $widgetUrl = $this->isSsl() ? $this->getSslShopUrl($languageId) : $this->getShopUrl($languageId, $inAdmin); $widgetUrl = $utilsUrl->processUrl($widgetUrl . 'widget.php', false); if (!isset($languageId)) { $language = Registry::getLang(); $languageId = $language->getBaseLanguage(); } $urlLang = $utilsUrl->getUrlLanguageParameter($languageId); $widgetUrl = $utilsUrl->appendUrl($widgetUrl, $urlLang, true); $widgetUrl = $utilsUrl->appendUrl($widgetUrl, $urlParameters, true, true); return $widgetUrl; }
php
public function getWidgetUrl($languageId = null, $inAdmin = null, $urlParameters = []) { $utilsUrl = Registry::getUtilsUrl(); $widgetUrl = $this->isSsl() ? $this->getSslShopUrl($languageId) : $this->getShopUrl($languageId, $inAdmin); $widgetUrl = $utilsUrl->processUrl($widgetUrl . 'widget.php', false); if (!isset($languageId)) { $language = Registry::getLang(); $languageId = $language->getBaseLanguage(); } $urlLang = $utilsUrl->getUrlLanguageParameter($languageId); $widgetUrl = $utilsUrl->appendUrl($widgetUrl, $urlLang, true); $widgetUrl = $utilsUrl->appendUrl($widgetUrl, $urlParameters, true, true); return $widgetUrl; }
[ "public", "function", "getWidgetUrl", "(", "$", "languageId", "=", "null", ",", "$", "inAdmin", "=", "null", ",", "$", "urlParameters", "=", "[", "]", ")", "{", "$", "utilsUrl", "=", "Registry", "::", "getUtilsUrl", "(", ")", ";", "$", "widgetUrl", "="...
Returns widget start non SSL URL including widget.php and sid. @param int $languageId language @param bool $inAdmin if admin @param array $urlParameters parameters which should be added to URL. @return string
[ "Returns", "widget", "start", "non", "SSL", "URL", "including", "widget", ".", "php", "and", "sid", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1032-L1048
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getShopCurrency
public function getShopCurrency() { if ((null === ($curr = $this->getRequestParameter('cur')))) { if (null === ($curr = $this->getRequestParameter('currency'))) { $curr = $this->getSession()->getVariable('currency'); } } return (int) $curr; }
php
public function getShopCurrency() { if ((null === ($curr = $this->getRequestParameter('cur')))) { if (null === ($curr = $this->getRequestParameter('currency'))) { $curr = $this->getSession()->getVariable('currency'); } } return (int) $curr; }
[ "public", "function", "getShopCurrency", "(", ")", "{", "if", "(", "(", "null", "===", "(", "$", "curr", "=", "$", "this", "->", "getRequestParameter", "(", "'cur'", ")", ")", ")", ")", "{", "if", "(", "null", "===", "(", "$", "curr", "=", "$", "...
Returns active shop currency. @return string
[ "Returns", "active", "shop", "currency", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1065-L1074
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getActShopCurrencyObject
public function getActShopCurrencyObject() { if ($this->_oActCurrencyObject === null) { $cur = $this->getShopCurrency(); $currencies = $this->getCurrencyArray(); if (!isset($currencies[$cur])) { $this->_oActCurrencyObject = reset($currencies); // reset() returns the first element } else { $this->_oActCurrencyObject = $currencies[$cur]; } } return $this->_oActCurrencyObject; }
php
public function getActShopCurrencyObject() { if ($this->_oActCurrencyObject === null) { $cur = $this->getShopCurrency(); $currencies = $this->getCurrencyArray(); if (!isset($currencies[$cur])) { $this->_oActCurrencyObject = reset($currencies); // reset() returns the first element } else { $this->_oActCurrencyObject = $currencies[$cur]; } } return $this->_oActCurrencyObject; }
[ "public", "function", "getActShopCurrencyObject", "(", ")", "{", "if", "(", "$", "this", "->", "_oActCurrencyObject", "===", "null", ")", "{", "$", "cur", "=", "$", "this", "->", "getShopCurrency", "(", ")", ";", "$", "currencies", "=", "$", "this", "->"...
Returns active shop currency object. @return object
[ "Returns", "active", "shop", "currency", "object", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1081-L1094
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.setActShopCurrency
public function setActShopCurrency($cur) { $currencies = $this->getCurrencyArray(); if (isset($currencies[$cur])) { $this->getSession()->setVariable('currency', $cur); $this->_oActCurrencyObject = null; } }
php
public function setActShopCurrency($cur) { $currencies = $this->getCurrencyArray(); if (isset($currencies[$cur])) { $this->getSession()->setVariable('currency', $cur); $this->_oActCurrencyObject = null; } }
[ "public", "function", "setActShopCurrency", "(", "$", "cur", ")", "{", "$", "currencies", "=", "$", "this", "->", "getCurrencyArray", "(", ")", ";", "if", "(", "isset", "(", "$", "currencies", "[", "$", "cur", "]", ")", ")", "{", "$", "this", "->", ...
Sets the actual currency @param int $cur 0 = EUR, 1 = GBP, 2 = CHF
[ "Sets", "the", "actual", "currency" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1101-L1108
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getOutDir
public function getOutDir($absolute = true) { if ($absolute) { return $this->getConfigParam('sShopDir') . $this->_sOutDir . '/'; } else { return $this->_sOutDir . '/'; } }
php
public function getOutDir($absolute = true) { if ($absolute) { return $this->getConfigParam('sShopDir') . $this->_sOutDir . '/'; } else { return $this->_sOutDir . '/'; } }
[ "public", "function", "getOutDir", "(", "$", "absolute", "=", "true", ")", "{", "if", "(", "$", "absolute", ")", "{", "return", "$", "this", "->", "getConfigParam", "(", "'sShopDir'", ")", ".", "$", "this", "->", "_sOutDir", ".", "'/'", ";", "}", "el...
Returns path to out dir @param bool $absolute mode - absolute/relative path @return string
[ "Returns", "path", "to", "out", "dir" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1117-L1124
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getTranslationsDir
public function getTranslationsDir($file, $dir, $absolute = true) { $path = $absolute ? $this->getConfigParam('sShopDir') : ''; $path .= 'Application/translations/'; if (is_readable($path . $dir . '/' . $file)) { return $path . $dir . '/' . $file; } return false; }
php
public function getTranslationsDir($file, $dir, $absolute = true) { $path = $absolute ? $this->getConfigParam('sShopDir') : ''; $path .= 'Application/translations/'; if (is_readable($path . $dir . '/' . $file)) { return $path . $dir . '/' . $file; } return false; }
[ "public", "function", "getTranslationsDir", "(", "$", "file", ",", "$", "dir", ",", "$", "absolute", "=", "true", ")", "{", "$", "path", "=", "$", "absolute", "?", "$", "this", "->", "getConfigParam", "(", "'sShopDir'", ")", ":", "''", ";", "$", "pat...
Returns path to translations dir @param string $file File name @param string $dir Directory name @param bool $absolute mode - absolute/relative path @return string
[ "Returns", "path", "to", "translations", "dir" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1151-L1160
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getOutUrl
public function getOutUrl($ssl = null, $admin = null, $nativeImg = false) { $ssl = is_null($ssl) ? $this->isSsl() : $ssl; $admin = is_null($admin) ? $this->isAdmin() : $admin; if ($ssl) { if ($nativeImg && !$admin) { $url = $this->getSslShopUrl(); } else { $url = $this->getConfigParam('sSSLShopURL'); if (!$url && $admin) { $url = $this->getConfigParam('sAdminSSLURL') . '../'; } } } else { $url = ($nativeImg && !$admin) ? $this->getShopUrl() : $this->getConfigParam('sShopURL'); } return $url . $this->_sOutDir . '/'; }
php
public function getOutUrl($ssl = null, $admin = null, $nativeImg = false) { $ssl = is_null($ssl) ? $this->isSsl() : $ssl; $admin = is_null($admin) ? $this->isAdmin() : $admin; if ($ssl) { if ($nativeImg && !$admin) { $url = $this->getSslShopUrl(); } else { $url = $this->getConfigParam('sSSLShopURL'); if (!$url && $admin) { $url = $this->getConfigParam('sAdminSSLURL') . '../'; } } } else { $url = ($nativeImg && !$admin) ? $this->getShopUrl() : $this->getConfigParam('sShopURL'); } return $url . $this->_sOutDir . '/'; }
[ "public", "function", "getOutUrl", "(", "$", "ssl", "=", "null", ",", "$", "admin", "=", "null", ",", "$", "nativeImg", "=", "false", ")", "{", "$", "ssl", "=", "is_null", "(", "$", "ssl", ")", "?", "$", "this", "->", "isSsl", "(", ")", ":", "$...
Returns url to out dir @param bool $ssl Whether to force ssl @param bool $admin Whether to force admin @param bool $nativeImg Whether to force native image dirs @return string
[ "Returns", "url", "to", "out", "dir" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1187-L1206
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getUrl
public function getUrl($file, $dir, $admin = null, $ssl = null, $nativeImg = false, $lang = null, $shop = null, $theme = null) { return str_replace( $this->getOutDir(), $this->getOutUrl($ssl, $admin, $nativeImg), $this->getDir($file, $dir, $admin, $lang, $shop, $theme) ); }
php
public function getUrl($file, $dir, $admin = null, $ssl = null, $nativeImg = false, $lang = null, $shop = null, $theme = null) { return str_replace( $this->getOutDir(), $this->getOutUrl($ssl, $admin, $nativeImg), $this->getDir($file, $dir, $admin, $lang, $shop, $theme) ); }
[ "public", "function", "getUrl", "(", "$", "file", ",", "$", "dir", ",", "$", "admin", "=", "null", ",", "$", "ssl", "=", "null", ",", "$", "nativeImg", "=", "false", ",", "$", "lang", "=", "null", ",", "$", "shop", "=", "null", ",", "$", "theme...
Finds and returns file or folder url in out dir @param string $file File name @param string $dir Directory name @param bool $admin Whether to force admin @param bool $ssl Whether to force ssl @param bool $nativeImg Whether to force native image dirs @param int $lang Language id @param int $shop Shop id @param string $theme Theme name @return string
[ "Finds", "and", "returns", "file", "or", "folder", "url", "in", "out", "dir" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1354-L1361
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getImagePath
public function getImagePath($file, $admin = false) { return $this->getDir($file, $this->_sImageDir, $admin); }
php
public function getImagePath($file, $admin = false) { return $this->getDir($file, $this->_sImageDir, $admin); }
[ "public", "function", "getImagePath", "(", "$", "file", ",", "$", "admin", "=", "false", ")", "{", "return", "$", "this", "->", "getDir", "(", "$", "file", ",", "$", "this", "->", "_sImageDir", ",", "$", "admin", ")", ";", "}" ]
Finds and returns image files or folders path @param string $file File name @param bool $admin Whether to force admin @return string
[ "Finds", "and", "returns", "image", "files", "or", "folders", "path" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1371-L1374
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getImageUrl
public function getImageUrl($admin = false, $ssl = null, $nativeImg = null, $file = null) { $nativeImg = is_null($nativeImg) ? $this->getConfigParam('blNativeImages') : $nativeImg; return $this->getUrl($file, $this->_sImageDir, $admin, $ssl, $nativeImg); }
php
public function getImageUrl($admin = false, $ssl = null, $nativeImg = null, $file = null) { $nativeImg = is_null($nativeImg) ? $this->getConfigParam('blNativeImages') : $nativeImg; return $this->getUrl($file, $this->_sImageDir, $admin, $ssl, $nativeImg); }
[ "public", "function", "getImageUrl", "(", "$", "admin", "=", "false", ",", "$", "ssl", "=", "null", ",", "$", "nativeImg", "=", "null", ",", "$", "file", "=", "null", ")", "{", "$", "nativeImg", "=", "is_null", "(", "$", "nativeImg", ")", "?", "$",...
Finds and returns image folder url @param bool $admin Whether to force admin @param bool $ssl Whether to force ssl @param bool $nativeImg Whether to force native image dirs @param string $file Image file name @return string
[ "Finds", "and", "returns", "image", "folder", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1386-L1391
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getPicturePath
public function getPicturePath($file, $admin = false, $lang = null, $shop = null, $theme = null) { return $this->getDir($file, $this->_sPictureDir, $admin, $lang, $shop, $theme); }
php
public function getPicturePath($file, $admin = false, $lang = null, $shop = null, $theme = null) { return $this->getDir($file, $this->_sPictureDir, $admin, $lang, $shop, $theme); }
[ "public", "function", "getPicturePath", "(", "$", "file", ",", "$", "admin", "=", "false", ",", "$", "lang", "=", "null", ",", "$", "shop", "=", "null", ",", "$", "theme", "=", "null", ")", "{", "return", "$", "this", "->", "getDir", "(", "$", "f...
Finds and returns product pictures files or folders path @param string $file File name @param bool $admin Whether to force admin @param int $lang Language @param int $shop Shop id @param string $theme theme name @return string
[ "Finds", "and", "returns", "product", "pictures", "files", "or", "folders", "path" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1416-L1419
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getMasterPictureDir
public function getMasterPictureDir($admin = false) { return $this->getDir(null, $this->_sPictureDir . "/" . $this->_sMasterPictureDir, $admin); }
php
public function getMasterPictureDir($admin = false) { return $this->getDir(null, $this->_sPictureDir . "/" . $this->_sMasterPictureDir, $admin); }
[ "public", "function", "getMasterPictureDir", "(", "$", "admin", "=", "false", ")", "{", "return", "$", "this", "->", "getDir", "(", "null", ",", "$", "this", "->", "_sPictureDir", ".", "\"/\"", ".", "$", "this", "->", "_sMasterPictureDir", ",", "$", "adm...
Finds and returns master pictures folder path @param bool $admin Whether to force admin @return string
[ "Finds", "and", "returns", "master", "pictures", "folder", "path" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1428-L1431
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getMasterPicturePath
public function getMasterPicturePath($file, $admin = false) { return $this->getDir($file, $this->_sPictureDir . "/" . $this->_sMasterPictureDir, $admin); }
php
public function getMasterPicturePath($file, $admin = false) { return $this->getDir($file, $this->_sPictureDir . "/" . $this->_sMasterPictureDir, $admin); }
[ "public", "function", "getMasterPicturePath", "(", "$", "file", ",", "$", "admin", "=", "false", ")", "{", "return", "$", "this", "->", "getDir", "(", "$", "file", ",", "$", "this", "->", "_sPictureDir", ".", "\"/\"", ".", "$", "this", "->", "_sMasterP...
Finds and returns master picture path @param string $file File name @param bool $admin Whether to force admin @return string
[ "Finds", "and", "returns", "master", "picture", "path" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1441-L1444
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getPictureUrl
public function getPictureUrl($file, $admin = false, $ssl = null, $lang = null, $shopId = null, $defPic = "master/nopic.jpg") { if ($altUrl = Registry::getPictureHandler()->getAltImageUrl('', $file, $ssl)) { return $altUrl; } $nativeImg = $this->getConfigParam('blNativeImages'); $url = $this->getUrl($file, $this->_sPictureDir, $admin, $ssl, $nativeImg, $lang, $shopId); //anything is better than empty name, because <img src=""> calls shop once more = x2 SLOW. if (!$url && $defPic) { $url = $this->getUrl($defPic, $this->_sPictureDir, $admin, $ssl, $nativeImg, $lang, $shopId); } return $url; }
php
public function getPictureUrl($file, $admin = false, $ssl = null, $lang = null, $shopId = null, $defPic = "master/nopic.jpg") { if ($altUrl = Registry::getPictureHandler()->getAltImageUrl('', $file, $ssl)) { return $altUrl; } $nativeImg = $this->getConfigParam('blNativeImages'); $url = $this->getUrl($file, $this->_sPictureDir, $admin, $ssl, $nativeImg, $lang, $shopId); //anything is better than empty name, because <img src=""> calls shop once more = x2 SLOW. if (!$url && $defPic) { $url = $this->getUrl($defPic, $this->_sPictureDir, $admin, $ssl, $nativeImg, $lang, $shopId); } return $url; }
[ "public", "function", "getPictureUrl", "(", "$", "file", ",", "$", "admin", "=", "false", ",", "$", "ssl", "=", "null", ",", "$", "lang", "=", "null", ",", "$", "shopId", "=", "null", ",", "$", "defPic", "=", "\"master/nopic.jpg\"", ")", "{", "if", ...
Finds and returns product picture file or folder url @param string $file File name @param bool $admin Whether to force admin @param bool $ssl Whether to force ssl @param int $lang Language @param int $shopId Shop id @param string $defPic Default (nopic) image path ["0/nopic.jpg"] @return string
[ "Finds", "and", "returns", "product", "picture", "file", "or", "folder", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1458-L1473
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getTemplatePath
public function getTemplatePath($templateName, $isAdmin) { $finalTemplatePath = $this->getDir($templateName, $this->_sTemplateDir, $isAdmin); if (!$finalTemplatePath) { $templatePathCalculator = $this->getModuleTemplatePathCalculator(); $templatePathCalculator->setModulesPath($this->getModulesDir()); try { $finalTemplatePath = $templatePathCalculator->calculateModuleTemplatePath($templateName); } catch (Exception $e) { $finalTemplatePath = ''; } } return $finalTemplatePath; }
php
public function getTemplatePath($templateName, $isAdmin) { $finalTemplatePath = $this->getDir($templateName, $this->_sTemplateDir, $isAdmin); if (!$finalTemplatePath) { $templatePathCalculator = $this->getModuleTemplatePathCalculator(); $templatePathCalculator->setModulesPath($this->getModulesDir()); try { $finalTemplatePath = $templatePathCalculator->calculateModuleTemplatePath($templateName); } catch (Exception $e) { $finalTemplatePath = ''; } } return $finalTemplatePath; }
[ "public", "function", "getTemplatePath", "(", "$", "templateName", ",", "$", "isAdmin", ")", "{", "$", "finalTemplatePath", "=", "$", "this", "->", "getDir", "(", "$", "templateName", ",", "$", "this", "->", "_sTemplateDir", ",", "$", "isAdmin", ")", ";", ...
Calculates and returns full path to template. @param string $templateName Template name @param bool $isAdmin Whether to force admin @return string
[ "Calculates", "and", "returns", "full", "path", "to", "template", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1495-L1510
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getTemplateUrl
public function getTemplateUrl($file = null, $admin = false, $ssl = null, $lang = null) { return $this->getShopMainUrl() . $this->getDir($file, $this->_sTemplateDir, $admin, $lang, null, null, false); }
php
public function getTemplateUrl($file = null, $admin = false, $ssl = null, $lang = null) { return $this->getShopMainUrl() . $this->getDir($file, $this->_sTemplateDir, $admin, $lang, null, null, false); }
[ "public", "function", "getTemplateUrl", "(", "$", "file", "=", "null", ",", "$", "admin", "=", "false", ",", "$", "ssl", "=", "null", ",", "$", "lang", "=", "null", ")", "{", "return", "$", "this", "->", "getShopMainUrl", "(", ")", ".", "$", "this"...
Finds and returns template file or folder url @param string $file File name @param bool $admin Whether to force admin @param bool $ssl Whether to force ssl @param int $lang Language id @return string
[ "Finds", "and", "returns", "template", "file", "or", "folder", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1544-L1547
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getTemplateBase
public function getTemplateBase($admin = false) { // Base template dir is the parent dir of template dir return str_replace($this->_sTemplateDir . '/', '', $this->getDir(null, $this->_sTemplateDir, $admin, null, null, null, false)); }
php
public function getTemplateBase($admin = false) { // Base template dir is the parent dir of template dir return str_replace($this->_sTemplateDir . '/', '', $this->getDir(null, $this->_sTemplateDir, $admin, null, null, null, false)); }
[ "public", "function", "getTemplateBase", "(", "$", "admin", "=", "false", ")", "{", "// Base template dir is the parent dir of template dir", "return", "str_replace", "(", "$", "this", "->", "_sTemplateDir", ".", "'/'", ",", "''", ",", "$", "this", "->", "getDir",...
Finds and returns base template folder url @param bool $admin Whether to force admin @return string
[ "Finds", "and", "returns", "base", "template", "folder", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1556-L1560
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getModulesDir
public function getModulesDir($absolute = true) { if ($absolute) { return $this->getConfigParam('sShopDir') . $this->_sModulesDir . '/'; } else { return $this->_sModulesDir . '/'; } }
php
public function getModulesDir($absolute = true) { if ($absolute) { return $this->getConfigParam('sShopDir') . $this->_sModulesDir . '/'; } else { return $this->_sModulesDir . '/'; } }
[ "public", "function", "getModulesDir", "(", "$", "absolute", "=", "true", ")", "{", "if", "(", "$", "absolute", ")", "{", "return", "$", "this", "->", "getConfigParam", "(", "'sShopDir'", ")", ".", "$", "this", "->", "_sModulesDir", ".", "'/'", ";", "}...
Returns path to modules dir @param bool $absolute mode - absolute/relative path @return string
[ "Returns", "path", "to", "modules", "dir" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1582-L1589
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getCurrencyArray
public function getCurrencyArray($currency = null) { $confCurrencies = $this->getConfigParam('aCurrencies'); if (!is_array($confCurrencies)) { return []; } // processing currency configuration data $currencies = []; reset($confCurrencies); foreach ($confCurrencies as $key => $val) { if ($val) { $cur = new stdClass(); $cur->id = $key; $curValues = explode('@', $val); $cur->name = trim($curValues[0]); $cur->rate = trim($curValues[1]); $cur->dec = trim($curValues[2]); $cur->thousand = trim($curValues[3]); $cur->sign = trim($curValues[4]); $cur->decimal = trim($curValues[5]); // change for US version if (isset($curValues[6])) { $cur->side = trim($curValues[6]); } if (isset($currency) && $key == $currency) { $cur->selected = 1; } else { $cur->selected = 0; } $currencies[$key] = $cur; } // #861C - performance, do not load other currencies if (!$this->getConfigParam('bl_perfLoadCurrency')) { break; } } return $currencies; }
php
public function getCurrencyArray($currency = null) { $confCurrencies = $this->getConfigParam('aCurrencies'); if (!is_array($confCurrencies)) { return []; } // processing currency configuration data $currencies = []; reset($confCurrencies); foreach ($confCurrencies as $key => $val) { if ($val) { $cur = new stdClass(); $cur->id = $key; $curValues = explode('@', $val); $cur->name = trim($curValues[0]); $cur->rate = trim($curValues[1]); $cur->dec = trim($curValues[2]); $cur->thousand = trim($curValues[3]); $cur->sign = trim($curValues[4]); $cur->decimal = trim($curValues[5]); // change for US version if (isset($curValues[6])) { $cur->side = trim($curValues[6]); } if (isset($currency) && $key == $currency) { $cur->selected = 1; } else { $cur->selected = 0; } $currencies[$key] = $cur; } // #861C - performance, do not load other currencies if (!$this->getConfigParam('bl_perfLoadCurrency')) { break; } } return $currencies; }
[ "public", "function", "getCurrencyArray", "(", "$", "currency", "=", "null", ")", "{", "$", "confCurrencies", "=", "$", "this", "->", "getConfigParam", "(", "'aCurrencies'", ")", ";", "if", "(", "!", "is_array", "(", "$", "confCurrencies", ")", ")", "{", ...
Returns array of available currencies @param integer $currency Active currency number (default null) @return array
[ "Returns", "array", "of", "available", "currencies" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1627-L1669
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getCurrencyObject
public function getCurrencyObject($name) { $search = $this->getCurrencyArray(); foreach ($search as $cur) { if ($cur->name == $name) { return $cur; } } }
php
public function getCurrencyObject($name) { $search = $this->getCurrencyArray(); foreach ($search as $cur) { if ($cur->name == $name) { return $cur; } } }
[ "public", "function", "getCurrencyObject", "(", "$", "name", ")", "{", "$", "search", "=", "$", "this", "->", "getCurrencyArray", "(", ")", ";", "foreach", "(", "$", "search", "as", "$", "cur", ")", "{", "if", "(", "$", "cur", "->", "name", "==", "...
Returns currency object. @param string $name Name of active currency @return object
[ "Returns", "currency", "object", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1678-L1686
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.getPackageInfo
public function getPackageInfo() { $fileName = $this->getConfigParam('sShopDir') . "/pkg.info"; $rev = @file_get_contents($fileName); $rev = str_replace("\n", "<br>", $rev); if (!$rev) { return false; } return $rev; }
php
public function getPackageInfo() { $fileName = $this->getConfigParam('sShopDir') . "/pkg.info"; $rev = @file_get_contents($fileName); $rev = str_replace("\n", "<br>", $rev); if (!$rev) { return false; } return $rev; }
[ "public", "function", "getPackageInfo", "(", ")", "{", "$", "fileName", "=", "$", "this", "->", "getConfigParam", "(", "'sShopDir'", ")", ".", "\"/pkg.info\"", ";", "$", "rev", "=", "@", "file_get_contents", "(", "$", "fileName", ")", ";", "$", "rev", "=...
Returns build package info file content. @return bool|string
[ "Returns", "build", "package", "info", "file", "content", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1742-L1753
train
OXID-eSales/oxideshop_ce
source/Core/Config.php
Config.saveShopConfVar
public function saveShopConfVar($varType, $varName, $varVal, $shopId = null, $module = '') { switch ($varType) { case 'arr': case 'aarr': $value = serialize($varVal); break; case 'bool': //config param $varVal = (($varVal == 'true' || $varVal) && $varVal && strcasecmp($varVal, "false")); //db value $value = $varVal ? "1" : ""; break; case 'num': //config param $varVal = $varVal != '' ? Registry::getUtils()->string2Float($varVal) : ''; $value = $varVal; break; default: $value = $varVal; break; } if (!$shopId) { $shopId = $this->getShopId(); } // Update value only for current shop if ($shopId == $this->getShopId()) { $this->setConfigParam($varName, $varVal); } $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $shopIdQuoted = $db->quote($shopId); $moduleQuoted = $db->quote($module); $varNameQuoted = $db->quote($varName); $varTypeQuoted = $db->quote($varType); $varValueQuoted = $db->quote($value); $configKeyQuoted = $db->quote($this->getConfigParam('sConfigKey')); $newOXIDdQuoted = $db->quote(\OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID()); $query = "delete from oxconfig where oxshopid = $shopIdQuoted and oxvarname = $varNameQuoted and oxmodule = $moduleQuoted"; $db->execute($query); $query = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue) values($newOXIDdQuoted, $shopIdQuoted, $moduleQuoted, $varNameQuoted, $varTypeQuoted, ENCODE( $varValueQuoted, $configKeyQuoted) )"; $db->execute($query); $this->informServicesAfterConfigurationChanged($varName, $shopId, $module); }
php
public function saveShopConfVar($varType, $varName, $varVal, $shopId = null, $module = '') { switch ($varType) { case 'arr': case 'aarr': $value = serialize($varVal); break; case 'bool': //config param $varVal = (($varVal == 'true' || $varVal) && $varVal && strcasecmp($varVal, "false")); //db value $value = $varVal ? "1" : ""; break; case 'num': //config param $varVal = $varVal != '' ? Registry::getUtils()->string2Float($varVal) : ''; $value = $varVal; break; default: $value = $varVal; break; } if (!$shopId) { $shopId = $this->getShopId(); } // Update value only for current shop if ($shopId == $this->getShopId()) { $this->setConfigParam($varName, $varVal); } $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $shopIdQuoted = $db->quote($shopId); $moduleQuoted = $db->quote($module); $varNameQuoted = $db->quote($varName); $varTypeQuoted = $db->quote($varType); $varValueQuoted = $db->quote($value); $configKeyQuoted = $db->quote($this->getConfigParam('sConfigKey')); $newOXIDdQuoted = $db->quote(\OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID()); $query = "delete from oxconfig where oxshopid = $shopIdQuoted and oxvarname = $varNameQuoted and oxmodule = $moduleQuoted"; $db->execute($query); $query = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue) values($newOXIDdQuoted, $shopIdQuoted, $moduleQuoted, $varNameQuoted, $varTypeQuoted, ENCODE( $varValueQuoted, $configKeyQuoted) )"; $db->execute($query); $this->informServicesAfterConfigurationChanged($varName, $shopId, $module); }
[ "public", "function", "saveShopConfVar", "(", "$", "varType", ",", "$", "varName", ",", "$", "varVal", ",", "$", "shopId", "=", "null", ",", "$", "module", "=", "''", ")", "{", "switch", "(", "$", "varType", ")", "{", "case", "'arr'", ":", "case", ...
Updates or adds new shop configuration parameters to DB. Arrays must be passed not serialized, serialized values are supported just for backward compatibility. @param string $varType Variable Type @param string $varName Variable name @param mixed $varVal Variable value (can be string, integer or array) @param string $shopId Shop ID, default is current shop @param string $module Module name (empty for base options)
[ "Updates", "or", "adds", "new", "shop", "configuration", "parameters", "to", "DB", ".", "Arrays", "must", "be", "passed", "not", "serialized", "serialized", "values", "are", "supported", "just", "for", "backward", "compatibility", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Config.php#L1796-L1845
train