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/ManufacturerMainAjax.php
ManufacturerMainAjax.formManufacturerRemovalQuery
protected function formManufacturerRemovalQuery($articlesToRemove) { return " UPDATE oxarticles SET oxmanufacturerid = null WHERE oxid IN ( " . implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($articlesToRemove)) . ") "; }
php
protected function formManufacturerRemovalQuery($articlesToRemove) { return " UPDATE oxarticles SET oxmanufacturerid = null WHERE oxid IN ( " . implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($articlesToRemove)) . ") "; }
[ "protected", "function", "formManufacturerRemovalQuery", "(", "$", "articlesToRemove", ")", "{", "return", "\"\n UPDATE oxarticles\n SET oxmanufacturerid = null\n WHERE oxid IN ( \"", ".", "implode", "(", "\", \"", ",", "\\", "OxidEsales", "\\", "Eshop"...
Forms and returns query for manufacturers removal. @param array $articlesToRemove Ids of manufacturers which should be removed. @return string
[ "Forms", "and", "returns", "query", "for", "manufacturers", "removal", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ManufacturerMainAjax.php#L134-L140
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ManufacturerMainAjax.php
ManufacturerMainAjax.addManufacturer
public function addManufacturer() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $articleIds = $this->_getActionIds('oxarticles.oxid'); $manufacturerId = $config->getRequestParameter('synchoxid'); if ($config->getRequestParameter('all')) { $articleViewName = $this->_getViewName('oxarticles'); $articleIds = $this->_getAll($this->_addFilter("select $articleViewName.oxid " . $this->_getQuery())); } if ($manufacturerId && $manufacturerId != "-1" && is_array($articleIds)) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = $this->formArticleToManufacturerAdditionQuery($manufacturerId, $articleIds); $database->execute($query); $this->resetCounter("manufacturerArticle", $manufacturerId); } }
php
public function addManufacturer() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $articleIds = $this->_getActionIds('oxarticles.oxid'); $manufacturerId = $config->getRequestParameter('synchoxid'); if ($config->getRequestParameter('all')) { $articleViewName = $this->_getViewName('oxarticles'); $articleIds = $this->_getAll($this->_addFilter("select $articleViewName.oxid " . $this->_getQuery())); } if ($manufacturerId && $manufacturerId != "-1" && is_array($articleIds)) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = $this->formArticleToManufacturerAdditionQuery($manufacturerId, $articleIds); $database->execute($query); $this->resetCounter("manufacturerArticle", $manufacturerId); } }
[ "public", "function", "addManufacturer", "(", ")", "{", "$", "config", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "articleIds", "=", "$", "this", "->", "_getActionIds", "(", "'oxarticles.o...
Adds article to Manufacturer config
[ "Adds", "article", "to", "Manufacturer", "config" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ManufacturerMainAjax.php#L145-L164
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ManufacturerMainAjax.php
ManufacturerMainAjax.formArticleToManufacturerAdditionQuery
protected function formArticleToManufacturerAdditionQuery($manufacturerId, $articlesToAdd) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); return " UPDATE oxarticles SET oxmanufacturerid = " . $database->quote($manufacturerId) . " WHERE oxid IN ( " . implode(", ", $database->quoteArray($articlesToAdd)) . " )"; }
php
protected function formArticleToManufacturerAdditionQuery($manufacturerId, $articlesToAdd) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); return " UPDATE oxarticles SET oxmanufacturerid = " . $database->quote($manufacturerId) . " WHERE oxid IN ( " . implode(", ", $database->quoteArray($articlesToAdd)) . " )"; }
[ "protected", "function", "formArticleToManufacturerAdditionQuery", "(", "$", "manufacturerId", ",", "$", "articlesToAdd", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "re...
Forms and returns query for articles addition to manufacturer. @param string $manufacturerId Manufacturer id. @param array $articlesToAdd Array of article ids to be added to manufacturer. @return string
[ "Forms", "and", "returns", "query", "for", "articles", "addition", "to", "manufacturer", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ManufacturerMainAjax.php#L174-L182
train
OXID-eSales/oxideshop_ce
source/Application/Model/Manufacturer.php
Manufacturer._setRootObjectData
protected function _setRootObjectData() { $this->setId('root'); $this->oxmanufacturers__oxicon = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW); $this->oxmanufacturers__oxtitle = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('BY_MANUFACTURER', $this->getLanguage(), false), \OxidEsales\Eshop\Core\Field::T_RAW); $this->oxmanufacturers__oxshortdesc = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW); return true; }
php
protected function _setRootObjectData() { $this->setId('root'); $this->oxmanufacturers__oxicon = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW); $this->oxmanufacturers__oxtitle = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('BY_MANUFACTURER', $this->getLanguage(), false), \OxidEsales\Eshop\Core\Field::T_RAW); $this->oxmanufacturers__oxshortdesc = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW); return true; }
[ "protected", "function", "_setRootObjectData", "(", ")", "{", "$", "this", "->", "setId", "(", "'root'", ")", ";", "$", "this", "->", "oxmanufacturers__oxicon", "=", "new", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Field", "(", "''", ",", "...
Sets root manufacturer data. Returns true @return bool
[ "Sets", "root", "manufacturer", "data", ".", "Returns", "true" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Manufacturer.php#L158-L166
train
OXID-eSales/oxideshop_ce
source/Application/Model/Manufacturer.php
Manufacturer.getBaseSeoLink
public function getBaseSeoLink($iLang, $iPage = 0) { $oEncoder = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderManufacturer::class); if (!$iPage) { return $oEncoder->getManufacturerUrl($this, $iLang); } return $oEncoder->getManufacturerPageUrl($this, $iPage, $iLang); }
php
public function getBaseSeoLink($iLang, $iPage = 0) { $oEncoder = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderManufacturer::class); if (!$iPage) { return $oEncoder->getManufacturerUrl($this, $iLang); } return $oEncoder->getManufacturerPageUrl($this, $iPage, $iLang); }
[ "public", "function", "getBaseSeoLink", "(", "$", "iLang", ",", "$", "iPage", "=", "0", ")", "{", "$", "oEncoder", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "get", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Appli...
Returns raw manufacturer seo url @param int $iLang language id @param int $iPage page number [optional] @return string
[ "Returns", "raw", "manufacturer", "seo", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Manufacturer.php#L176-L184
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/UserExtend.php
UserExtend.save
public function save() { parent::save(); $soxId = $this->getEditObjectId(); if (!$this->_allowAdminEdit($soxId)) { return false; } $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($soxId != "-1") { $oUser->load($soxId); } else { $aParams['oxuser__oxid'] = null; } // checkbox handling $aParams['oxuser__oxactive'] = $oUser->oxuser__oxactive->value; $blNewsParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editnews"); if (isset($blNewsParams)) { $oNewsSubscription = $oUser->getNewsSubscription(); $oNewsSubscription->setOptInStatus((int) $blNewsParams); $oNewsSubscription->setOptInEmailStatus((int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("emailfailed")); } $oUser->assign($aParams); $oUser->save(); // set oxid if inserted $this->setEditObjectId($oUser->getId()); }
php
public function save() { parent::save(); $soxId = $this->getEditObjectId(); if (!$this->_allowAdminEdit($soxId)) { return false; } $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($soxId != "-1") { $oUser->load($soxId); } else { $aParams['oxuser__oxid'] = null; } // checkbox handling $aParams['oxuser__oxactive'] = $oUser->oxuser__oxactive->value; $blNewsParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editnews"); if (isset($blNewsParams)) { $oNewsSubscription = $oUser->getNewsSubscription(); $oNewsSubscription->setOptInStatus((int) $blNewsParams); $oNewsSubscription->setOptInEmailStatus((int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("emailfailed")); } $oUser->assign($aParams); $oUser->save(); // set oxid if inserted $this->setEditObjectId($oUser->getId()); }
[ "public", "function", "save", "(", ")", "{", "parent", "::", "save", "(", ")", ";", "$", "soxId", "=", "$", "this", "->", "getEditObjectId", "(", ")", ";", "if", "(", "!", "$", "this", "->", "_allowAdminEdit", "(", "$", "soxId", ")", ")", "{", "r...
Saves user extended information. @return mixed
[ "Saves", "user", "extended", "information", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/UserExtend.php#L55-L89
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails._getParentProduct
protected function _getParentProduct($sParentId) { if ($sParentId && $this->_oParentProd === null) { $this->_oParentProd = false; $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if (($oProduct->load($sParentId))) { $this->_processProduct($oProduct); $this->_oParentProd = $oProduct; } } return $this->_oParentProd; }
php
protected function _getParentProduct($sParentId) { if ($sParentId && $this->_oParentProd === null) { $this->_oParentProd = false; $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if (($oProduct->load($sParentId))) { $this->_processProduct($oProduct); $this->_oParentProd = $oProduct; } } return $this->_oParentProd; }
[ "protected", "function", "_getParentProduct", "(", "$", "sParentId", ")", "{", "if", "(", "$", "sParentId", "&&", "$", "this", "->", "_oParentProd", "===", "null", ")", "{", "$", "this", "->", "_oParentProd", "=", "false", ";", "$", "oProduct", "=", "oxN...
Returns current product parent article object if it is available. @param string $sParentId parent product id @return Article
[ "Returns", "current", "product", "parent", "article", "object", "if", "it", "is", "available", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L225-L237
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails._processProduct
protected function _processProduct($oProduct) { $oProduct->setLinkType($this->getLinkType()); if ($sAddParams = $this->_getAddUrlParams()) { $oProduct->appendLink($sAddParams); } }
php
protected function _processProduct($oProduct) { $oProduct->setLinkType($this->getLinkType()); if ($sAddParams = $this->_getAddUrlParams()) { $oProduct->appendLink($sAddParams); } }
[ "protected", "function", "_processProduct", "(", "$", "oProduct", ")", "{", "$", "oProduct", "->", "setLinkType", "(", "$", "this", "->", "getLinkType", "(", ")", ")", ";", "if", "(", "$", "sAddParams", "=", "$", "this", "->", "_getAddUrlParams", "(", ")...
Processes product by setting link type and in case list type is search adds search parameters to details link. @param object $oProduct Product to process.
[ "Processes", "product", "by", "setting", "link", "type", "and", "in", "case", "list", "type", "is", "search", "adds", "search", "parameters", "to", "details", "link", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L256-L262
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.canRate
public function canRate() { if ($this->_blCanRate === null) { $this->_blCanRate = false; if ($this->ratingIsActive() && $oUser = $this->getUser()) { $oRating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class); $this->_blCanRate = $oRating->allowRating($oUser->getId(), 'oxarticle', $this->getProduct()->getId()); } } return $this->_blCanRate; }
php
public function canRate() { if ($this->_blCanRate === null) { $this->_blCanRate = false; if ($this->ratingIsActive() && $oUser = $this->getUser()) { $oRating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class); $this->_blCanRate = $oRating->allowRating($oUser->getId(), 'oxarticle', $this->getProduct()->getId()); } } return $this->_blCanRate; }
[ "public", "function", "canRate", "(", ")", "{", "if", "(", "$", "this", "->", "_blCanRate", "===", "null", ")", "{", "$", "this", "->", "_blCanRate", "=", "false", ";", "if", "(", "$", "this", "->", "ratingIsActive", "(", ")", "&&", "$", "oUser", "...
Checks if rating functionality is on and allowed to user. @return bool
[ "Checks", "if", "rating", "functionality", "is", "on", "and", "allowed", "to", "user", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L279-L291
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getAttributes
public function getAttributes() { if ($this->_aAttributes === null) { // all attributes this article has $aArtAttributes = $this->getProduct()->getAttributes(); //making a new array for backward compatibility $this->_aAttributes = false; if (count($aArtAttributes)) { foreach ($aArtAttributes as $sKey => $oAttribute) { $this->_aAttributes[$sKey] = new stdClass(); $this->_aAttributes[$sKey]->title = $oAttribute->oxattribute__oxtitle->value; $this->_aAttributes[$sKey]->value = $oAttribute->oxattribute__oxvalue->value; } } } return $this->_aAttributes; }
php
public function getAttributes() { if ($this->_aAttributes === null) { // all attributes this article has $aArtAttributes = $this->getProduct()->getAttributes(); //making a new array for backward compatibility $this->_aAttributes = false; if (count($aArtAttributes)) { foreach ($aArtAttributes as $sKey => $oAttribute) { $this->_aAttributes[$sKey] = new stdClass(); $this->_aAttributes[$sKey]->title = $oAttribute->oxattribute__oxtitle->value; $this->_aAttributes[$sKey]->value = $oAttribute->oxattribute__oxvalue->value; } } } return $this->_aAttributes; }
[ "public", "function", "getAttributes", "(", ")", "{", "if", "(", "$", "this", "->", "_aAttributes", "===", "null", ")", "{", "// all attributes this article has", "$", "aArtAttributes", "=", "$", "this", "->", "getProduct", "(", ")", "->", "getAttributes", "("...
Loading full list of attributes. @return array
[ "Loading", "full", "list", "of", "attributes", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L298-L317
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getLinkType
public function getLinkType() { if ($this->_iLinkType === null) { $sListType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('listtype'); if ('vendor' == $sListType) { $this->_iLinkType = OXARTICLE_LINKTYPE_VENDOR; } elseif ('manufacturer' == $sListType) { $this->_iLinkType = OXARTICLE_LINKTYPE_MANUFACTURER; // @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. } elseif ('recommlist' == $sListType) { $this->_iLinkType = OXARTICLE_LINKTYPE_RECOMM; // END deprecated } else { $this->_iLinkType = OXARTICLE_LINKTYPE_CATEGORY; // price category has own type.. if (($oCat = $this->getActiveCategory()) && $oCat->isPriceCategory()) { $this->_iLinkType = OXARTICLE_LINKTYPE_PRICECATEGORY; } } } return $this->_iLinkType; }
php
public function getLinkType() { if ($this->_iLinkType === null) { $sListType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('listtype'); if ('vendor' == $sListType) { $this->_iLinkType = OXARTICLE_LINKTYPE_VENDOR; } elseif ('manufacturer' == $sListType) { $this->_iLinkType = OXARTICLE_LINKTYPE_MANUFACTURER; // @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. } elseif ('recommlist' == $sListType) { $this->_iLinkType = OXARTICLE_LINKTYPE_RECOMM; // END deprecated } else { $this->_iLinkType = OXARTICLE_LINKTYPE_CATEGORY; // price category has own type.. if (($oCat = $this->getActiveCategory()) && $oCat->isPriceCategory()) { $this->_iLinkType = OXARTICLE_LINKTYPE_PRICECATEGORY; } } } return $this->_iLinkType; }
[ "public", "function", "getLinkType", "(", ")", "{", "if", "(", "$", "this", "->", "_iLinkType", "===", "null", ")", "{", "$", "sListType", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRe...
Returns current view link type. @return int
[ "Returns", "current", "view", "link", "type", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L324-L347
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getVariantListExceptCurrent
public function getVariantListExceptCurrent() { $oList = $this->getVariantList(); if (is_object($oList)) { $oList = clone $oList; } $sOxId = $this->getProduct()->getId(); if (isset($oList[$sOxId])) { unset($oList[$sOxId]); } return $oList; }
php
public function getVariantListExceptCurrent() { $oList = $this->getVariantList(); if (is_object($oList)) { $oList = clone $oList; } $sOxId = $this->getProduct()->getId(); if (isset($oList[$sOxId])) { unset($oList[$sOxId]); } return $oList; }
[ "public", "function", "getVariantListExceptCurrent", "(", ")", "{", "$", "oList", "=", "$", "this", "->", "getVariantList", "(", ")", ";", "if", "(", "is_object", "(", "$", "oList", ")", ")", "{", "$", "oList", "=", "clone", "$", "oList", ";", "}", "...
Returns variant lists of current product excludes currently viewed product. @return array|SimpleVariantList|ArticleList
[ "Returns", "variant", "lists", "of", "current", "product", "excludes", "currently", "viewed", "product", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L355-L368
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.loadVariantInformation
public function loadVariantInformation() { if ($this->_aVariantList === null) { $oProduct = $this->getProduct(); //if we are child and do not have any variants then let's load all parent variants as ours if ($oParent = $oProduct->getParentArticle()) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oParent->setNoVariantLoading(false); $this->_aVariantList = $oParent->getFullVariants(false); //lets additionally add parent article if it is sellable if (count($this->_aVariantList) && $myConfig->getConfigParam('blVariantParentBuyable')) { //#1104S if parent is buyable load select lists too $oParent->enablePriceLoad(); $oParent->aSelectlist = $oParent->getSelectLists(); $this->_aVariantList = array_merge([$oParent], $this->_aVariantList->getArray()); } } else { //loading full list of variants $this->_aVariantList = $oProduct->getFullVariants(false); } // setting link type for variants .. foreach ($this->_aVariantList as $oVariant) { $this->_processProduct($oVariant); } } return $this->_aVariantList; }
php
public function loadVariantInformation() { if ($this->_aVariantList === null) { $oProduct = $this->getProduct(); //if we are child and do not have any variants then let's load all parent variants as ours if ($oParent = $oProduct->getParentArticle()) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oParent->setNoVariantLoading(false); $this->_aVariantList = $oParent->getFullVariants(false); //lets additionally add parent article if it is sellable if (count($this->_aVariantList) && $myConfig->getConfigParam('blVariantParentBuyable')) { //#1104S if parent is buyable load select lists too $oParent->enablePriceLoad(); $oParent->aSelectlist = $oParent->getSelectLists(); $this->_aVariantList = array_merge([$oParent], $this->_aVariantList->getArray()); } } else { //loading full list of variants $this->_aVariantList = $oProduct->getFullVariants(false); } // setting link type for variants .. foreach ($this->_aVariantList as $oVariant) { $this->_processProduct($oVariant); } } return $this->_aVariantList; }
[ "public", "function", "loadVariantInformation", "(", ")", "{", "if", "(", "$", "this", "->", "_aVariantList", "===", "null", ")", "{", "$", "oProduct", "=", "$", "this", "->", "getProduct", "(", ")", ";", "//if we are child and do not have any variants then let's ...
Loading full list of variants, if we are child and do not have any variants then let's load all parent variants as ours. @return array|SimpleVariantList|ArticleList
[ "Loading", "full", "list", "of", "variants", "if", "we", "are", "child", "and", "do", "not", "have", "any", "variants", "then", "let", "s", "load", "all", "parent", "variants", "as", "ours", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L376-L407
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getMediaFiles
public function getMediaFiles() { if ($this->_aMediaFiles === null) { $aMediaFiles = $this->getProduct()->getMediaUrls(); $this->_aMediaFiles = count($aMediaFiles) ? $aMediaFiles : false; } return $this->_aMediaFiles; }
php
public function getMediaFiles() { if ($this->_aMediaFiles === null) { $aMediaFiles = $this->getProduct()->getMediaUrls(); $this->_aMediaFiles = count($aMediaFiles) ? $aMediaFiles : false; } return $this->_aMediaFiles; }
[ "public", "function", "getMediaFiles", "(", ")", "{", "if", "(", "$", "this", "->", "_aMediaFiles", "===", "null", ")", "{", "$", "aMediaFiles", "=", "$", "this", "->", "getProduct", "(", ")", "->", "getMediaUrls", "(", ")", ";", "$", "this", "->", "...
Template variable getter. Returns media files of current product. @return array
[ "Template", "variable", "getter", ".", "Returns", "media", "files", "of", "current", "product", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L424-L432
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getLastProducts
public function getLastProducts($iCnt = 4) { if ($this->_aLastProducts === null) { //last seen products for #768CA $oProduct = $this->getProduct(); $sParentIdField = 'oxarticles__oxparentid'; $sArtId = $oProduct->$sParentIdField->value ? $oProduct->$sParentIdField->value : $oProduct->getId(); $oHistoryArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oHistoryArtList->loadHistoryArticles($sArtId, $iCnt); $this->_aLastProducts = $oHistoryArtList; } return $this->_aLastProducts; }
php
public function getLastProducts($iCnt = 4) { if ($this->_aLastProducts === null) { //last seen products for #768CA $oProduct = $this->getProduct(); $sParentIdField = 'oxarticles__oxparentid'; $sArtId = $oProduct->$sParentIdField->value ? $oProduct->$sParentIdField->value : $oProduct->getId(); $oHistoryArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $oHistoryArtList->loadHistoryArticles($sArtId, $iCnt); $this->_aLastProducts = $oHistoryArtList; } return $this->_aLastProducts; }
[ "public", "function", "getLastProducts", "(", "$", "iCnt", "=", "4", ")", "{", "if", "(", "$", "this", "->", "_aLastProducts", "===", "null", ")", "{", "//last seen products for #768CA", "$", "oProduct", "=", "$", "this", "->", "getProduct", "(", ")", ";",...
Template variable getter. Returns last seen products. @param int $iCnt product count @return array
[ "Template", "variable", "getter", ".", "Returns", "last", "seen", "products", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L441-L455
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getCategory
public function getCategory() { if ($this->_oCategory === null) { $this->_oCategory = $this->getProduct()->getCategory(); } return $this->_oCategory; }
php
public function getCategory() { if ($this->_oCategory === null) { $this->_oCategory = $this->getProduct()->getCategory(); } return $this->_oCategory; }
[ "public", "function", "getCategory", "(", ")", "{", "if", "(", "$", "this", "->", "_oCategory", "===", "null", ")", "{", "$", "this", "->", "_oCategory", "=", "$", "this", "->", "getProduct", "(", ")", "->", "getCategory", "(", ")", ";", "}", "return...
Template variable getter. Returns product's root category. @return object
[ "Template", "variable", "getter", ".", "Returns", "product", "s", "root", "category", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L490-L497
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getCrossSelling
public function getCrossSelling() { if ($this->_oCrossSelling === null) { $this->_oCrossSelling = false; if ($oProduct = $this->getProduct()) { $this->_oCrossSelling = $oProduct->getCrossSelling(); } } return $this->_oCrossSelling; }
php
public function getCrossSelling() { if ($this->_oCrossSelling === null) { $this->_oCrossSelling = false; if ($oProduct = $this->getProduct()) { $this->_oCrossSelling = $oProduct->getCrossSelling(); } } return $this->_oCrossSelling; }
[ "public", "function", "getCrossSelling", "(", ")", "{", "if", "(", "$", "this", "->", "_oCrossSelling", "===", "null", ")", "{", "$", "this", "->", "_oCrossSelling", "=", "false", ";", "if", "(", "$", "oProduct", "=", "$", "this", "->", "getProduct", "...
Template variable getter. Returns cross selling. @return object
[ "Template", "variable", "getter", ".", "Returns", "cross", "selling", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L596-L606
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getSimilarProducts
public function getSimilarProducts() { if ($this->_oSimilarProducts === null) { $this->_oSimilarProducts = false; if ($oProduct = $this->getProduct()) { $this->_oSimilarProducts = $oProduct->getSimilarProducts(); } } return $this->_oSimilarProducts; }
php
public function getSimilarProducts() { if ($this->_oSimilarProducts === null) { $this->_oSimilarProducts = false; if ($oProduct = $this->getProduct()) { $this->_oSimilarProducts = $oProduct->getSimilarProducts(); } } return $this->_oSimilarProducts; }
[ "public", "function", "getSimilarProducts", "(", ")", "{", "if", "(", "$", "this", "->", "_oSimilarProducts", "===", "null", ")", "{", "$", "this", "->", "_oSimilarProducts", "=", "false", ";", "if", "(", "$", "oProduct", "=", "$", "this", "->", "getProd...
Template variable getter. Returns similar article list. @return object
[ "Template", "variable", "getter", ".", "Returns", "similar", "article", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L613-L623
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getAccessoires
public function getAccessoires() { if ($this->_oAccessoires === null) { $this->_oAccessoires = false; if ($oProduct = $this->getProduct()) { $this->_oAccessoires = $oProduct->getAccessoires(); } } return $this->_oAccessoires; }
php
public function getAccessoires() { if ($this->_oAccessoires === null) { $this->_oAccessoires = false; if ($oProduct = $this->getProduct()) { $this->_oAccessoires = $oProduct->getAccessoires(); } } return $this->_oAccessoires; }
[ "public", "function", "getAccessoires", "(", ")", "{", "if", "(", "$", "this", "->", "_oAccessoires", "===", "null", ")", "{", "$", "this", "->", "_oAccessoires", "=", "false", ";", "if", "(", "$", "oProduct", "=", "$", "this", "->", "getProduct", "(",...
Template variable getter. Returns accessories of article. @return object
[ "Template", "variable", "getter", ".", "Returns", "accessories", "of", "article", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L650-L660
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getAlsoBoughtTheseProducts
public function getAlsoBoughtTheseProducts() { if ($this->_aAlsoBoughtArts === null) { $this->_aAlsoBoughtArts = false; if ($oProduct = $this->getProduct()) { $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts(); } } return $this->_aAlsoBoughtArts; }
php
public function getAlsoBoughtTheseProducts() { if ($this->_aAlsoBoughtArts === null) { $this->_aAlsoBoughtArts = false; if ($oProduct = $this->getProduct()) { $this->_aAlsoBoughtArts = $oProduct->getCustomerAlsoBoughtThisProducts(); } } return $this->_aAlsoBoughtArts; }
[ "public", "function", "getAlsoBoughtTheseProducts", "(", ")", "{", "if", "(", "$", "this", "->", "_aAlsoBoughtArts", "===", "null", ")", "{", "$", "this", "->", "_aAlsoBoughtArts", "=", "false", ";", "if", "(", "$", "oProduct", "=", "$", "this", "->", "g...
Template variable getter. Returns list of customer also bought these products. @return object
[ "Template", "variable", "getter", ".", "Returns", "list", "of", "customer", "also", "bought", "these", "products", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L667-L677
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getRatingValue
public function getRatingValue() { if ($this->_dRatingValue === null) { $this->_dRatingValue = (double) 0; if ($this->isReviewActive() && ($oDetailsProduct = $this->getProduct())) { $blShowVariantsReviews = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVariantReviews'); $this->_dRatingValue = round($oDetailsProduct->getArticleRatingAverage($blShowVariantsReviews), 1); } } return (double) $this->_dRatingValue; }
php
public function getRatingValue() { if ($this->_dRatingValue === null) { $this->_dRatingValue = (double) 0; if ($this->isReviewActive() && ($oDetailsProduct = $this->getProduct())) { $blShowVariantsReviews = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVariantReviews'); $this->_dRatingValue = round($oDetailsProduct->getArticleRatingAverage($blShowVariantsReviews), 1); } } return (double) $this->_dRatingValue; }
[ "public", "function", "getRatingValue", "(", ")", "{", "if", "(", "$", "this", "->", "_dRatingValue", "===", "null", ")", "{", "$", "this", "->", "_dRatingValue", "=", "(", "double", ")", "0", ";", "if", "(", "$", "this", "->", "isReviewActive", "(", ...
Template variable getter. Returns rating value. @return double
[ "Template", "variable", "getter", ".", "Returns", "rating", "value", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L749-L761
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getRatingCount
public function getRatingCount() { if ($this->_iRatingCnt === null) { $this->_iRatingCnt = false; if ($this->isReviewActive() && ($oDetailsProduct = $this->getProduct())) { $blShowVariantsReviews = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVariantReviews'); $this->_iRatingCnt = $oDetailsProduct->getArticleRatingCount($blShowVariantsReviews); } } return $this->_iRatingCnt; }
php
public function getRatingCount() { if ($this->_iRatingCnt === null) { $this->_iRatingCnt = false; if ($this->isReviewActive() && ($oDetailsProduct = $this->getProduct())) { $blShowVariantsReviews = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVariantReviews'); $this->_iRatingCnt = $oDetailsProduct->getArticleRatingCount($blShowVariantsReviews); } } return $this->_iRatingCnt; }
[ "public", "function", "getRatingCount", "(", ")", "{", "if", "(", "$", "this", "->", "_iRatingCnt", "===", "null", ")", "{", "$", "this", "->", "_iRatingCnt", "=", "false", ";", "if", "(", "$", "this", "->", "isReviewActive", "(", ")", "&&", "(", "$"...
Template variable getter. Returns rating count. @return integer
[ "Template", "variable", "getter", ".", "Returns", "rating", "count", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L778-L789
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getVariantSelections
public function getVariantSelections() { // finding parent $oProduct = $this->getProduct(); $sParentIdField = 'oxarticles__oxparentid'; if (($oParent = $this->_getParentProduct($oProduct->$sParentIdField->value))) { $sVarSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid"); return $oParent->getVariantSelections($sVarSelId, $oProduct->getId()); } return $oProduct->getVariantSelections(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid")); }
php
public function getVariantSelections() { // finding parent $oProduct = $this->getProduct(); $sParentIdField = 'oxarticles__oxparentid'; if (($oParent = $this->_getParentProduct($oProduct->$sParentIdField->value))) { $sVarSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid"); return $oParent->getVariantSelections($sVarSelId, $oProduct->getId()); } return $oProduct->getVariantSelections(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid")); }
[ "public", "function", "getVariantSelections", "(", ")", "{", "// finding parent", "$", "oProduct", "=", "$", "this", "->", "getProduct", "(", ")", ";", "$", "sParentIdField", "=", "'oxarticles__oxparentid'", ";", "if", "(", "(", "$", "oParent", "=", "$", "th...
Returns variant selection. @return array
[ "Returns", "variant", "selection", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L825-L837
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getPicturesProduct
public function getPicturesProduct() { $aVariantSelections = $this->getVariantSelections(); if ($aVariantSelections && $aVariantSelections['oActiveVariant'] && !$aVariantSelections['blPerfectFit']) { return $aVariantSelections['oActiveVariant']; } return $this->getProduct(); }
php
public function getPicturesProduct() { $aVariantSelections = $this->getVariantSelections(); if ($aVariantSelections && $aVariantSelections['oActiveVariant'] && !$aVariantSelections['blPerfectFit']) { return $aVariantSelections['oActiveVariant']; } return $this->getProduct(); }
[ "public", "function", "getPicturesProduct", "(", ")", "{", "$", "aVariantSelections", "=", "$", "this", "->", "getVariantSelections", "(", ")", ";", "if", "(", "$", "aVariantSelections", "&&", "$", "aVariantSelections", "[", "'oActiveVariant'", "]", "&&", "!", ...
Returns pictures product object. @return ArticleList
[ "Returns", "pictures", "product", "object", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L844-L852
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getProduct
public function getProduct() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $myUtils = \OxidEsales\Eshop\Core\Registry::getUtils(); if ($this->_oProduct === null) { if ($this->getViewParameter('_object')) { $this->_oProduct = $this->getViewParameter('_object'); } else { //this option is only for lists and we must reset value //as blLoadVariants = false affect "ab price" functionality $myConfig->setConfigParam('blLoadVariants', true); $sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid'); // object is not yet loaded $this->_oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if (!$this->_oProduct->load($sOxid)) { $myUtils->redirect($myConfig->getShopHomeUrl()); $myUtils->showMessageAndExit(''); } $sVarSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid"); $aVarSelections = $this->_oProduct->getVariantSelections($sVarSelId); if ($aVarSelections && $aVarSelections['oActiveVariant'] && $aVarSelections['blPerfectFit']) { $this->_oProduct = $aVarSelections['oActiveVariant']; } } } if (!$this->_blIsInitialized) { $this->_additionalChecksForArticle($myUtils, $myConfig); } return $this->_oProduct; }
php
public function getProduct() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $myUtils = \OxidEsales\Eshop\Core\Registry::getUtils(); if ($this->_oProduct === null) { if ($this->getViewParameter('_object')) { $this->_oProduct = $this->getViewParameter('_object'); } else { //this option is only for lists and we must reset value //as blLoadVariants = false affect "ab price" functionality $myConfig->setConfigParam('blLoadVariants', true); $sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid'); // object is not yet loaded $this->_oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if (!$this->_oProduct->load($sOxid)) { $myUtils->redirect($myConfig->getShopHomeUrl()); $myUtils->showMessageAndExit(''); } $sVarSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid"); $aVarSelections = $this->_oProduct->getVariantSelections($sVarSelId); if ($aVarSelections && $aVarSelections['oActiveVariant'] && $aVarSelections['blPerfectFit']) { $this->_oProduct = $aVarSelections['oActiveVariant']; } } } if (!$this->_blIsInitialized) { $this->_additionalChecksForArticle($myUtils, $myConfig); } return $this->_oProduct; }
[ "public", "function", "getProduct", "(", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "myUtils", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "R...
Get product. @return Article
[ "Get", "product", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L859-L894
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails._setSortingParameters
protected function _setSortingParameters() { $sSortingParameters = $this->getViewParameter('sorting'); if ($sSortingParameters) { list($sSortBy, $sSortDir) = explode('|', $sSortingParameters); $this->setItemSorting($this->getSortIdent(), $sSortBy, $sSortDir); } }
php
protected function _setSortingParameters() { $sSortingParameters = $this->getViewParameter('sorting'); if ($sSortingParameters) { list($sSortBy, $sSortDir) = explode('|', $sSortingParameters); $this->setItemSorting($this->getSortIdent(), $sSortBy, $sSortDir); } }
[ "protected", "function", "_setSortingParameters", "(", ")", "{", "$", "sSortingParameters", "=", "$", "this", "->", "getViewParameter", "(", "'sorting'", ")", ";", "if", "(", "$", "sSortingParameters", ")", "{", "list", "(", "$", "sSortBy", ",", "$", "sSortD...
Set item sorting for widget based of retrieved parameters.
[ "Set", "item", "sorting", "for", "widget", "based", "of", "retrieved", "parameters", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L899-L906
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.isMdVariantView
public function isMdVariantView() { if ($this->_blMdView === null) { $this->_blMdView = false; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blUseMultidimensionVariants')) { $iMaxMdDepth = $this->getProduct()->getMdVariants()->getMaxDepth(); $this->_blMdView = ($iMaxMdDepth > 1); } } return $this->_blMdView; }
php
public function isMdVariantView() { if ($this->_blMdView === null) { $this->_blMdView = false; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blUseMultidimensionVariants')) { $iMaxMdDepth = $this->getProduct()->getMdVariants()->getMaxDepth(); $this->_blMdView = ($iMaxMdDepth > 1); } } return $this->_blMdView; }
[ "public", "function", "isMdVariantView", "(", ")", "{", "if", "(", "$", "this", "->", "_blMdView", "===", "null", ")", "{", "$", "this", "->", "_blMdView", "=", "false", ";", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry",...
Should we show MD variant selection? - Not for 1 dimension variants. @return bool
[ "Should", "we", "show", "MD", "variant", "selection?", "-", "Not", "for", "1", "dimension", "variants", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L948-L959
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/ArticleDetails.php
ArticleDetails.getDefaultSorting
public function getDefaultSorting() { $aSorting = parent::getDefaultSorting(); $oCategory = $this->getActiveCategory(); if ($this->getListType() != 'search' && $oCategory && $oCategory instanceof \OxidEsales\Eshop\Application\Model\Category) { if ($sSortBy = $oCategory->getDefaultSorting()) { $sSortDir = ($oCategory->getDefaultSortingMode()) ? "desc" : "asc"; $aSorting = ['sortby' => $sSortBy, 'sortdir' => $sSortDir]; } } return $aSorting; }
php
public function getDefaultSorting() { $aSorting = parent::getDefaultSorting(); $oCategory = $this->getActiveCategory(); if ($this->getListType() != 'search' && $oCategory && $oCategory instanceof \OxidEsales\Eshop\Application\Model\Category) { if ($sSortBy = $oCategory->getDefaultSorting()) { $sSortDir = ($oCategory->getDefaultSortingMode()) ? "desc" : "asc"; $aSorting = ['sortby' => $sSortBy, 'sortdir' => $sSortDir]; } } return $aSorting; }
[ "public", "function", "getDefaultSorting", "(", ")", "{", "$", "aSorting", "=", "parent", "::", "getDefaultSorting", "(", ")", ";", "$", "oCategory", "=", "$", "this", "->", "getActiveCategory", "(", ")", ";", "if", "(", "$", "this", "->", "getListType", ...
Returns default category sorting for selected category. @return array
[ "Returns", "default", "category", "sorting", "for", "selected", "category", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleDetails.php#L993-L1007
train
OXID-eSales/oxideshop_ce
source/Setup/Dispatcher.php
Dispatcher.run
public function run() { // choosing which controller action must be executed $sAction = $this->_chooseCurrentAction(); // executing action which returns name of template to render /** @var Controller $oController */ $oController = $this->getInstance("Controller"); $view = $oController->getView(); $view->sendHeaders(); try { $oController->$sAction(); } catch (SetupControllerExitException $exception) { } finally { $view->display(); } }
php
public function run() { // choosing which controller action must be executed $sAction = $this->_chooseCurrentAction(); // executing action which returns name of template to render /** @var Controller $oController */ $oController = $this->getInstance("Controller"); $view = $oController->getView(); $view->sendHeaders(); try { $oController->$sAction(); } catch (SetupControllerExitException $exception) { } finally { $view->display(); } }
[ "public", "function", "run", "(", ")", "{", "// choosing which controller action must be executed", "$", "sAction", "=", "$", "this", "->", "_chooseCurrentAction", "(", ")", ";", "// executing action which returns name of template to render", "/** @var Controller $oController */"...
Executes current controller action
[ "Executes", "current", "controller", "action" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Dispatcher.php#L19-L37
train
OXID-eSales/oxideshop_ce
source/Setup/Dispatcher.php
Dispatcher._chooseCurrentAction
protected function _chooseCurrentAction() { /** @var Setup $oSetup */ $oSetup = $this->getInstance("Setup"); $iCurrStep = $oSetup->getCurrentStep(); $sName = null; foreach ($oSetup->getSteps() as $sStepName => $sStepId) { if ($sStepId == $iCurrStep) { $sActionName = str_ireplace("step_", "", $sStepName); $sName = str_replace("_", "", $sActionName); break; } } return $sName; }
php
protected function _chooseCurrentAction() { /** @var Setup $oSetup */ $oSetup = $this->getInstance("Setup"); $iCurrStep = $oSetup->getCurrentStep(); $sName = null; foreach ($oSetup->getSteps() as $sStepName => $sStepId) { if ($sStepId == $iCurrStep) { $sActionName = str_ireplace("step_", "", $sStepName); $sName = str_replace("_", "", $sActionName); break; } } return $sName; }
[ "protected", "function", "_chooseCurrentAction", "(", ")", "{", "/** @var Setup $oSetup */", "$", "oSetup", "=", "$", "this", "->", "getInstance", "(", "\"Setup\"", ")", ";", "$", "iCurrStep", "=", "$", "oSetup", "->", "getCurrentStep", "(", ")", ";", "$", "...
Returns name of controller action script to perform @return string | null
[ "Returns", "name", "of", "controller", "action", "script", "to", "perform" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Dispatcher.php#L44-L60
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.addLanguageParam
public function addLanguageParam($sSeoUrl, $iLang) { $iLang = (int) $iLang; $iDefLang = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iDefSeoLang'); $aLangIds = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageIds(); if ($iLang != $iDefLang && isset($aLangIds[$iLang]) && // #0006407 bugfix, we should not search for the string saved in the db but for the escaped string getStr()->strpos($sSeoUrl, $this->replaceSpecialChars($aLangIds[$iLang]) . '/') !== 0 ) { $sSeoUrl = $aLangIds[$iLang] . '/' . $sSeoUrl; } return $sSeoUrl; }
php
public function addLanguageParam($sSeoUrl, $iLang) { $iLang = (int) $iLang; $iDefLang = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iDefSeoLang'); $aLangIds = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageIds(); if ($iLang != $iDefLang && isset($aLangIds[$iLang]) && // #0006407 bugfix, we should not search for the string saved in the db but for the escaped string getStr()->strpos($sSeoUrl, $this->replaceSpecialChars($aLangIds[$iLang]) . '/') !== 0 ) { $sSeoUrl = $aLangIds[$iLang] . '/' . $sSeoUrl; } return $sSeoUrl; }
[ "public", "function", "addLanguageParam", "(", "$", "sSeoUrl", ",", "$", "iLang", ")", "{", "$", "iLang", "=", "(", "int", ")", "$", "iLang", ";", "$", "iDefLang", "=", "(", "int", ")", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry...
Returns part of url defining active language @param string $sSeoUrl seo url @param int $iLang language id @return string
[ "Returns", "part", "of", "url", "defining", "active", "language" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L95-L110
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._copyToHistory
protected function _copyToHistory($sId, $iShopId, $iLang, $sType = null, $sNewId = null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sObjectid = $sNewId ? $oDb->quote($sNewId) : 'oxobjectid'; $sType = $sType ? "oxtype =" . $oDb->quote($sType) . " and" : ''; $iLang = (int) $iLang; // moving $sSub = "select $sObjectid, MD5( LOWER( oxseourl ) ), oxshopid, oxlang, now() from oxseo where {$sType} oxobjectid = " . $oDb->quote($sId) . " and oxshopid = " . $oDb->quote($iShopId) . " and oxlang = {$iLang} and oxexpired = '1'"; $sQ = "replace oxseohistory ( oxobjectid, oxident, oxshopid, oxlang, oxinsert ) {$sSub}"; $oDb->execute($sQ); }
php
protected function _copyToHistory($sId, $iShopId, $iLang, $sType = null, $sNewId = null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sObjectid = $sNewId ? $oDb->quote($sNewId) : 'oxobjectid'; $sType = $sType ? "oxtype =" . $oDb->quote($sType) . " and" : ''; $iLang = (int) $iLang; // moving $sSub = "select $sObjectid, MD5( LOWER( oxseourl ) ), oxshopid, oxlang, now() from oxseo where {$sType} oxobjectid = " . $oDb->quote($sId) . " and oxshopid = " . $oDb->quote($iShopId) . " and oxlang = {$iLang} and oxexpired = '1'"; $sQ = "replace oxseohistory ( oxobjectid, oxident, oxshopid, oxlang, oxinsert ) {$sSub}"; $oDb->execute($sQ); }
[ "protected", "function", "_copyToHistory", "(", "$", "sId", ",", "$", "iShopId", ",", "$", "iLang", ",", "$", "sType", "=", "null", ",", "$", "sNewId", "=", "null", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "...
Moves current seo record to seo history table @param string $sId object id @param int $iShopId active shop id @param int $iLang object language @param string $sType object type (if you pass real object - type is not necessary) @param string $sNewId new object id, mostly used for static url updates (optional)
[ "Moves", "current", "seo", "record", "to", "seo", "history", "table" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L157-L170
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._getDynamicUri
protected function _getDynamicUri($sStdUrl, $sSeoUrl, $iLang) { $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $sStdUrl = $this->_trimUrl($sStdUrl); $sObjectId = $this->getDynamicObjectId($iShopId, $sStdUrl); $sSeoUrl = $this->_prepareUri($this->addLanguageParam($sSeoUrl, $iLang), $iLang); //load details link from DB $sOldSeoUrl = $this->_loadFromDb('dynamic', $sObjectId, $iLang); if ($sOldSeoUrl === $sSeoUrl) { $sSeoUrl = $sOldSeoUrl; } else { if ($sOldSeoUrl) { // old must be transferred to history $this->_copyToHistory($sObjectId, $iShopId, $iLang, 'dynamic'); } // creating unique $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $sObjectId, $iLang); // inserting $this->_saveToDb('dynamic', $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId); } return $sSeoUrl; }
php
protected function _getDynamicUri($sStdUrl, $sSeoUrl, $iLang) { $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $sStdUrl = $this->_trimUrl($sStdUrl); $sObjectId = $this->getDynamicObjectId($iShopId, $sStdUrl); $sSeoUrl = $this->_prepareUri($this->addLanguageParam($sSeoUrl, $iLang), $iLang); //load details link from DB $sOldSeoUrl = $this->_loadFromDb('dynamic', $sObjectId, $iLang); if ($sOldSeoUrl === $sSeoUrl) { $sSeoUrl = $sOldSeoUrl; } else { if ($sOldSeoUrl) { // old must be transferred to history $this->_copyToHistory($sObjectId, $iShopId, $iLang, 'dynamic'); } // creating unique $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $sObjectId, $iLang); // inserting $this->_saveToDb('dynamic', $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId); } return $sSeoUrl; }
[ "protected", "function", "_getDynamicUri", "(", "$", "sStdUrl", ",", "$", "sSeoUrl", ",", "$", "iLang", ")", "{", "$", "iShopId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getShopId", "(",...
Returns dynamic object SEO URI @param string $sStdUrl standard url @param string $sSeoUrl seo uri @param int $iLang active language @return string
[ "Returns", "dynamic", "object", "SEO", "URI" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L194-L220
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._getStaticUri
protected function _getStaticUri($sStdUrl, $iShopId, $iLang) { $sStdUrl = $this->_trimUrl($sStdUrl, $iLang); return $this->_loadFromDb('static', $this->_getStaticObjectId($iShopId, $sStdUrl), $iLang, $iShopId); }
php
protected function _getStaticUri($sStdUrl, $iShopId, $iLang) { $sStdUrl = $this->_trimUrl($sStdUrl, $iLang); return $this->_loadFromDb('static', $this->_getStaticObjectId($iShopId, $sStdUrl), $iLang, $iShopId); }
[ "protected", "function", "_getStaticUri", "(", "$", "sStdUrl", ",", "$", "iShopId", ",", "$", "iLang", ")", "{", "$", "sStdUrl", "=", "$", "this", "->", "_trimUrl", "(", "$", "sStdUrl", ",", "$", "iLang", ")", ";", "return", "$", "this", "->", "_load...
Returns SEO static uri @param string $sStdUrl standard page url @param int $iShopId active shop id @param int $iLang active language @return string
[ "Returns", "SEO", "static", "uri" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L265-L270
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._getUniqueSeoUrl
protected function _getUniqueSeoUrl($sSeoUrl, $sObjectId = null, $iObjectLang = null) { $sSeoUrl = $this->_prepareUri($sSeoUrl, $iObjectLang); $oStr = getStr(); $sExt = ''; if ($oStr->preg_match('/(\.html?|\/)$/i', $sSeoUrl, $aMatched)) { $sExt = $aMatched[0]; } $sBaseSeoUrl = $sSeoUrl; if ($sExt && $oStr->substr($sSeoUrl, 0 - $oStr->strlen($sExt)) == $sExt) { $sBaseSeoUrl = $oStr->substr($sSeoUrl, 0, $oStr->strlen($sSeoUrl) - $oStr->strlen($sExt)); } $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $iCnt = 0; $sCheckSeoUrl = $this->_trimUrl($sSeoUrl); $sQ = "select 1 from oxseo where oxshopid = '{$iShopId}'"; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); // skipping self if ($sObjectId && isset($iObjectLang)) { $iObjectLang = (int) $iObjectLang; $sQ .= " and not (oxobjectid = " . $oDb->quote($sObjectId) . " and oxlang = $iObjectLang)"; } while ($oDb->getOne($sQ . " and oxident= " . $oDb->quote($this->_getSeoIdent($sCheckSeoUrl)))) { $sAdd = ''; if (self::$_sPrefix) { $sAdd = self::$_sSeparator . self::$_sPrefix; } if ($iCnt) { $sAdd .= self::$_sSeparator . $iCnt; } ++$iCnt; $sSeoUrl = $sBaseSeoUrl . $sAdd . $sExt; $sCheckSeoUrl = $this->_trimUrl($sSeoUrl); } return $sSeoUrl; }
php
protected function _getUniqueSeoUrl($sSeoUrl, $sObjectId = null, $iObjectLang = null) { $sSeoUrl = $this->_prepareUri($sSeoUrl, $iObjectLang); $oStr = getStr(); $sExt = ''; if ($oStr->preg_match('/(\.html?|\/)$/i', $sSeoUrl, $aMatched)) { $sExt = $aMatched[0]; } $sBaseSeoUrl = $sSeoUrl; if ($sExt && $oStr->substr($sSeoUrl, 0 - $oStr->strlen($sExt)) == $sExt) { $sBaseSeoUrl = $oStr->substr($sSeoUrl, 0, $oStr->strlen($sSeoUrl) - $oStr->strlen($sExt)); } $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $iCnt = 0; $sCheckSeoUrl = $this->_trimUrl($sSeoUrl); $sQ = "select 1 from oxseo where oxshopid = '{$iShopId}'"; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); // skipping self if ($sObjectId && isset($iObjectLang)) { $iObjectLang = (int) $iObjectLang; $sQ .= " and not (oxobjectid = " . $oDb->quote($sObjectId) . " and oxlang = $iObjectLang)"; } while ($oDb->getOne($sQ . " and oxident= " . $oDb->quote($this->_getSeoIdent($sCheckSeoUrl)))) { $sAdd = ''; if (self::$_sPrefix) { $sAdd = self::$_sSeparator . self::$_sPrefix; } if ($iCnt) { $sAdd .= self::$_sSeparator . $iCnt; } ++$iCnt; $sSeoUrl = $sBaseSeoUrl . $sAdd . $sExt; $sCheckSeoUrl = $this->_trimUrl($sSeoUrl); } return $sSeoUrl; }
[ "protected", "function", "_getUniqueSeoUrl", "(", "$", "sSeoUrl", ",", "$", "sObjectId", "=", "null", ",", "$", "iObjectLang", "=", "null", ")", "{", "$", "sSeoUrl", "=", "$", "this", "->", "_prepareUri", "(", "$", "sSeoUrl", ",", "$", "iObjectLang", ")"...
_getUniqueSeoUrl returns possibly modified url for not to be same as already existing in db @param string $sSeoUrl seo url @param string $sObjectId current object id, used to skip self in query @param int $iObjectLang object language id @access protected @return string
[ "_getUniqueSeoUrl", "returns", "possibly", "modified", "url", "for", "not", "to", "be", "same", "as", "already", "existing", "in", "db" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L294-L334
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._isFixed
protected function _isFixed($sType, $sId, $iLang, $iShopId = null, $sParams = null, $blStrictParamsCheck = true) { if ($iShopId === null) { $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); } $iLang = (int) $iLang; if (!isset(self::$_aFixedCache[$sType][$iShopId][$sId][$iLang])) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "SELECT `oxfixed` FROM `oxseo` WHERE `oxtype` = " . $oDb->quote($sType) . " AND `oxobjectid` = " . $oDb->quote($sId) . " AND `oxshopid` = " . $oDb->quote($iShopId) . " AND `oxlang` = '{$iLang}'"; $sParams = $sParams ? $oDb->quote($sParams) : "''"; if ($sParams && $blStrictParamsCheck) { $sQ .= " AND `oxparams` = {$sParams}"; } else { $sQ .= " ORDER BY `oxparams` ASC"; } $sQ .= " LIMIT 1"; self::$_aFixedCache[$sType][$iShopId][$sId][$iLang] = (bool) $oDb->getOne($sQ); } return self::$_aFixedCache[$sType][$iShopId][$sId][$iLang]; }
php
protected function _isFixed($sType, $sId, $iLang, $iShopId = null, $sParams = null, $blStrictParamsCheck = true) { if ($iShopId === null) { $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); } $iLang = (int) $iLang; if (!isset(self::$_aFixedCache[$sType][$iShopId][$sId][$iLang])) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "SELECT `oxfixed` FROM `oxseo` WHERE `oxtype` = " . $oDb->quote($sType) . " AND `oxobjectid` = " . $oDb->quote($sId) . " AND `oxshopid` = " . $oDb->quote($iShopId) . " AND `oxlang` = '{$iLang}'"; $sParams = $sParams ? $oDb->quote($sParams) : "''"; if ($sParams && $blStrictParamsCheck) { $sQ .= " AND `oxparams` = {$sParams}"; } else { $sQ .= " ORDER BY `oxparams` ASC"; } $sQ .= " LIMIT 1"; self::$_aFixedCache[$sType][$iShopId][$sId][$iLang] = (bool) $oDb->getOne($sQ); } return self::$_aFixedCache[$sType][$iShopId][$sId][$iLang]; }
[ "protected", "function", "_isFixed", "(", "$", "sType", ",", "$", "sId", ",", "$", "iLang", ",", "$", "iShopId", "=", "null", ",", "$", "sParams", "=", "null", ",", "$", "blStrictParamsCheck", "=", "true", ")", "{", "if", "(", "$", "iShopId", "===", ...
check if seo url exist and is fixed @param string $sType object type @param string $sId object identifier @param int $iLang active language id @param mixed $iShopId active shop id @param string $sParams additional seo params. optional (mostly used for db indexing) @param bool $blStrictParamsCheck strict parameters check @access protected @return bool
[ "check", "if", "seo", "url", "exist", "and", "is", "fixed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L350-L379
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._loadFromDb
protected function _loadFromDb($sType, $sId, $iLang, $iShopId = null, $sParams = null, $blStrictParamsCheck = true) { if ($iShopId === null) { $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); } $iLang = (int) $iLang; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $sQ = " SELECT `oxfixed`, `oxseourl`, `oxexpired`, `oxtype` FROM `oxseo` WHERE `oxtype` = " . $oDb->quote($sType) . " AND `oxobjectid` = " . $oDb->quote($sId) . " AND `oxshopid` = " . $oDb->quote($iShopId) . " AND `oxlang` = '{$iLang}'"; $sParams = $sParams ? $sParams : ''; if ($sParams && $blStrictParamsCheck) { $sQ .= " AND `oxparams` = '{$sParams}'"; } else { $sQ .= " ORDER BY `oxparams` ASC"; } $sQ .= " LIMIT 1"; // caching to avoid same queries.. $sIdent = md5($sQ); // looking in cache if (($sSeoUrl = $this->_loadFromCache($sIdent, $sType, $iLang, $iShopId, $sParams)) === false) { $oRs = $oDb->select($sQ); if ($oRs && $oRs->count() > 0 && !$oRs->EOF) { // moving expired static urls to history .. if ($oRs->fields['oxexpired'] && ($oRs->fields['oxtype'] == 'static' || $oRs->fields['oxtype'] == 'dynamic')) { // if expired - copying to history, marking as not expired $this->_copyToHistory($sId, $iShopId, $iLang); $oDb->execute( "update oxseo set oxexpired = 0 where oxobjectid = ? and oxlang = ? and oxshopid = ?", [$sId, $iLang, $iShopId] ); $sSeoUrl = $oRs->fields['oxseourl']; } elseif (!$oRs->fields['oxexpired'] || $oRs->fields['oxfixed']) { // if seo url is available and is valid $sSeoUrl = $oRs->fields['oxseourl']; } // storing in cache $this->_saveInCache($sIdent, $sSeoUrl, $sType, $iLang, $iShopId, $sParams); } } return $sSeoUrl; }
php
protected function _loadFromDb($sType, $sId, $iLang, $iShopId = null, $sParams = null, $blStrictParamsCheck = true) { if ($iShopId === null) { $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); } $iLang = (int) $iLang; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $sQ = " SELECT `oxfixed`, `oxseourl`, `oxexpired`, `oxtype` FROM `oxseo` WHERE `oxtype` = " . $oDb->quote($sType) . " AND `oxobjectid` = " . $oDb->quote($sId) . " AND `oxshopid` = " . $oDb->quote($iShopId) . " AND `oxlang` = '{$iLang}'"; $sParams = $sParams ? $sParams : ''; if ($sParams && $blStrictParamsCheck) { $sQ .= " AND `oxparams` = '{$sParams}'"; } else { $sQ .= " ORDER BY `oxparams` ASC"; } $sQ .= " LIMIT 1"; // caching to avoid same queries.. $sIdent = md5($sQ); // looking in cache if (($sSeoUrl = $this->_loadFromCache($sIdent, $sType, $iLang, $iShopId, $sParams)) === false) { $oRs = $oDb->select($sQ); if ($oRs && $oRs->count() > 0 && !$oRs->EOF) { // moving expired static urls to history .. if ($oRs->fields['oxexpired'] && ($oRs->fields['oxtype'] == 'static' || $oRs->fields['oxtype'] == 'dynamic')) { // if expired - copying to history, marking as not expired $this->_copyToHistory($sId, $iShopId, $iLang); $oDb->execute( "update oxseo set oxexpired = 0 where oxobjectid = ? and oxlang = ? and oxshopid = ?", [$sId, $iLang, $iShopId] ); $sSeoUrl = $oRs->fields['oxseourl']; } elseif (!$oRs->fields['oxexpired'] || $oRs->fields['oxfixed']) { // if seo url is available and is valid $sSeoUrl = $oRs->fields['oxseourl']; } // storing in cache $this->_saveInCache($sIdent, $sSeoUrl, $sType, $iLang, $iShopId, $sParams); } } return $sSeoUrl; }
[ "protected", "function", "_loadFromDb", "(", "$", "sType", ",", "$", "sId", ",", "$", "iLang", ",", "$", "iShopId", "=", "null", ",", "$", "sParams", "=", "null", ",", "$", "blStrictParamsCheck", "=", "true", ")", "{", "if", "(", "$", "iShopId", "===...
_loadFromDb loads data from oxseo table if exists returns oxseo url @param string $sType object type @param string $sId object identifier @param int $iLang active language id @param mixed $iShopId active shop id @param string $sParams additional seo params. optional (mostly used for db indexing) @param bool $blStrictParamsCheck strict parameters check @access protected @return string || false
[ "_loadFromDb", "loads", "data", "from", "oxseo", "table", "if", "exists", "returns", "oxseo", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L490-L549
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._prepareTitle
protected function _prepareTitle($sTitle, $blSkipTruncate = false, $iLang = false) { $sTitle = $this->encodeString($sTitle, true, $iLang); $sSep = self::$_sSeparator; if (!$sSep || ('/' == $sSep)) { $sSep = '_'; } $sRegExp = '/[^A-Za-z0-9\/' . preg_quote(self::$_sPrefix, '/') . preg_quote($sSep, '/') . ']+/'; $sTitle = preg_replace(["#/+#", $sRegExp, "# +#", "#(" . preg_quote($sSep, '/') . ")+#"], $sSep, $sTitle); $oStr = getStr(); // smart truncate if (!$blSkipTruncate && $oStr->strlen($sTitle) > $this->_iIdLength) { $iFirstSpace = $oStr->strpos($sTitle, $sSep, $this->_iIdLength); if ($iFirstSpace !== false) { $sTitle = $oStr->substr($sTitle, 0, $iFirstSpace); } } $sTitle = trim($sTitle, $sSep); if (!$sTitle) { return self::$_sPrefix; } // cleaning return $sTitle; }
php
protected function _prepareTitle($sTitle, $blSkipTruncate = false, $iLang = false) { $sTitle = $this->encodeString($sTitle, true, $iLang); $sSep = self::$_sSeparator; if (!$sSep || ('/' == $sSep)) { $sSep = '_'; } $sRegExp = '/[^A-Za-z0-9\/' . preg_quote(self::$_sPrefix, '/') . preg_quote($sSep, '/') . ']+/'; $sTitle = preg_replace(["#/+#", $sRegExp, "# +#", "#(" . preg_quote($sSep, '/') . ")+#"], $sSep, $sTitle); $oStr = getStr(); // smart truncate if (!$blSkipTruncate && $oStr->strlen($sTitle) > $this->_iIdLength) { $iFirstSpace = $oStr->strpos($sTitle, $sSep, $this->_iIdLength); if ($iFirstSpace !== false) { $sTitle = $oStr->substr($sTitle, 0, $iFirstSpace); } } $sTitle = trim($sTitle, $sSep); if (!$sTitle) { return self::$_sPrefix; } // cleaning return $sTitle; }
[ "protected", "function", "_prepareTitle", "(", "$", "sTitle", ",", "$", "blSkipTruncate", "=", "false", ",", "$", "iLang", "=", "false", ")", "{", "$", "sTitle", "=", "$", "this", "->", "encodeString", "(", "$", "sTitle", ",", "true", ",", "$", "iLang"...
Prepares and returns formatted object SEO id @param string $sTitle Original object title @param bool $blSkipTruncate Truncate title into defined lenght or not @param int $iLang language ID, for which to prepare the title @return string
[ "Prepares", "and", "returns", "formatted", "object", "SEO", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L653-L681
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.executeQuery
protected function executeQuery($query) { $dataBase = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $success = true; try { $dataBase->execute($query); } catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) { \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]); $success = false; } return $success; }
php
protected function executeQuery($query) { $dataBase = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $success = true; try { $dataBase->execute($query); } catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) { \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]); $success = false; } return $success; }
[ "protected", "function", "executeQuery", "(", "$", "query", ")", "{", "$", "dataBase", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvide...
Runs query. Returns false when the query fail, otherwise return true @param string $query Query to execute. @return bool
[ "Runs", "query", ".", "Returns", "false", "when", "the", "query", "fail", "otherwise", "return", "true" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L770-L782
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._trimUrl
protected function _trimUrl($sUrl, $iLang = null) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oStr = getStr(); $sUrl = str_replace([$myConfig->getShopUrl($iLang, false), $myConfig->getSslShopUrl($iLang)], '', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)(force_)?(admin_)?sid=[a-z0-9\.]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)shp=[0-9]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)lang=[0-9]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)cur=[0-9]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)stoken=[a-z0-9]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)&(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)+$/i', '', $sUrl); $sUrl = trim($sUrl); // max length <= $this->_iMaxUrlLength $iLength = $this->_getMaxUrlLength(); if ($oStr->strlen($sUrl) > $iLength) { $sUrl = $oStr->substr($sUrl, 0, $iLength); } return $sUrl; }
php
protected function _trimUrl($sUrl, $iLang = null) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oStr = getStr(); $sUrl = str_replace([$myConfig->getShopUrl($iLang, false), $myConfig->getSslShopUrl($iLang)], '', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)(force_)?(admin_)?sid=[a-z0-9\.]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)shp=[0-9]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)lang=[0-9]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)cur=[0-9]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)stoken=[a-z0-9]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)&(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)+$/i', '', $sUrl); $sUrl = trim($sUrl); // max length <= $this->_iMaxUrlLength $iLength = $this->_getMaxUrlLength(); if ($oStr->strlen($sUrl) > $iLength) { $sUrl = $oStr->substr($sUrl, 0, $iLength); } return $sUrl; }
[ "protected", "function", "_trimUrl", "(", "$", "sUrl", ",", "$", "iLang", "=", "null", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "oStr", "=", "getStr", "(...
Removes shop path part and session id from given url @param string $sUrl url to clean bad chars @param int $iLang active language @access protected @return string
[ "Removes", "shop", "path", "part", "and", "session", "id", "from", "given", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L794-L815
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.encodeString
public function encodeString($sString, $blReplaceChars = true, $iLang = false) { // decoding entities $sString = getStr()->html_entity_decode($sString); if ($blReplaceChars) { if ($iLang === false || !is_numeric($iLang)) { $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getEditLanguage(); } if ($aReplaceChars = \OxidEsales\Eshop\Core\Registry::getLang()->getSeoReplaceChars($iLang)) { $sString = str_replace(array_keys($aReplaceChars), array_values($aReplaceChars), $sString); } } return str_replace(['&amp;', '&quot;', '&#039;', '&lt;', '&gt;'], '', $sString); }
php
public function encodeString($sString, $blReplaceChars = true, $iLang = false) { // decoding entities $sString = getStr()->html_entity_decode($sString); if ($blReplaceChars) { if ($iLang === false || !is_numeric($iLang)) { $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getEditLanguage(); } if ($aReplaceChars = \OxidEsales\Eshop\Core\Registry::getLang()->getSeoReplaceChars($iLang)) { $sString = str_replace(array_keys($aReplaceChars), array_values($aReplaceChars), $sString); } } return str_replace(['&amp;', '&quot;', '&#039;', '&lt;', '&gt;'], '', $sString); }
[ "public", "function", "encodeString", "(", "$", "sString", ",", "$", "blReplaceChars", "=", "true", ",", "$", "iLang", "=", "false", ")", "{", "// decoding entities", "$", "sString", "=", "getStr", "(", ")", "->", "html_entity_decode", "(", "$", "sString", ...
Replaces special chars in text @param string $sString string to encode @param bool $blReplaceChars is true, replaces user defined (\OxidEsales\Eshop\Core\Language::getSeoReplaceChars) characters into alternative @param int $iLang language, for which to encode the string @return string
[ "Replaces", "special", "chars", "in", "text" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L844-L860
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.setSeparator
public function setSeparator($sSeparator = null) { self::$_sSeparator = $sSeparator; if (!self::$_sSeparator) { self::$_sSeparator = '-'; } }
php
public function setSeparator($sSeparator = null) { self::$_sSeparator = $sSeparator; if (!self::$_sSeparator) { self::$_sSeparator = '-'; } }
[ "public", "function", "setSeparator", "(", "$", "sSeparator", "=", "null", ")", "{", "self", "::", "$", "_sSeparator", "=", "$", "sSeparator", ";", "if", "(", "!", "self", "::", "$", "_sSeparator", ")", "{", "self", "::", "$", "_sSeparator", "=", "'-'"...
Sets SEO separator @param string $sSeparator SEO seperator
[ "Sets", "SEO", "separator" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L867-L873
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.markAsExpired
public function markAsExpired($sId, $iShopId = null, $iExpStat = 1, $iLang = null, $sParams = null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sWhere = $sId ? "where oxobjectid = " . $oDb->quote($sId) : ''; $sWhere .= isset($iShopId) ? ($sWhere ? " and oxshopid = " . $oDb->quote($iShopId) : "where oxshopid = " . $oDb->quote($iShopId)) : ''; $sWhere .= !is_null($iLang) ? ($sWhere ? " and oxlang = '{$iLang}'" : "where oxlang = '{$iLang}'") : ''; $sWhere .= $sParams ? ($sWhere ? " and {$sParams}" : "where {$sParams}") : ''; $sQ = "update oxseo set oxexpired = " . $oDb->quote($iExpStat) . " $sWhere "; $oDb->execute($sQ); }
php
public function markAsExpired($sId, $iShopId = null, $iExpStat = 1, $iLang = null, $sParams = null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sWhere = $sId ? "where oxobjectid = " . $oDb->quote($sId) : ''; $sWhere .= isset($iShopId) ? ($sWhere ? " and oxshopid = " . $oDb->quote($iShopId) : "where oxshopid = " . $oDb->quote($iShopId)) : ''; $sWhere .= !is_null($iLang) ? ($sWhere ? " and oxlang = '{$iLang}'" : "where oxlang = '{$iLang}'") : ''; $sWhere .= $sParams ? ($sWhere ? " and {$sParams}" : "where {$sParams}") : ''; $sQ = "update oxseo set oxexpired = " . $oDb->quote($iExpStat) . " $sWhere "; $oDb->execute($sQ); }
[ "public", "function", "markAsExpired", "(", "$", "sId", ",", "$", "iShopId", "=", "null", ",", "$", "iExpStat", "=", "1", ",", "$", "iLang", "=", "null", ",", "$", "sParams", "=", "null", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop"...
Marks object seo records as expired @param string $sId changed object id. If null is passed, object dependency is not checked @param int $iShopId active shop id. Shop id must be passed uf you want to do shop level update (default null) @param int $iExpStat expiration status: 1 - standard expiration @param int $iLang active language (optiona;) @param string $sParams additional params
[ "Marks", "object", "seo", "records", "as", "expired" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L922-L932
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder._getPageUri
protected function _getPageUri($oObject, $sType, $sStdUrl, $sSeoUrl, $sParams, $iLang = null, $blFixed = false) { if (!isset($iLang)) { $iLang = $oObject->getLanguage(); } $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); //load page link from DB $sOldSeoUrl = $this->_loadFromDb($sType, $oObject->getId(), $iLang, $iShopId, $sParams); if (!$sOldSeoUrl) { // generating new.. $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oObject->getId(), $iLang); $this->_saveToDb($sType, $oObject->getId(), $sStdUrl, $sSeoUrl, $iLang, $iShopId, (int) $blFixed, $sParams); } else { // using old $sSeoUrl = $sOldSeoUrl; } return $sSeoUrl; }
php
protected function _getPageUri($oObject, $sType, $sStdUrl, $sSeoUrl, $sParams, $iLang = null, $blFixed = false) { if (!isset($iLang)) { $iLang = $oObject->getLanguage(); } $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); //load page link from DB $sOldSeoUrl = $this->_loadFromDb($sType, $oObject->getId(), $iLang, $iShopId, $sParams); if (!$sOldSeoUrl) { // generating new.. $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oObject->getId(), $iLang); $this->_saveToDb($sType, $oObject->getId(), $sStdUrl, $sSeoUrl, $iLang, $iShopId, (int) $blFixed, $sParams); } else { // using old $sSeoUrl = $sOldSeoUrl; } return $sSeoUrl; }
[ "protected", "function", "_getPageUri", "(", "$", "oObject", ",", "$", "sType", ",", "$", "sStdUrl", ",", "$", "sSeoUrl", ",", "$", "sParams", ",", "$", "iLang", "=", "null", ",", "$", "blFixed", "=", "false", ")", "{", "if", "(", "!", "isset", "("...
Loads if exists or prepares and saves new seo url for passed object @param \OxidEsales\Eshop\Core\Model\BaseModel $oObject object to prepare seo data @param string $sType type of object (oxvendor/oxcategory) @param string $sStdUrl stanradr url @param string $sSeoUrl seo uri @param string $sParams additional params, liek page number etc. mostly used by mysql for indexes @param int $iLang language @param bool $blFixed fixed url marker (default is false) @return string
[ "Loads", "if", "exists", "or", "prepares", "and", "saves", "new", "seo", "url", "for", "passed", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L947-L966
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.copyStaticUrls
public function copyStaticUrls($iShopId) { $iBaseShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getBaseShopId(); if ($iShopId != $iBaseShopId) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); foreach (array_keys(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageIds()) as $iLang) { $sQ = "insert into oxseo ( oxobjectid, oxident, oxshopid, oxlang, oxstdurl, oxseourl, oxtype ) select MD5( LOWER( CONCAT( " . $oDb->quote($iShopId) . ", oxstdurl ) ) ), MD5( LOWER( oxseourl ) ), " . $oDb->quote($iShopId) . ", oxlang, oxstdurl, oxseourl, oxtype from oxseo where oxshopid = '{$iBaseShopId}' and oxtype = 'static' and oxlang='$iLang' "; $oDb->execute($sQ); } } }
php
public function copyStaticUrls($iShopId) { $iBaseShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getBaseShopId(); if ($iShopId != $iBaseShopId) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); foreach (array_keys(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageIds()) as $iLang) { $sQ = "insert into oxseo ( oxobjectid, oxident, oxshopid, oxlang, oxstdurl, oxseourl, oxtype ) select MD5( LOWER( CONCAT( " . $oDb->quote($iShopId) . ", oxstdurl ) ) ), MD5( LOWER( oxseourl ) ), " . $oDb->quote($iShopId) . ", oxlang, oxstdurl, oxseourl, oxtype from oxseo where oxshopid = '{$iBaseShopId}' and oxtype = 'static' and oxlang='$iLang' "; $oDb->execute($sQ); } } }
[ "public", "function", "copyStaticUrls", "(", "$", "iShopId", ")", "{", "$", "iBaseShopId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getBaseShopId", "(", ")", ";", "if", "(", "$", "iShopId...
Method copies static urls from base shop to newly created @param int $iShopId new created shop id
[ "Method", "copies", "static", "urls", "from", "base", "shop", "to", "newly", "created" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1072-L1084
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.addSeoEntry
public function addSeoEntry($sObjectId, $iShopId, $iLang, $sStdUrl, $sSeoUrl, $sType, $blFixed = 1, $sKeywords = '', $sDescription = '', $sParams = '', $blExclude = false, $sAltObjectId = null) { $sSeoUrl = $this->_processSeoUrl($this->_trimUrl($sSeoUrl ? $sSeoUrl : $this->_getAltUri($sAltObjectId ? $sAltObjectId : $sObjectId, $iLang)), $sObjectId, $iLang, $blExclude); if ($this->_saveToDb($sType, $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId, $blFixed, $sParams)) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); // $sQtedObjectId = $oDb->quote($sAltObjectId ? $sAltObjectId : $sObjectId); $iQtedShopId = $oDb->quote($iShopId); $oStr = getStr(); if ($sKeywords !== false) { $sKeywords = $oDb->quote($oStr->htmlspecialchars($this->encodeString($oStr->strip_tags($sKeywords), false, $iLang))); } if ($sDescription !== false) { $sDescription = $oDb->quote($oStr->htmlspecialchars($oStr->strip_tags($sDescription))); } $sQ = "insert into oxobject2seodata ( oxobjectid, oxshopid, oxlang, oxkeywords, oxdescription ) values ( {$sQtedObjectId}, {$iQtedShopId}, {$iLang}, " . ($sKeywords ? $sKeywords : "''") . ", " . ($sDescription ? $sDescription : "''") . " ) on duplicate key update oxkeywords = " . ($sKeywords ? $sKeywords : "oxkeywords") . ", oxdescription = " . ($sDescription ? $sDescription : "oxdescription"); $oDb->execute($sQ); } }
php
public function addSeoEntry($sObjectId, $iShopId, $iLang, $sStdUrl, $sSeoUrl, $sType, $blFixed = 1, $sKeywords = '', $sDescription = '', $sParams = '', $blExclude = false, $sAltObjectId = null) { $sSeoUrl = $this->_processSeoUrl($this->_trimUrl($sSeoUrl ? $sSeoUrl : $this->_getAltUri($sAltObjectId ? $sAltObjectId : $sObjectId, $iLang)), $sObjectId, $iLang, $blExclude); if ($this->_saveToDb($sType, $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId, $blFixed, $sParams)) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); // $sQtedObjectId = $oDb->quote($sAltObjectId ? $sAltObjectId : $sObjectId); $iQtedShopId = $oDb->quote($iShopId); $oStr = getStr(); if ($sKeywords !== false) { $sKeywords = $oDb->quote($oStr->htmlspecialchars($this->encodeString($oStr->strip_tags($sKeywords), false, $iLang))); } if ($sDescription !== false) { $sDescription = $oDb->quote($oStr->htmlspecialchars($oStr->strip_tags($sDescription))); } $sQ = "insert into oxobject2seodata ( oxobjectid, oxshopid, oxlang, oxkeywords, oxdescription ) values ( {$sQtedObjectId}, {$iQtedShopId}, {$iLang}, " . ($sKeywords ? $sKeywords : "''") . ", " . ($sDescription ? $sDescription : "''") . " ) on duplicate key update oxkeywords = " . ($sKeywords ? $sKeywords : "oxkeywords") . ", oxdescription = " . ($sDescription ? $sDescription : "oxdescription"); $oDb->execute($sQ); } }
[ "public", "function", "addSeoEntry", "(", "$", "sObjectId", ",", "$", "iShopId", ",", "$", "iLang", ",", "$", "sStdUrl", ",", "$", "sSeoUrl", ",", "$", "sType", ",", "$", "blFixed", "=", "1", ",", "$", "sKeywords", "=", "''", ",", "$", "sDescription"...
Adds new seo entry to db @param string $sObjectId objects id @param int $iShopId shop id @param int $iLang objects language @param string $sStdUrl default url @param string $sSeoUrl seo url @param string $sType object type @param bool $blFixed marker to keep seo config unchangeable @param string $sKeywords seo keywords @param string $sDescription seo description @param string $sParams additional seo params. optional (mostly used for db indexing) @param bool $blExclude exclude language prefix while building seo url @param string $sAltObjectId alternative object id used while saving meta info (used to override object id when saving tags related info)
[ "Adds", "new", "seo", "entry", "to", "db" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1135-L1162
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.deleteSeoEntry
public function deleteSeoEntry($objectId, $shopId, $language, $type) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = "delete from oxseo where oxobjectid = " . $database->quote($objectId) . " and oxshopid = " . $database->quote($shopId) . " and oxlang = " . $database->quote($language) . " and oxtype = " . $database->quote($type) . " "; $this->executeDatabaseQuery($query); }
php
public function deleteSeoEntry($objectId, $shopId, $language, $type) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = "delete from oxseo where oxobjectid = " . $database->quote($objectId) . " and oxshopid = " . $database->quote($shopId) . " and oxlang = " . $database->quote($language) . " and oxtype = " . $database->quote($type) . " "; $this->executeDatabaseQuery($query); }
[ "public", "function", "deleteSeoEntry", "(", "$", "objectId", ",", "$", "shopId", ",", "$", "language", ",", "$", "type", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ...
Remove a SEO entry from the database. @param string $objectId The id of the object to delete. @param int $shopId The shop id of the object to delete. @param int $language The language of the object to delete. @param string $type The type of the object to delete.
[ "Remove", "a", "SEO", "entry", "from", "the", "database", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1182-L1189
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.executeDatabaseQuery
protected function executeDatabaseQuery($query) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $database->execute($query); }
php
protected function executeDatabaseQuery($query) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $database->execute($query); }
[ "protected", "function", "executeDatabaseQuery", "(", "$", "query", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "database", "->", "execute", "(", "$", "query"...
Execute a query on the database. @param string $query The command to execute on the database.
[ "Execute", "a", "query", "on", "the", "database", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1196-L1201
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.getMetaData
public function getMetaData($sObjectId, $sMetaType, $iShopId = null, $iLang = null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $iShopId = (!isset($iShopId)) ? \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() : $iShopId; $iLang = (!isset($iLang)) ? \OxidEsales\Eshop\Core\Registry::getLang()->getObjectTplLanguage() : ((int) $iLang); return $oDb->getOne("select {$sMetaType} from oxobject2seodata where oxobjectid = " . $oDb->quote($sObjectId) . " and oxshopid = " . $oDb->quote($iShopId) . " and oxlang = '{$iLang}'"); }
php
public function getMetaData($sObjectId, $sMetaType, $iShopId = null, $iLang = null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $iShopId = (!isset($iShopId)) ? \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() : $iShopId; $iLang = (!isset($iLang)) ? \OxidEsales\Eshop\Core\Registry::getLang()->getObjectTplLanguage() : ((int) $iLang); return $oDb->getOne("select {$sMetaType} from oxobject2seodata where oxobjectid = " . $oDb->quote($sObjectId) . " and oxshopid = " . $oDb->quote($iShopId) . " and oxlang = '{$iLang}'"); }
[ "public", "function", "getMetaData", "(", "$", "sObjectId", ",", "$", "sMetaType", ",", "$", "iShopId", "=", "null", ",", "$", "iLang", "=", "null", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "...
Returns meta information for preferred object @param string $sObjectId information object id @param string $sMetaType metadata type - "oxkeywords", "oxdescription" @param int $iShopId active shop id [optional] @param int $iLang active language [optional] @return string
[ "Returns", "meta", "information", "for", "preferred", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1213-L1221
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.getDynamicUrl
public function getDynamicUrl($sStdUrl, $sSeoUrl, $iLang) { startProfile("getDynamicUrl"); $sDynUrl = $this->_getFullUrl($this->_getDynamicUri($sStdUrl, $sSeoUrl, $iLang), $iLang, strpos($sStdUrl, "https:") === 0); stopProfile("getDynamicUrl"); return $sDynUrl; }
php
public function getDynamicUrl($sStdUrl, $sSeoUrl, $iLang) { startProfile("getDynamicUrl"); $sDynUrl = $this->_getFullUrl($this->_getDynamicUri($sStdUrl, $sSeoUrl, $iLang), $iLang, strpos($sStdUrl, "https:") === 0); stopProfile("getDynamicUrl"); return $sDynUrl; }
[ "public", "function", "getDynamicUrl", "(", "$", "sStdUrl", ",", "$", "sSeoUrl", ",", "$", "iLang", ")", "{", "startProfile", "(", "\"getDynamicUrl\"", ")", ";", "$", "sDynUrl", "=", "$", "this", "->", "_getFullUrl", "(", "$", "this", "->", "_getDynamicUri...
getDynamicUrl acts similar to static urls, except, that dynamic url are not shown in admin and they can be re-encoded by providing new seo url @param string $sStdUrl standard url @param string $sSeoUrl part of URL query which will be attached to standard shop url @param int $iLang active language @access public @return string
[ "getDynamicUrl", "acts", "similar", "to", "static", "urls", "except", "that", "dynamic", "url", "are", "not", "shown", "in", "admin", "and", "they", "can", "be", "re", "-", "encoded", "by", "providing", "new", "seo", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1236-L1243
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.fetchSeoUrl
public function fetchSeoUrl($standardUrl, $languageId = null) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $languageId = isset($languageId) ? ((int) $languageId) : \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $utilsUrl = \OxidEsales\Eshop\Core\Registry::getUtilsUrl(); $urlParameters = $utilsUrl->stringToParamsArray($standardUrl); $noPageNrStandardUrl = $utilsUrl->cleanUrlParams($utilsUrl->cleanUrl($standardUrl, ['pgNr'])); $postfix = isset($urlParameters['pgNr']) ? 'pgNr=' . $urlParameters['pgNr'] : ''; $query = "SELECT `oxseourl` FROM `oxseo` WHERE `oxstdurl` = ? AND `oxlang` = ? AND `oxshopid` = ? LIMIT 1"; $result = $database->getOne($query, [$noPageNrStandardUrl, $languageId, $shopId]); $result = ((false !== $result) && !empty($postfix)) ? $utilsUrl->appendParamSeparator($result) . $postfix : $result; return $result; }
php
public function fetchSeoUrl($standardUrl, $languageId = null) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $languageId = isset($languageId) ? ((int) $languageId) : \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $utilsUrl = \OxidEsales\Eshop\Core\Registry::getUtilsUrl(); $urlParameters = $utilsUrl->stringToParamsArray($standardUrl); $noPageNrStandardUrl = $utilsUrl->cleanUrlParams($utilsUrl->cleanUrl($standardUrl, ['pgNr'])); $postfix = isset($urlParameters['pgNr']) ? 'pgNr=' . $urlParameters['pgNr'] : ''; $query = "SELECT `oxseourl` FROM `oxseo` WHERE `oxstdurl` = ? AND `oxlang` = ? AND `oxshopid` = ? LIMIT 1"; $result = $database->getOne($query, [$noPageNrStandardUrl, $languageId, $shopId]); $result = ((false !== $result) && !empty($postfix)) ? $utilsUrl->appendParamSeparator($result) . $postfix : $result; return $result; }
[ "public", "function", "fetchSeoUrl", "(", "$", "standardUrl", ",", "$", "languageId", "=", "null", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "languageId", ...
Searches for seo url in seo table. If not found - FALSE is returned @param string $standardUrl @param int $languageId @return string|false
[ "Searches", "for", "seo", "url", "in", "seo", "table", ".", "If", "not", "found", "-", "FALSE", "is", "returned" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1253-L1270
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.replaceSpecialChars
protected function replaceSpecialChars($stringWithSpecialChars) { if (!is_string($stringWithSpecialChars)) { return ""; } $oStr = \OxidEsales\Eshop\Core\Str::getStr(); $sQuotedPrefix = preg_quote(self::$_sSeparator . self::$_sPrefix, '/'); $sRegExp = '/[^A-Za-z0-9' . $sQuotedPrefix . '\/]+/'; $sanitized = $oStr->preg_replace( ["/\W*\/\W*/", $sRegExp], ["/", self::$_sSeparator], $stringWithSpecialChars ); return $sanitized; }
php
protected function replaceSpecialChars($stringWithSpecialChars) { if (!is_string($stringWithSpecialChars)) { return ""; } $oStr = \OxidEsales\Eshop\Core\Str::getStr(); $sQuotedPrefix = preg_quote(self::$_sSeparator . self::$_sPrefix, '/'); $sRegExp = '/[^A-Za-z0-9' . $sQuotedPrefix . '\/]+/'; $sanitized = $oStr->preg_replace( ["/\W*\/\W*/", $sRegExp], ["/", self::$_sSeparator], $stringWithSpecialChars ); return $sanitized; }
[ "protected", "function", "replaceSpecialChars", "(", "$", "stringWithSpecialChars", ")", "{", "if", "(", "!", "is_string", "(", "$", "stringWithSpecialChars", ")", ")", "{", "return", "\"\"", ";", "}", "$", "oStr", "=", "\\", "OxidEsales", "\\", "Eshop", "\\...
Searches for special characters in a string and replaces them with the configured strings. @param string $stringWithSpecialChars @return string
[ "Searches", "for", "special", "characters", "in", "a", "string", "and", "replaces", "them", "with", "the", "configured", "strings", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1279-L1294
train
OXID-eSales/oxideshop_ce
source/Core/SeoEncoder.php
SeoEncoder.assembleFullPageUrl
protected function assembleFullPageUrl($object, $type, $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed) { $postfix = (int) $pageNumber > 0 ? 'pgNr=' . (int) $pageNumber : ''; $urlPart = $this->_getPageUri($object, $type, $stdUrl, $seoUrl, $parameters, $languageId, $isFixed); $fullUrl = $this->_getFullUrl($urlPart, $languageId); $fullUrl = (!empty($postfix)) ? \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->appendParamSeparator($fullUrl) . $postfix : $fullUrl; return $fullUrl; }
php
protected function assembleFullPageUrl($object, $type, $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed) { $postfix = (int) $pageNumber > 0 ? 'pgNr=' . (int) $pageNumber : ''; $urlPart = $this->_getPageUri($object, $type, $stdUrl, $seoUrl, $parameters, $languageId, $isFixed); $fullUrl = $this->_getFullUrl($urlPart, $languageId); $fullUrl = (!empty($postfix)) ? \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->appendParamSeparator($fullUrl) . $postfix : $fullUrl; return $fullUrl; }
[ "protected", "function", "assembleFullPageUrl", "(", "$", "object", ",", "$", "type", ",", "$", "stdUrl", ",", "$", "seoUrl", ",", "$", "pageNumber", ",", "$", "parameters", ",", "$", "languageId", ",", "$", "isFixed", ")", "{", "$", "postfix", "=", "(...
Assemble full paginated url. @param \OxidEsales\Eshop\Application\Model\ $object Object, atm category, vendor, manufacturer, recommendationList. @param string $type Seo identifier, see oxseo.oxtype. @param string $stdUrl Standard url @param string $seoUrl Seo url @param integer $pageNumber Number of the page which should be prepared. @param string $parameters Additional parameters, mostly used by mysql for indices. @param int $languageId Language id. @param bool $isFixed Fixed url marker (default is null). @return string
[ "Assemble", "full", "paginated", "url", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoEncoder.php#L1310-L1318
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/PaymentRdfa.php
PaymentRdfa.getAllRDFaPayments
public function getAllRDFaPayments() { $aRDFaPayments = []; $aAssignedRDFaPayments = $this->getAssignedRDFaPayments(); foreach ($this->_aRDFaPayments as $sName => $iType) { $oPayment = new stdClass(); $oPayment->name = $sName; $oPayment->type = $iType; $oPayment->checked = in_array($sName, $aAssignedRDFaPayments); $aRDFaPayments[] = $oPayment; } return $aRDFaPayments; }
php
public function getAllRDFaPayments() { $aRDFaPayments = []; $aAssignedRDFaPayments = $this->getAssignedRDFaPayments(); foreach ($this->_aRDFaPayments as $sName => $iType) { $oPayment = new stdClass(); $oPayment->name = $sName; $oPayment->type = $iType; $oPayment->checked = in_array($sName, $aAssignedRDFaPayments); $aRDFaPayments[] = $oPayment; } return $aRDFaPayments; }
[ "public", "function", "getAllRDFaPayments", "(", ")", "{", "$", "aRDFaPayments", "=", "[", "]", ";", "$", "aAssignedRDFaPayments", "=", "$", "this", "->", "getAssignedRDFaPayments", "(", ")", ";", "foreach", "(", "$", "this", "->", "_aRDFaPayments", "as", "$...
Returns an array including all available RDFa payments. @return array
[ "Returns", "an", "array", "including", "all", "available", "RDFa", "payments", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/PaymentRdfa.php#L77-L90
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/PaymentRdfa.php
PaymentRdfa.getAssignedRDFaPayments
public function getAssignedRDFaPayments() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $aRDFaPayments = []; $sSelect = 'select oxobjectid from oxobject2payment where oxpaymentid=' . $oDb->quote(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid")) . ' and oxtype = "rdfapayment" '; $rs = $oDb->select($sSelect); if ($rs && $rs->count()) { while (!$rs->EOF) { $aRDFaPayments[] = $rs->fields[0]; $rs->fetchRow(); } } return $aRDFaPayments; }
php
public function getAssignedRDFaPayments() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $aRDFaPayments = []; $sSelect = 'select oxobjectid from oxobject2payment where oxpaymentid=' . $oDb->quote(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid")) . ' and oxtype = "rdfapayment" '; $rs = $oDb->select($sSelect); if ($rs && $rs->count()) { while (!$rs->EOF) { $aRDFaPayments[] = $rs->fields[0]; $rs->fetchRow(); } } return $aRDFaPayments; }
[ "public", "function", "getAssignedRDFaPayments", "(", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "aRDFaPayments", "=", "[", "]", ";", "$", "sSelect", "=", "'sel...
Returns array of RDFa payments which are assigned to current payment @return array
[ "Returns", "array", "of", "RDFa", "payments", "which", "are", "assigned", "to", "current", "payment" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/PaymentRdfa.php#L97-L111
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleReview.php
ArticleReview.render
public function render() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); parent::render(); $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $this->_aViewData["edit"] = $article; $articleId = $this->getEditObjectId(); $reviewId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('rev_oxid'); if (isset($articleId) && $articleId != "-1") { // load object $article->load($articleId); if ($article->isDerived()) { $this->_aViewData['readonly'] = true; } $reviewList = $this->_getReviewList($article); foreach ($reviewList as $review) { if ($review->oxreviews__oxid->value == $reviewId) { $review->selected = 1; break; } } $this->_aViewData["allreviews"] = $reviewList; $this->_aViewData["editlanguage"] = $this->_iEditLang; if (isset($reviewId)) { $reviewForEditing = oxNew(\OxidEsales\Eshop\Application\Model\Review::class); $reviewForEditing->load($reviewId); $this->_aViewData["editreview"] = $reviewForEditing; $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class); $user->load($reviewForEditing->oxreviews__oxuserid->value); $this->_aViewData["user"] = $user; } //show "active" checkbox if moderating is active $this->_aViewData["blShowActBox"] = $config->getConfigParam('blGBModerate'); } return "article_review.tpl"; }
php
public function render() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); parent::render(); $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $this->_aViewData["edit"] = $article; $articleId = $this->getEditObjectId(); $reviewId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('rev_oxid'); if (isset($articleId) && $articleId != "-1") { // load object $article->load($articleId); if ($article->isDerived()) { $this->_aViewData['readonly'] = true; } $reviewList = $this->_getReviewList($article); foreach ($reviewList as $review) { if ($review->oxreviews__oxid->value == $reviewId) { $review->selected = 1; break; } } $this->_aViewData["allreviews"] = $reviewList; $this->_aViewData["editlanguage"] = $this->_iEditLang; if (isset($reviewId)) { $reviewForEditing = oxNew(\OxidEsales\Eshop\Application\Model\Review::class); $reviewForEditing->load($reviewId); $this->_aViewData["editreview"] = $reviewForEditing; $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class); $user->load($reviewForEditing->oxreviews__oxuserid->value); $this->_aViewData["user"] = $user; } //show "active" checkbox if moderating is active $this->_aViewData["blShowActBox"] = $config->getConfigParam('blGBModerate'); } return "article_review.tpl"; }
[ "public", "function", "render", "(", ")", "{", "$", "config", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "parent", "::", "render", "(", ")", ";", "$", "article", "=", "oxNew", "(", "\\", ...
Loads selected article review information, returns name of template file "article_review.tpl". @return string
[ "Loads", "selected", "article", "review", "information", "returns", "name", "of", "template", "file", "article_review", ".", "tpl", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleReview.php#L26-L70
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleReview.php
ArticleReview._getReviewList
protected function _getReviewList($article) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = "select oxreviews.* from oxreviews where oxreviews.OXOBJECTID = " . $database->quote($article->oxarticles__oxid->value) . " and oxreviews.oxtype = 'oxarticle'"; $variantList = $article->getVariants(); if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVariantReviews') && count($variantList)) { // verifying rights foreach ($variantList as $variant) { $query .= "or oxreviews.oxobjectid = " . $database->quote($variant->oxarticles__oxid->value) . " "; } } //$sSelect .= "and oxreviews.oxtext".\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageTag($this->_iEditLang)." != ''"; $query .= "and oxreviews.oxlang = '" . $this->_iEditLang . "'"; $query .= "and oxreviews.oxtext != '' "; // all reviews $reviewList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); $reviewList->init("oxreview"); $reviewList->selectString($query); return $reviewList; }
php
protected function _getReviewList($article) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = "select oxreviews.* from oxreviews where oxreviews.OXOBJECTID = " . $database->quote($article->oxarticles__oxid->value) . " and oxreviews.oxtype = 'oxarticle'"; $variantList = $article->getVariants(); if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVariantReviews') && count($variantList)) { // verifying rights foreach ($variantList as $variant) { $query .= "or oxreviews.oxobjectid = " . $database->quote($variant->oxarticles__oxid->value) . " "; } } //$sSelect .= "and oxreviews.oxtext".\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageTag($this->_iEditLang)." != ''"; $query .= "and oxreviews.oxlang = '" . $this->_iEditLang . "'"; $query .= "and oxreviews.oxtext != '' "; // all reviews $reviewList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); $reviewList->init("oxreview"); $reviewList->selectString($query); return $reviewList; }
[ "protected", "function", "_getReviewList", "(", "$", "article", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "query", "=", "\"select oxreviews.* from oxreviews\n ...
returns reviews list for article @param \OxidEsales\Eshop\Application\Model\Article $article Article object @return oxList
[ "returns", "reviews", "list", "for", "article" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleReview.php#L79-L105
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleReview.php
ArticleReview.save
public function save() { parent::save(); $parameters = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); // checkbox handling if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blGBModerate') && !isset($parameters['oxreviews__oxactive'])) { $parameters['oxreviews__oxactive'] = 0; } $review = oxNew(\OxidEsales\Eshop\Application\Model\Review::class); $review->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("rev_oxid")); $review->assign($parameters); $review->save(); }
php
public function save() { parent::save(); $parameters = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); // checkbox handling if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blGBModerate') && !isset($parameters['oxreviews__oxactive'])) { $parameters['oxreviews__oxactive'] = 0; } $review = oxNew(\OxidEsales\Eshop\Application\Model\Review::class); $review->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("rev_oxid")); $review->assign($parameters); $review->save(); }
[ "public", "function", "save", "(", ")", "{", "parent", "::", "save", "(", ")", ";", "$", "parameters", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestParameter", "(", "\"editval\"", "...
Saves article review information changes.
[ "Saves", "article", "review", "information", "changes", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleReview.php#L110-L124
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleReview.php
ArticleReview.delete
public function delete() { $this->resetContentCache(); $reviewId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("rev_oxid"); $review = oxNew(\OxidEsales\Eshop\Application\Model\Review::class); $review->load($reviewId); $review->delete(); // recalculating article average rating $rating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class); $articleId = $this->getEditObjectId(); $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $article->load($articleId); //switch database connection to master for the following read/write access. \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); $article->setRatingAverage($rating->getRatingAverage($articleId, 'oxarticle')); $article->setRatingCount($rating->getRatingCount($articleId, 'oxarticle')); $article->save(); }
php
public function delete() { $this->resetContentCache(); $reviewId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("rev_oxid"); $review = oxNew(\OxidEsales\Eshop\Application\Model\Review::class); $review->load($reviewId); $review->delete(); // recalculating article average rating $rating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class); $articleId = $this->getEditObjectId(); $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $article->load($articleId); //switch database connection to master for the following read/write access. \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); $article->setRatingAverage($rating->getRatingAverage($articleId, 'oxarticle')); $article->setRatingCount($rating->getRatingCount($articleId, 'oxarticle')); $article->save(); }
[ "public", "function", "delete", "(", ")", "{", "$", "this", "->", "resetContentCache", "(", ")", ";", "$", "reviewId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestParameter", "(", ...
Deletes selected article review information.
[ "Deletes", "selected", "article", "review", "information", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleReview.php#L129-L150
train
OXID-eSales/oxideshop_ce
source/Application/Model/MediaUrl.php
MediaUrl.getHtml
public function getHtml() { $sUrl = $this->oxmediaurls__oxurl->value; //youtube link if (strpos($sUrl, 'youtube.com') || strpos($sUrl, 'youtu.be')) { return $this->_getYoutubeHtml(); } //simple link return $this->getHtmlLink(); }
php
public function getHtml() { $sUrl = $this->oxmediaurls__oxurl->value; //youtube link if (strpos($sUrl, 'youtube.com') || strpos($sUrl, 'youtu.be')) { return $this->_getYoutubeHtml(); } //simple link return $this->getHtmlLink(); }
[ "public", "function", "getHtml", "(", ")", "{", "$", "sUrl", "=", "$", "this", "->", "oxmediaurls__oxurl", "->", "value", ";", "//youtube link", "if", "(", "strpos", "(", "$", "sUrl", ",", "'youtube.com'", ")", "||", "strpos", "(", "$", "sUrl", ",", "'...
Return HTML code depending on current URL @return string
[ "Return", "HTML", "code", "depending", "on", "current", "URL" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/MediaUrl.php#L36-L46
train
OXID-eSales/oxideshop_ce
source/Application/Model/MediaUrl.php
MediaUrl.getHtmlLink
public function getHtmlLink($blNewPage = true) { $sForceBlank = $blNewPage ? ' target="_blank"' : ''; $sDesc = $this->oxmediaurls__oxdesc->value; $sUrl = $this->getLink(); $sHtmlLink = "<a href=\"$sUrl\"{$sForceBlank}>$sDesc</a>"; return $sHtmlLink; }
php
public function getHtmlLink($blNewPage = true) { $sForceBlank = $blNewPage ? ' target="_blank"' : ''; $sDesc = $this->oxmediaurls__oxdesc->value; $sUrl = $this->getLink(); $sHtmlLink = "<a href=\"$sUrl\"{$sForceBlank}>$sDesc</a>"; return $sHtmlLink; }
[ "public", "function", "getHtmlLink", "(", "$", "blNewPage", "=", "true", ")", "{", "$", "sForceBlank", "=", "$", "blNewPage", "?", "' target=\"_blank\"'", ":", "''", ";", "$", "sDesc", "=", "$", "this", "->", "oxmediaurls__oxdesc", "->", "value", ";", "$",...
Returns simple HTML link @param bool $blNewPage Whether to open link in new window (adds target=_blank to link) @return string
[ "Returns", "simple", "HTML", "link" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/MediaUrl.php#L55-L64
train
OXID-eSales/oxideshop_ce
source/Application/Model/MediaUrl.php
MediaUrl.delete
public function delete($sOXID = null) { $sFilePath = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sShopDir') . "/out/media/" . basename($this->oxmediaurls__oxurl->value); if ($this->oxmediaurls__oxisuploaded->value) { if (file_exists($sFilePath)) { unlink($sFilePath); } } return parent::delete($sOXID); }
php
public function delete($sOXID = null) { $sFilePath = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sShopDir') . "/out/media/" . basename($this->oxmediaurls__oxurl->value); if ($this->oxmediaurls__oxisuploaded->value) { if (file_exists($sFilePath)) { unlink($sFilePath); } } return parent::delete($sOXID); }
[ "public", "function", "delete", "(", "$", "sOXID", "=", "null", ")", "{", "$", "sFilePath", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'sShopDir'", ")", ".", "\"/out/...
Deletes record and unlinks the file @param string $sOXID Object ID(default null) @return bool
[ "Deletes", "record", "and", "unlinks", "the", "file" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/MediaUrl.php#L101-L113
train
OXID-eSales/oxideshop_ce
source/Application/Model/MediaUrl.php
MediaUrl._getYoutubeHtml
protected function _getYoutubeHtml() { $sUrl = $this->oxmediaurls__oxurl->value; $sDesc = $this->oxmediaurls__oxdesc->value; if (strpos($sUrl, 'youtube.com')) { $sYoutubeUrl = str_replace("www.youtube.com/watch?v=", "www.youtube.com/embed/", $sUrl); $sYoutubeUrl = preg_replace('/&amp;/', '?', $sYoutubeUrl, 1); } if (strpos($sUrl, 'youtu.be')) { $sYoutubeUrl = str_replace("youtu.be/", "www.youtube.com/embed/", $sUrl); } $sYoutubeTemplate = '%s<br><iframe width="425" height="344" src="%s" frameborder="0" allowfullscreen></iframe>'; $sYoutubeHtml = sprintf($sYoutubeTemplate, $sDesc, $sYoutubeUrl, $sYoutubeUrl); return $sYoutubeHtml; }
php
protected function _getYoutubeHtml() { $sUrl = $this->oxmediaurls__oxurl->value; $sDesc = $this->oxmediaurls__oxdesc->value; if (strpos($sUrl, 'youtube.com')) { $sYoutubeUrl = str_replace("www.youtube.com/watch?v=", "www.youtube.com/embed/", $sUrl); $sYoutubeUrl = preg_replace('/&amp;/', '?', $sYoutubeUrl, 1); } if (strpos($sUrl, 'youtu.be')) { $sYoutubeUrl = str_replace("youtu.be/", "www.youtube.com/embed/", $sUrl); } $sYoutubeTemplate = '%s<br><iframe width="425" height="344" src="%s" frameborder="0" allowfullscreen></iframe>'; $sYoutubeHtml = sprintf($sYoutubeTemplate, $sDesc, $sYoutubeUrl, $sYoutubeUrl); return $sYoutubeHtml; }
[ "protected", "function", "_getYoutubeHtml", "(", ")", "{", "$", "sUrl", "=", "$", "this", "->", "oxmediaurls__oxurl", "->", "value", ";", "$", "sDesc", "=", "$", "this", "->", "oxmediaurls__oxdesc", "->", "value", ";", "if", "(", "strpos", "(", "$", "sUr...
Transforms the link to YouTube object, and returns it. @return string
[ "Transforms", "the", "link", "to", "YouTube", "object", "and", "returns", "it", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/MediaUrl.php#L120-L137
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleTemplatePathCalculator.php
ModuleTemplatePathCalculator.calculateModuleTemplatePath
public function calculateModuleTemplatePath($templateName) { $moduleList = $this->getModuleList(); $theme = $this->getTheme(); $moduleTemplates = $moduleList->getModuleTemplates(); $activeModules = $moduleList->getActiveModuleInfo(); $finalTemplatePath = ''; if (is_array($moduleTemplates) && is_array($activeModules)) { foreach ($moduleTemplates as $sModuleId => $aTemplates) { // check if module is active if (isset($activeModules[$sModuleId])) { $foundTemplate = null; $fileSystem = $this->getFileSystem(); // check if template for our active themes exists foreach ((array) $theme->getActiveThemesList() as $oneActiveThemeId) { if (isset($aTemplates[$oneActiveThemeId], $aTemplates[$oneActiveThemeId][$templateName])) { $foundTemplate = $fileSystem->combinePaths($this->getModulesPath(), $aTemplates[$oneActiveThemeId][$templateName]); } } // if not found in theme specific configurations if (!$foundTemplate && isset($aTemplates[$templateName])) { $foundTemplate = $fileSystem->combinePaths($this->getModulesPath(), $aTemplates[$templateName]); } if ($foundTemplate) { if ($fileSystem->isReadable($foundTemplate)) { $finalTemplatePath = $foundTemplate; break; } else { throw oxNew('oxException', sprintf('Cannot find template file "%s".', $foundTemplate)); } } } } } if (!$finalTemplatePath) { throw oxNew('oxException', sprintf('Cannot find template "%s" in modules configuration.', $templateName)); } return $finalTemplatePath; }
php
public function calculateModuleTemplatePath($templateName) { $moduleList = $this->getModuleList(); $theme = $this->getTheme(); $moduleTemplates = $moduleList->getModuleTemplates(); $activeModules = $moduleList->getActiveModuleInfo(); $finalTemplatePath = ''; if (is_array($moduleTemplates) && is_array($activeModules)) { foreach ($moduleTemplates as $sModuleId => $aTemplates) { // check if module is active if (isset($activeModules[$sModuleId])) { $foundTemplate = null; $fileSystem = $this->getFileSystem(); // check if template for our active themes exists foreach ((array) $theme->getActiveThemesList() as $oneActiveThemeId) { if (isset($aTemplates[$oneActiveThemeId], $aTemplates[$oneActiveThemeId][$templateName])) { $foundTemplate = $fileSystem->combinePaths($this->getModulesPath(), $aTemplates[$oneActiveThemeId][$templateName]); } } // if not found in theme specific configurations if (!$foundTemplate && isset($aTemplates[$templateName])) { $foundTemplate = $fileSystem->combinePaths($this->getModulesPath(), $aTemplates[$templateName]); } if ($foundTemplate) { if ($fileSystem->isReadable($foundTemplate)) { $finalTemplatePath = $foundTemplate; break; } else { throw oxNew('oxException', sprintf('Cannot find template file "%s".', $foundTemplate)); } } } } } if (!$finalTemplatePath) { throw oxNew('oxException', sprintf('Cannot find template "%s" in modules configuration.', $templateName)); } return $finalTemplatePath; }
[ "public", "function", "calculateModuleTemplatePath", "(", "$", "templateName", ")", "{", "$", "moduleList", "=", "$", "this", "->", "getModuleList", "(", ")", ";", "$", "theme", "=", "$", "this", "->", "getTheme", "(", ")", ";", "$", "moduleTemplates", "="...
Finds the template by name in modules @param string $templateName @return string @throws oxException
[ "Finds", "the", "template", "by", "name", "in", "modules" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleTemplatePathCalculator.php#L81-L126
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountNoticeListController.php
AccountNoticeListController.getNoticeProductList
public function getNoticeProductList() { if ($this->_aNoticeProductList === null) { if ($oUser = $this->getUser()) { $this->_aNoticeProductList = $oUser->getBasket('noticelist')->getArticles(); } } return $this->_aNoticeProductList; }
php
public function getNoticeProductList() { if ($this->_aNoticeProductList === null) { if ($oUser = $this->getUser()) { $this->_aNoticeProductList = $oUser->getBasket('noticelist')->getArticles(); } } return $this->_aNoticeProductList; }
[ "public", "function", "getNoticeProductList", "(", ")", "{", "if", "(", "$", "this", "->", "_aNoticeProductList", "===", "null", ")", "{", "if", "(", "$", "oUser", "=", "$", "this", "->", "getUser", "(", ")", ")", "{", "$", "this", "->", "_aNoticeProdu...
Template variable getter. Returns an array if there is something in the list @return array
[ "Template", "variable", "getter", ".", "Returns", "an", "array", "if", "there", "is", "something", "in", "the", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountNoticeListController.php#L90-L99
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountNoticeListController.php
AccountNoticeListController.getSimilarProducts
public function getSimilarProducts() { // similar products list if ($this->_aSimilarProductList === null && count($this->getNoticeProductList())) { // just ensuring that next call will skip this check $this->_aSimilarProductList = false; // loading similar products if ($oSimilarProd = current($this->getNoticeProductList())) { $this->_aSimilarProductList = $oSimilarProd->getSimilarProducts(); } } return $this->_aSimilarProductList; }
php
public function getSimilarProducts() { // similar products list if ($this->_aSimilarProductList === null && count($this->getNoticeProductList())) { // just ensuring that next call will skip this check $this->_aSimilarProductList = false; // loading similar products if ($oSimilarProd = current($this->getNoticeProductList())) { $this->_aSimilarProductList = $oSimilarProd->getSimilarProducts(); } } return $this->_aSimilarProductList; }
[ "public", "function", "getSimilarProducts", "(", ")", "{", "// similar products list", "if", "(", "$", "this", "->", "_aSimilarProductList", "===", "null", "&&", "count", "(", "$", "this", "->", "getNoticeProductList", "(", ")", ")", ")", "{", "// just ensuring ...
Template variable getter. Returns the products which are in the noticelist @return array
[ "Template", "variable", "getter", ".", "Returns", "the", "products", "which", "are", "in", "the", "noticelist" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountNoticeListController.php#L106-L120
train
OXID-eSales/oxideshop_ce
source/Application/Controller/WishListController.php
WishListController.getWishUser
public function getWishUser() { if ($this->_oWishUser === null) { $this->_oWishUser = false; $sWishIdParameter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('wishid'); $sUserId = $sWishIdParameter ? $sWishIdParameter : \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('wishid'); if ($sUserId) { $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($oUser->load($sUserId)) { // passing wishlist information $this->_oWishUser = $oUser; // store this one to session \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('wishid', $sUserId); } } } return $this->_oWishUser; }
php
public function getWishUser() { if ($this->_oWishUser === null) { $this->_oWishUser = false; $sWishIdParameter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('wishid'); $sUserId = $sWishIdParameter ? $sWishIdParameter : \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('wishid'); if ($sUserId) { $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($oUser->load($sUserId)) { // passing wishlist information $this->_oWishUser = $oUser; // store this one to session \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('wishid', $sUserId); } } } return $this->_oWishUser; }
[ "public", "function", "getWishUser", "(", ")", "{", "if", "(", "$", "this", "->", "_oWishUser", "===", "null", ")", "{", "$", "this", "->", "_oWishUser", "=", "false", ";", "$", "sWishIdParameter", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", ...
return the user which is owner of the wish list @return object | bool
[ "return", "the", "user", "which", "is", "owner", "of", "the", "wish", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/WishListController.php#L65-L86
train
OXID-eSales/oxideshop_ce
source/Application/Controller/WishListController.php
WishListController.getWishList
public function getWishList() { if ($this->_oWishList === null) { $this->_oWishList = false; // passing wishlist information if ($oUser = $this->getWishUser()) { $oWishlistBasket = $oUser->getBasket('wishlist'); $this->_oWishList = $oWishlistBasket->getArticles(); if (!$oWishlistBasket->isVisible()) { $this->_oWishList = false; } } } return $this->_oWishList; }
php
public function getWishList() { if ($this->_oWishList === null) { $this->_oWishList = false; // passing wishlist information if ($oUser = $this->getWishUser()) { $oWishlistBasket = $oUser->getBasket('wishlist'); $this->_oWishList = $oWishlistBasket->getArticles(); if (!$oWishlistBasket->isVisible()) { $this->_oWishList = false; } } } return $this->_oWishList; }
[ "public", "function", "getWishList", "(", ")", "{", "if", "(", "$", "this", "->", "_oWishList", "===", "null", ")", "{", "$", "this", "->", "_oWishList", "=", "false", ";", "// passing wishlist information", "if", "(", "$", "oUser", "=", "$", "this", "->...
return the articles which are in the wish list @return object | bool
[ "return", "the", "articles", "which", "are", "in", "the", "wish", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/WishListController.php#L93-L110
train
OXID-eSales/oxideshop_ce
source/Core/PriceList.php
PriceList.getBruttoSum
public function getBruttoSum() { $dSum = 0; foreach ($this->_aList as $oPrice) { $dSum += $oPrice->getBruttoPrice(); } return $dSum; }
php
public function getBruttoSum() { $dSum = 0; foreach ($this->_aList as $oPrice) { $dSum += $oPrice->getBruttoPrice(); } return $dSum; }
[ "public", "function", "getBruttoSum", "(", ")", "{", "$", "dSum", "=", "0", ";", "foreach", "(", "$", "this", "->", "_aList", "as", "$", "oPrice", ")", "{", "$", "dSum", "+=", "$", "oPrice", "->", "getBruttoPrice", "(", ")", ";", "}", "return", "$"...
Returns Brutto price sum @return double
[ "Returns", "Brutto", "price", "sum" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PriceList.php#L37-L45
train
OXID-eSales/oxideshop_ce
source/Core/PriceList.php
PriceList.getNettoSum
public function getNettoSum() { $dSum = 0; foreach ($this->_aList as $oPrice) { $dSum += $oPrice->getNettoPrice(); } return $dSum; }
php
public function getNettoSum() { $dSum = 0; foreach ($this->_aList as $oPrice) { $dSum += $oPrice->getNettoPrice(); } return $dSum; }
[ "public", "function", "getNettoSum", "(", ")", "{", "$", "dSum", "=", "0", ";", "foreach", "(", "$", "this", "->", "_aList", "as", "$", "oPrice", ")", "{", "$", "dSum", "+=", "$", "oPrice", "->", "getNettoPrice", "(", ")", ";", "}", "return", "$", ...
Returns the sum of list Netto prices @return double
[ "Returns", "the", "sum", "of", "list", "Netto", "prices" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PriceList.php#L52-L60
train
OXID-eSales/oxideshop_ce
source/Core/PriceList.php
PriceList.getVatInfo
public function getVatInfo($isNettoMode = true) { $aVatValues = []; $aPrices = []; foreach ($this->_aList as $oPrice) { $sKey = ( string ) $oPrice->getVat(); if (!isset($aPrices[$sKey])) { $aPrices[$sKey]['sum'] = 0; $aPrices[$sKey]['vat'] = $oPrice->getVat(); } $aPrices[$sKey]['sum'] += $oPrice->getPrice(); } foreach ($aPrices as $sKey => $aPrice) { if ($isNettoMode) { $dPrice = $aPrice['sum'] * $aPrice['vat'] / 100; } else { $dPrice = $aPrice['sum'] * $aPrice['vat'] / (100 + $aPrice['vat']); } $aVatValues[$sKey] = $dPrice; } return $aVatValues; }
php
public function getVatInfo($isNettoMode = true) { $aVatValues = []; $aPrices = []; foreach ($this->_aList as $oPrice) { $sKey = ( string ) $oPrice->getVat(); if (!isset($aPrices[$sKey])) { $aPrices[$sKey]['sum'] = 0; $aPrices[$sKey]['vat'] = $oPrice->getVat(); } $aPrices[$sKey]['sum'] += $oPrice->getPrice(); } foreach ($aPrices as $sKey => $aPrice) { if ($isNettoMode) { $dPrice = $aPrice['sum'] * $aPrice['vat'] / 100; } else { $dPrice = $aPrice['sum'] * $aPrice['vat'] / (100 + $aPrice['vat']); } $aVatValues[$sKey] = $dPrice; } return $aVatValues; }
[ "public", "function", "getVatInfo", "(", "$", "isNettoMode", "=", "true", ")", "{", "$", "aVatValues", "=", "[", "]", ";", "$", "aPrices", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "_aList", "as", "$", "oPrice", ")", "{", "$", "sKey", ...
Returns VAT values sum separated to different array elements depending on VAT @param bool $isNettoMode mode in which calculate sum, default netto @return array
[ "Returns", "VAT", "values", "sum", "separated", "to", "different", "array", "elements", "depending", "on", "VAT" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PriceList.php#L85-L108
train
OXID-eSales/oxideshop_ce
source/Core/PriceList.php
PriceList.getPriceInfo
public function getPriceInfo() { $aPrices = []; foreach ($this->_aList as $oPrice) { $sVat = ( string ) $oPrice->getVat(); if (!isset($aPrices[$sVat])) { $aPrices[$sVat] = 0; } $aPrices[$sVat] += $oPrice->getBruttoPrice(); } return $aPrices; }
php
public function getPriceInfo() { $aPrices = []; foreach ($this->_aList as $oPrice) { $sVat = ( string ) $oPrice->getVat(); if (!isset($aPrices[$sVat])) { $aPrices[$sVat] = 0; } $aPrices[$sVat] += $oPrice->getBruttoPrice(); } return $aPrices; }
[ "public", "function", "getPriceInfo", "(", ")", "{", "$", "aPrices", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "_aList", "as", "$", "oPrice", ")", "{", "$", "sVat", "=", "(", "string", ")", "$", "oPrice", "->", "getVat", "(", ")", ";...
Return prices separated to different array elements depending on VAT @return array
[ "Return", "prices", "separated", "to", "different", "array", "elements", "depending", "on", "VAT" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PriceList.php#L116-L128
train
OXID-eSales/oxideshop_ce
source/Core/PriceList.php
PriceList.getProportionalVatPercent
public function getProportionalVatPercent() { $dTotalSum = 0; foreach ($this->_aList as $oPrice) { $dTotalSum += $oPrice->getNettoPrice(); } $dProportionalVat = 0; foreach ($this->_aList as $oPrice) { if ($dTotalSum > 0) { $dProportionalVat += $oPrice->getNettoPrice() / $dTotalSum * $oPrice->getVat(); } } return $dProportionalVat; }
php
public function getProportionalVatPercent() { $dTotalSum = 0; foreach ($this->_aList as $oPrice) { $dTotalSum += $oPrice->getNettoPrice(); } $dProportionalVat = 0; foreach ($this->_aList as $oPrice) { if ($dTotalSum > 0) { $dProportionalVat += $oPrice->getNettoPrice() / $dTotalSum * $oPrice->getVat(); } } return $dProportionalVat; }
[ "public", "function", "getProportionalVatPercent", "(", ")", "{", "$", "dTotalSum", "=", "0", ";", "foreach", "(", "$", "this", "->", "_aList", "as", "$", "oPrice", ")", "{", "$", "dTotalSum", "+=", "$", "oPrice", "->", "getNettoPrice", "(", ")", ";", ...
Iterates through applied VATs and calculates proportional VAT @return double
[ "Iterates", "through", "applied", "VATs", "and", "calculates", "proportional", "VAT" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PriceList.php#L151-L168
train
OXID-eSales/oxideshop_ce
source/Internal/Module/MetaData/Service/MetaDataSchemataProvider.php
MetaDataSchemataProvider.arrayFlipRecursive
private function arrayFlipRecursive(array $metaDataVersion): array { $transposedArray = []; foreach ($metaDataVersion as $key => $item) { if (is_numeric($key) && \is_string($item)) { $transposedArray[$this->convertKeyToLowerCase($item)] = $key; } elseif (\is_string($key) && \is_array($item)) { $transposedArray[$this->convertKeyToLowerCase($key)] = $this->arrayFlipRecursive($item); } } return $transposedArray; }
php
private function arrayFlipRecursive(array $metaDataVersion): array { $transposedArray = []; foreach ($metaDataVersion as $key => $item) { if (is_numeric($key) && \is_string($item)) { $transposedArray[$this->convertKeyToLowerCase($item)] = $key; } elseif (\is_string($key) && \is_array($item)) { $transposedArray[$this->convertKeyToLowerCase($key)] = $this->arrayFlipRecursive($item); } } return $transposedArray; }
[ "private", "function", "arrayFlipRecursive", "(", "array", "$", "metaDataVersion", ")", ":", "array", "{", "$", "transposedArray", "=", "[", "]", ";", "foreach", "(", "$", "metaDataVersion", "as", "$", "key", "=>", "$", "item", ")", "{", "if", "(", "is_n...
Recursively exchange keys and values for a given array @param array $metaDataVersion @return array
[ "Recursively", "exchange", "keys", "and", "values", "for", "a", "given", "array" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Module/MetaData/Service/MetaDataSchemataProvider.php#L78-L91
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop.getTables
public function getTables() { if (is_null($this->_aTables)) { $aTables = $this->formDatabaseTablesArray(); $this->setTables($aTables); } return $this->_aTables; }
php
public function getTables() { if (is_null($this->_aTables)) { $aTables = $this->formDatabaseTablesArray(); $this->setTables($aTables); } return $this->_aTables; }
[ "public", "function", "getTables", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "_aTables", ")", ")", "{", "$", "aTables", "=", "$", "this", "->", "formDatabaseTablesArray", "(", ")", ";", "$", "this", "->", "setTables", "(", "$", "aT...
Database tables getter. @return array
[ "Database", "tables", "getter", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L45-L53
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop.createViewQuery
public function createViewQuery($sTable, $aLanguages = null) { $sStart = 'CREATE OR REPLACE SQL SECURITY INVOKER VIEW'; if (!is_array($aLanguages)) { $aLanguages = [null => null]; } foreach ($aLanguages as $iLang => $sLang) { $this->addViewLanguageQuery($sStart, $sTable, $iLang, $sLang); } }
php
public function createViewQuery($sTable, $aLanguages = null) { $sStart = 'CREATE OR REPLACE SQL SECURITY INVOKER VIEW'; if (!is_array($aLanguages)) { $aLanguages = [null => null]; } foreach ($aLanguages as $iLang => $sLang) { $this->addViewLanguageQuery($sStart, $sTable, $iLang, $sLang); } }
[ "public", "function", "createViewQuery", "(", "$", "sTable", ",", "$", "aLanguages", "=", "null", ")", "{", "$", "sStart", "=", "'CREATE OR REPLACE SQL SECURITY INVOKER VIEW'", ";", "if", "(", "!", "is_array", "(", "$", "aLanguages", ")", ")", "{", "$", "aLa...
Creates view query and adds it to query array. @param string $sTable Table name @param array $aLanguages Language array( id => abbreviation )
[ "Creates", "view", "query", "and", "adds", "it", "to", "query", "array", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L171-L182
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop._getViewSelect
protected function _getViewSelect($sTable, $iLang) { $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class); $aFields = $oMetaData->getSinglelangFields($sTable, $iLang); foreach ($aFields as $sCoreField => $sField) { if ($sCoreField !== $sField) { $aFields[$sCoreField] = $sField . ' AS ' . $sCoreField; } } return implode(',', $aFields); }
php
protected function _getViewSelect($sTable, $iLang) { $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class); $aFields = $oMetaData->getSinglelangFields($sTable, $iLang); foreach ($aFields as $sCoreField => $sField) { if ($sCoreField !== $sField) { $aFields[$sCoreField] = $sField . ' AS ' . $sCoreField; } } return implode(',', $aFields); }
[ "protected", "function", "_getViewSelect", "(", "$", "sTable", ",", "$", "iLang", ")", "{", "$", "oMetaData", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DbMetaDataHandler", "::", "class", ")", ";", "$", "aFields", "=", "$"...
Returns table field name mapping sql section for single language views @param string $sTable Table name @param int $iLang Language id @return string
[ "Returns", "table", "field", "name", "mapping", "sql", "section", "for", "single", "language", "views" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L192-L203
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop._getViewSelectMultilang
protected function _getViewSelectMultilang($sTable) { $aFields = []; $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class); $aTables = array_merge([$sTable], $oMetaData->getAllMultiTables($sTable)); foreach ($aTables as $sTableKey => $sTableName) { $aTableFields = $oMetaData->getFields($sTableName); foreach ($aTableFields as $sCoreField => $sField) { if (!isset($aFields[$sCoreField])) { $aFields[$sCoreField] = $sField; } } } return implode(',', $aFields); }
php
protected function _getViewSelectMultilang($sTable) { $aFields = []; $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class); $aTables = array_merge([$sTable], $oMetaData->getAllMultiTables($sTable)); foreach ($aTables as $sTableKey => $sTableName) { $aTableFields = $oMetaData->getFields($sTableName); foreach ($aTableFields as $sCoreField => $sField) { if (!isset($aFields[$sCoreField])) { $aFields[$sCoreField] = $sField; } } } return implode(',', $aFields); }
[ "protected", "function", "_getViewSelectMultilang", "(", "$", "sTable", ")", "{", "$", "aFields", "=", "[", "]", ";", "$", "oMetaData", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DbMetaDataHandler", "::", "class", ")", ";", ...
Returns table fields sql section for multiple language views @param string $sTable table name @return string
[ "Returns", "table", "fields", "sql", "section", "for", "multiple", "language", "views" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L212-L228
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop._getViewJoinAll
protected function _getViewJoinAll($sTable) { $sJoin = ' '; $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class); $aTables = $oMetaData->getAllMultiTables($sTable); if (count($aTables)) { foreach ($aTables as $sTableKey => $sTableName) { $sJoin .= "LEFT JOIN {$sTableName} USING (OXID) "; } } return $sJoin; }
php
protected function _getViewJoinAll($sTable) { $sJoin = ' '; $oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class); $aTables = $oMetaData->getAllMultiTables($sTable); if (count($aTables)) { foreach ($aTables as $sTableKey => $sTableName) { $sJoin .= "LEFT JOIN {$sTableName} USING (OXID) "; } } return $sJoin; }
[ "protected", "function", "_getViewJoinAll", "(", "$", "sTable", ")", "{", "$", "sJoin", "=", "' '", ";", "$", "oMetaData", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DbMetaDataHandler", "::", "class", ")", ";", "$", "aTabl...
Returns all language table view JOIN section @param string $sTable table name @return string $sSQL
[ "Returns", "all", "language", "table", "view", "JOIN", "section" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L237-L249
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop._getViewJoinLang
protected function _getViewJoinLang($sTable, $iLang) { $sJoin = ' '; $sLangTable = getLangTableName($sTable, $iLang); if ($sLangTable && $sLangTable !== $sTable) { $sJoin .= "LEFT JOIN {$sLangTable} USING (OXID) "; } return $sJoin; }
php
protected function _getViewJoinLang($sTable, $iLang) { $sJoin = ' '; $sLangTable = getLangTableName($sTable, $iLang); if ($sLangTable && $sLangTable !== $sTable) { $sJoin .= "LEFT JOIN {$sLangTable} USING (OXID) "; } return $sJoin; }
[ "protected", "function", "_getViewJoinLang", "(", "$", "sTable", ",", "$", "iLang", ")", "{", "$", "sJoin", "=", "' '", ";", "$", "sLangTable", "=", "getLangTableName", "(", "$", "sTable", ",", "$", "iLang", ")", ";", "if", "(", "$", "sLangTable", "&&"...
Returns language table view JOIN section @param string $sTable table name @param int $iLang language id @return string $sSQL
[ "Returns", "language", "table", "view", "JOIN", "section" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L259-L268
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop._cleanInvalidViews
protected function _cleanInvalidViews() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aLanguages = $oLang->getLanguageIds($this->getId()); $aMultilangTables = \OxidEsales\Eshop\Core\Registry::getLang()->getMultiLangTables(); $aMultishopTables = $this->getMultiShopTables(); $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aAllShopLanguages = $oLang->getAllShopLanguageIds(); $oViewsValidator = oxNew(\OxidEsales\Eshop\Application\Model\ShopViewValidator::class); $oViewsValidator->setShopId($this->getId()); $oViewsValidator->setLanguages($aLanguages); $oViewsValidator->setAllShopLanguages($aAllShopLanguages); $oViewsValidator->setMultiLangTables($aMultilangTables); $oViewsValidator->setMultiShopTables($aMultishopTables); $aViews = $oViewsValidator->getInvalidViews(); foreach ($aViews as $sView) { $oDb->execute('DROP VIEW IF EXISTS `' . $sView . '`'); } }
php
protected function _cleanInvalidViews() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aLanguages = $oLang->getLanguageIds($this->getId()); $aMultilangTables = \OxidEsales\Eshop\Core\Registry::getLang()->getMultiLangTables(); $aMultishopTables = $this->getMultiShopTables(); $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aAllShopLanguages = $oLang->getAllShopLanguageIds(); $oViewsValidator = oxNew(\OxidEsales\Eshop\Application\Model\ShopViewValidator::class); $oViewsValidator->setShopId($this->getId()); $oViewsValidator->setLanguages($aLanguages); $oViewsValidator->setAllShopLanguages($aAllShopLanguages); $oViewsValidator->setMultiLangTables($aMultilangTables); $oViewsValidator->setMultiShopTables($aMultishopTables); $aViews = $oViewsValidator->getInvalidViews(); foreach ($aViews as $sView) { $oDb->execute('DROP VIEW IF EXISTS `' . $sView . '`'); } }
[ "protected", "function", "_cleanInvalidViews", "(", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "oLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\...
Gets all invalid views and drops them from database
[ "Gets", "all", "invalid", "views", "and", "drops", "them", "from", "database" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L273-L298
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop._prepareViewsQueries
protected function _prepareViewsQueries() { $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aLanguages = $oLang->getLanguageIds($this->getId()); $aMultilangTables = \OxidEsales\Eshop\Core\Registry::getLang()->getMultiLangTables(); $aTables = $this->getTables(); foreach ($aTables as $sTable) { $this->createViewQuery($sTable); if (in_array($sTable, $aMultilangTables)) { $this->createViewQuery($sTable, $aLanguages); } } }
php
protected function _prepareViewsQueries() { $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aLanguages = $oLang->getLanguageIds($this->getId()); $aMultilangTables = \OxidEsales\Eshop\Core\Registry::getLang()->getMultiLangTables(); $aTables = $this->getTables(); foreach ($aTables as $sTable) { $this->createViewQuery($sTable); if (in_array($sTable, $aMultilangTables)) { $this->createViewQuery($sTable, $aLanguages); } } }
[ "protected", "function", "_prepareViewsQueries", "(", ")", "{", "$", "oLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", ";", "$", "aLanguages", "=", "$", "oLang", "->", "getLanguageIds", "(", "$", ...
Creates all view queries and adds them in query array
[ "Creates", "all", "view", "queries", "and", "adds", "them", "in", "query", "array" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L303-L316
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop.addViewLanguageQuery
protected function addViewLanguageQuery($queryStart, $table, $languageId, $languageAbbr) { $sLangAddition = $languageAbbr === null ? '' : "_{$languageAbbr}"; $sViewTable = "oxv_{$table}{$sLangAddition}"; if ($languageAbbr === null) { $sFields = $this->_getViewSelectMultilang($table); $sJoin = $this->_getViewJoinAll($table); } else { $sFields = $this->_getViewSelect($table, $languageId); $sJoin = $this->_getViewJoinLang($table, $languageId); } $sQuery = "{$queryStart} `{$sViewTable}` AS SELECT {$sFields} FROM {$table}{$sJoin}"; $this->addQuery($sQuery); }
php
protected function addViewLanguageQuery($queryStart, $table, $languageId, $languageAbbr) { $sLangAddition = $languageAbbr === null ? '' : "_{$languageAbbr}"; $sViewTable = "oxv_{$table}{$sLangAddition}"; if ($languageAbbr === null) { $sFields = $this->_getViewSelectMultilang($table); $sJoin = $this->_getViewJoinAll($table); } else { $sFields = $this->_getViewSelect($table, $languageId); $sJoin = $this->_getViewJoinLang($table, $languageId); } $sQuery = "{$queryStart} `{$sViewTable}` AS SELECT {$sFields} FROM {$table}{$sJoin}"; $this->addQuery($sQuery); }
[ "protected", "function", "addViewLanguageQuery", "(", "$", "queryStart", ",", "$", "table", ",", "$", "languageId", ",", "$", "languageAbbr", ")", "{", "$", "sLangAddition", "=", "$", "languageAbbr", "===", "null", "?", "''", ":", "\"_{$languageAbbr}\"", ";", ...
Adds view language query to query array. @param string $queryStart @param string $table @param int $languageId @param string $languageAbbr
[ "Adds", "view", "language", "query", "to", "query", "array", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L326-L342
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop._runQueries
protected function _runQueries() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $aQueries = $this->getQueries(); $bSuccess = true; foreach ($aQueries as $sQuery) { try { $oDb->execute($sQuery); } catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) { \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]); $bSuccess = false; } } return $bSuccess; }
php
protected function _runQueries() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $aQueries = $this->getQueries(); $bSuccess = true; foreach ($aQueries as $sQuery) { try { $oDb->execute($sQuery); } catch (\OxidEsales\Eshop\Core\Exception\StandardException $exception) { \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]); $bSuccess = false; } } return $bSuccess; }
[ "protected", "function", "_runQueries", "(", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "aQueries", "=", "$", "this", "->", "getQueries", "(", ")", ";", "$", ...
Runs stored queries Returns false when any of the queries fail, otherwise return true @return bool
[ "Runs", "stored", "queries", "Returns", "false", "when", "any", "of", "the", "queries", "fail", "otherwise", "return", "true" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L350-L365
train
OXID-eSales/oxideshop_ce
source/Application/Model/Shop.php
Shop.formDatabaseTablesArray
protected function formDatabaseTablesArray() { $multilanguageTables = \OxidEsales\Eshop\Core\Registry::getLang()->getMultiLangTables(); return array_unique($multilanguageTables); }
php
protected function formDatabaseTablesArray() { $multilanguageTables = \OxidEsales\Eshop\Core\Registry::getLang()->getMultiLangTables(); return array_unique($multilanguageTables); }
[ "protected", "function", "formDatabaseTablesArray", "(", ")", "{", "$", "multilanguageTables", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", "->", "getMultiLangTables", "(", ")", ";", "return", "array_unique",...
Forms array of tables which are available. @return array
[ "Forms", "array", "of", "tables", "which", "are", "available", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Shop.php#L372-L377
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/LoginController.php
LoginController.setShopConfigParameters
protected function setShopConfigParameters() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oBaseShop = oxNew(\OxidEsales\Eshop\Application\Model\Shop::class); $oBaseShop->load($myConfig->getBaseShopId()); $this->getViewConfig()->setViewConfigParam('sShopVersion', oxNew(ShopVersion::class)->getVersion()); }
php
protected function setShopConfigParameters() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oBaseShop = oxNew(\OxidEsales\Eshop\Application\Model\Shop::class); $oBaseShop->load($myConfig->getBaseShopId()); $this->getViewConfig()->setViewConfigParam('sShopVersion', oxNew(ShopVersion::class)->getVersion()); }
[ "protected", "function", "setShopConfigParameters", "(", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "oBaseShop", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Es...
Sets configuration parameters related to current shop.
[ "Sets", "configuration", "parameters", "related", "to", "current", "shop", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/LoginController.php#L78-L85
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/LoginController.php
LoginController._getAvailableLanguages
protected function _getAvailableLanguages() { $sDefLang = \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('oxidadminlanguage'); $sDefLang = $sDefLang ? $sDefLang : $this->_getBrowserLanguage(); $aLanguages = \OxidEsales\Eshop\Core\Registry::getLang()->getAdminTplLanguageArray(); foreach ($aLanguages as $oLang) { $oLang->selected = ($sDefLang == $oLang->abbr) ? 1 : 0; } return $aLanguages; }
php
protected function _getAvailableLanguages() { $sDefLang = \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('oxidadminlanguage'); $sDefLang = $sDefLang ? $sDefLang : $this->_getBrowserLanguage(); $aLanguages = \OxidEsales\Eshop\Core\Registry::getLang()->getAdminTplLanguageArray(); foreach ($aLanguages as $oLang) { $oLang->selected = ($sDefLang == $oLang->abbr) ? 1 : 0; } return $aLanguages; }
[ "protected", "function", "_getAvailableLanguages", "(", ")", "{", "$", "sDefLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getUtilsServer", "(", ")", "->", "getOxCookie", "(", "'oxidadminlanguage'", ")", ";", "$", "sDefLa...
Get available admin interface languages @return array
[ "Get", "available", "admin", "interface", "languages" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/LoginController.php#L195-L206
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic.resizeImage
public function resizeImage($sSrc, $sTarget, $iDesiredWidth, $iDesiredHeight) { // use this GD Version if (($iUseGDVersion = getGdVersion()) && function_exists('imagecreate') && file_exists($sSrc) && ($aImageInfo = @getimagesize($sSrc)) ) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); list($iWidth, $iHeight) = calcImageSize($iDesiredWidth, $iDesiredHeight, $aImageInfo[0], $aImageInfo[1]); return $this->_resize($aImageInfo, $sSrc, null, $sTarget, $iWidth, $iHeight, $iUseGDVersion, $myConfig->getConfigParam('blDisableTouch'), $myConfig->getConfigParam('sDefaultImageQuality')); } return false; }
php
public function resizeImage($sSrc, $sTarget, $iDesiredWidth, $iDesiredHeight) { // use this GD Version if (($iUseGDVersion = getGdVersion()) && function_exists('imagecreate') && file_exists($sSrc) && ($aImageInfo = @getimagesize($sSrc)) ) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); list($iWidth, $iHeight) = calcImageSize($iDesiredWidth, $iDesiredHeight, $aImageInfo[0], $aImageInfo[1]); return $this->_resize($aImageInfo, $sSrc, null, $sTarget, $iWidth, $iHeight, $iUseGDVersion, $myConfig->getConfigParam('blDisableTouch'), $myConfig->getConfigParam('sDefaultImageQuality')); } return false; }
[ "public", "function", "resizeImage", "(", "$", "sSrc", ",", "$", "sTarget", ",", "$", "iDesiredWidth", ",", "$", "iDesiredHeight", ")", "{", "// use this GD Version", "if", "(", "(", "$", "iUseGDVersion", "=", "getGdVersion", "(", ")", ")", "&&", "function_e...
Resizes image to desired width and height, returns true on success. @param string $sSrc Source of image file @param string $sTarget Target to write resized image file @param mixed $iDesiredWidth Width of resized image @param mixed $iDesiredHeight Height of resized image @return bool
[ "Resizes", "image", "to", "desired", "width", "and", "height", "returns", "true", "on", "success", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L36-L49
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic.safePictureDelete
public function safePictureDelete($sPicName, $sAbsDynImageDir, $sTable, $sField) { $blDelete = false; if ($this->_isPicDeletable($sPicName, $sTable, $sField)) { $blDelete = $this->_deletePicture($sPicName, $sAbsDynImageDir); } return $blDelete; }
php
public function safePictureDelete($sPicName, $sAbsDynImageDir, $sTable, $sField) { $blDelete = false; if ($this->_isPicDeletable($sPicName, $sTable, $sField)) { $blDelete = $this->_deletePicture($sPicName, $sAbsDynImageDir); } return $blDelete; }
[ "public", "function", "safePictureDelete", "(", "$", "sPicName", ",", "$", "sAbsDynImageDir", ",", "$", "sTable", ",", "$", "sField", ")", "{", "$", "blDelete", "=", "false", ";", "if", "(", "$", "this", "->", "_isPicDeletable", "(", "$", "sPicName", ","...
deletes the given picutre and checks before if the picture is deletable @param string $sPicName Name of picture file @param string $sAbsDynImageDir the absolute image diectory, where to delete the given image ($myConfig->getPictureDir(false)) @param string $sTable in which table @param string $sField table field value @return bool
[ "deletes", "the", "given", "picutre", "and", "checks", "before", "if", "the", "picture", "is", "deletable" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L62-L70
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic._deletePicture
protected function _deletePicture($sPicName, $sAbsDynImageDir) { $blDeleted = false; $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if (!$myConfig->isDemoShop() && (strpos($sPicName, 'nopic.jpg') === false || strpos($sPicName, 'nopic_ico.jpg') === false) ) { $sFile = "$sAbsDynImageDir/$sPicName"; if (file_exists($sFile) && is_file($sFile)) { $blDeleted = unlink($sFile); } if (!$myConfig->getConfigParam('sAltImageUrl')) { // deleting various size generated images $sGenPath = str_replace('/master/', '/generated/', $sAbsDynImageDir); $aFiles = glob("{$sGenPath}*/{$sPicName}"); if (is_array($aFiles)) { foreach ($aFiles as $sFile) { $blDeleted = unlink($sFile); } } } } return $blDeleted; }
php
protected function _deletePicture($sPicName, $sAbsDynImageDir) { $blDeleted = false; $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if (!$myConfig->isDemoShop() && (strpos($sPicName, 'nopic.jpg') === false || strpos($sPicName, 'nopic_ico.jpg') === false) ) { $sFile = "$sAbsDynImageDir/$sPicName"; if (file_exists($sFile) && is_file($sFile)) { $blDeleted = unlink($sFile); } if (!$myConfig->getConfigParam('sAltImageUrl')) { // deleting various size generated images $sGenPath = str_replace('/master/', '/generated/', $sAbsDynImageDir); $aFiles = glob("{$sGenPath}*/{$sPicName}"); if (is_array($aFiles)) { foreach ($aFiles as $sFile) { $blDeleted = unlink($sFile); } } } } return $blDeleted; }
[ "protected", "function", "_deletePicture", "(", "$", "sPicName", ",", "$", "sAbsDynImageDir", ")", "{", "$", "blDeleted", "=", "false", ";", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")...
Removes picture file from disk. @param string $sPicName name of picture @param string $sAbsDynImageDir the absolute image diectory, where to delete the given image ($myConfig->getPictureDir(false)) @return null
[ "Removes", "picture", "file", "from", "disk", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L80-L107
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic._isPicDeletable
protected function _isPicDeletable($sPicName, $sTable, $sField) { if (!$sPicName || strpos($sPicName, 'nopic.jpg') !== false || strpos($sPicName, 'nopic_ico.jpg') !== false) { return false; } $iCountUsed = $this->fetchIsImageDeletable($sPicName, $sTable, $sField); return $iCountUsed > 1 ? false : true; }
php
protected function _isPicDeletable($sPicName, $sTable, $sField) { if (!$sPicName || strpos($sPicName, 'nopic.jpg') !== false || strpos($sPicName, 'nopic_ico.jpg') !== false) { return false; } $iCountUsed = $this->fetchIsImageDeletable($sPicName, $sTable, $sField); return $iCountUsed > 1 ? false : true; }
[ "protected", "function", "_isPicDeletable", "(", "$", "sPicName", ",", "$", "sTable", ",", "$", "sField", ")", "{", "if", "(", "!", "$", "sPicName", "||", "strpos", "(", "$", "sPicName", ",", "'nopic.jpg'", ")", "!==", "false", "||", "strpos", "(", "$"...
Checks if current picture file is used in more than one table entry, returns true if one, false if more than one. @param string $sPicName Name of picture file @param string $sTable in which table @param string $sField table field value @return bool
[ "Checks", "if", "current", "picture", "file", "is", "used", "in", "more", "than", "one", "table", "entry", "returns", "true", "if", "one", "false", "if", "more", "than", "one", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L120-L129
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic.fetchIsImageDeletable
protected function fetchIsImageDeletable($sPicName, $sTable, $sField) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); $query = "select count(*) from $sTable where $sField = " . $masterDb->quote($sPicName) . " group by $sField "; return $masterDb->getOne($query); }
php
protected function fetchIsImageDeletable($sPicName, $sTable, $sField) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); $query = "select count(*) from $sTable where $sField = " . $masterDb->quote($sPicName) . " group by $sField "; return $masterDb->getOne($query); }
[ "protected", "function", "fetchIsImageDeletable", "(", "$", "sPicName", ",", "$", "sTable", ",", "$", "sField", ")", "{", "// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).", "$", "masterDb", "=", "\\", "OxidEsales",...
Fetch the information, if the given image is deletable from the database. @param string $sPicName Name of image file. @param string $sTable The table in which we search for the image. @param string $sField The value of the table field. @return mixed
[ "Fetch", "the", "information", "if", "the", "given", "image", "is", "deletable", "from", "the", "database", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L140-L148
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic.overwritePic
public function overwritePic($oObject, $sPicTable, $sPicField, $sPicType, $sPicDir, $aParams, $sAbsDynImageDir) { $sPic = $sPicTable . '__' . $sPicField; if (isset($oObject->{$sPic}) && ($_FILES['myfile']['size'][$sPicType . '@' . $sPic] > 0 || $aParams[$sPic] != $oObject->{$sPic}->value) ) { $sImgDir = $sAbsDynImageDir . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType($sPicType); return $this->safePictureDelete($oObject->{$sPic}->value, $sImgDir, $sPicTable, $sPicField); } return false; }
php
public function overwritePic($oObject, $sPicTable, $sPicField, $sPicType, $sPicDir, $aParams, $sAbsDynImageDir) { $sPic = $sPicTable . '__' . $sPicField; if (isset($oObject->{$sPic}) && ($_FILES['myfile']['size'][$sPicType . '@' . $sPic] > 0 || $aParams[$sPic] != $oObject->{$sPic}->value) ) { $sImgDir = $sAbsDynImageDir . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType($sPicType); return $this->safePictureDelete($oObject->{$sPic}->value, $sImgDir, $sPicTable, $sPicField); } return false; }
[ "public", "function", "overwritePic", "(", "$", "oObject", ",", "$", "sPicTable", ",", "$", "sPicField", ",", "$", "sPicType", ",", "$", "sPicDir", ",", "$", "aParams", ",", "$", "sAbsDynImageDir", ")", "{", "$", "sPic", "=", "$", "sPicTable", ".", "'_...
Deletes picture if new is uploaded or changed @param object $oObject in whitch obejct search for old values @param string $sPicTable pictures table @param string $sPicField where picture are stored @param string $sPicType how does it call in $_FILE array @param string $sPicDir directory of pic @param array $aParams new input text array @param string $sAbsDynImageDir the absolute image diectory, where to delete the given image ($myConfig->getPictureDir(false)) @return null
[ "Deletes", "picture", "if", "new", "is", "uploaded", "or", "changed" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L163-L174
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic._resizeGif
protected function _resizeGif($sSrc, $sTarget, $iNewWidth, $iNewHeight, $iOriginalWidth, $iOriginalHeigth, $iGDVer, $blDisableTouch) { return resizeGif($sSrc, $sTarget, $iNewWidth, $iNewHeight, $iOriginalWidth, $iOriginalHeigth, $iGDVer, $blDisableTouch); }
php
protected function _resizeGif($sSrc, $sTarget, $iNewWidth, $iNewHeight, $iOriginalWidth, $iOriginalHeigth, $iGDVer, $blDisableTouch) { return resizeGif($sSrc, $sTarget, $iNewWidth, $iNewHeight, $iOriginalWidth, $iOriginalHeigth, $iGDVer, $blDisableTouch); }
[ "protected", "function", "_resizeGif", "(", "$", "sSrc", ",", "$", "sTarget", ",", "$", "iNewWidth", ",", "$", "iNewHeight", ",", "$", "iOriginalWidth", ",", "$", "iOriginalHeigth", ",", "$", "iGDVer", ",", "$", "blDisableTouch", ")", "{", "return", "resiz...
Resizes and saves GIF image. This method was separated due to GIF transparency problems. @param string $sSrc image file @param string $sTarget destination file @param int $iNewWidth new width @param int $iNewHeight new height @param int $iOriginalWidth original width @param int $iOriginalHeigth original height @param int $iGDVer GD packet version @param bool $blDisableTouch false if "touch()" should be called @return bool
[ "Resizes", "and", "saves", "GIF", "image", ".", "This", "method", "was", "separated", "due", "to", "GIF", "transparency", "problems", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L190-L193
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic._resize
protected function _resize($aImageInfo, $sSrc, $hDestinationImage, $sTarget, $iNewWidth, $iNewHeight, $iGdVer, $blDisableTouch, $iDefQuality) { startProfile("PICTURE_RESIZE"); $blSuccess = false; switch ($aImageInfo[2]) { //Image type case ($this->_aImageTypes["GIF"]): //php does not process gifs until 7th July 2004 (see lzh licensing) if (function_exists("imagegif")) { $blSuccess = resizeGif($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo[0], $aImageInfo[1], $iGdVer); } break; case ($this->_aImageTypes["JPEG"]): case ($this->_aImageTypes["JPG"]): $blSuccess = resizeJpeg($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo, $iGdVer, $hDestinationImage, $iDefQuality); break; case ($this->_aImageTypes["PNG"]): $blSuccess = resizePng($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo, $iGdVer, $hDestinationImage); break; } if ($blSuccess && !$blDisableTouch) { @touch($sTarget); } stopProfile("PICTURE_RESIZE"); return $blSuccess; }
php
protected function _resize($aImageInfo, $sSrc, $hDestinationImage, $sTarget, $iNewWidth, $iNewHeight, $iGdVer, $blDisableTouch, $iDefQuality) { startProfile("PICTURE_RESIZE"); $blSuccess = false; switch ($aImageInfo[2]) { //Image type case ($this->_aImageTypes["GIF"]): //php does not process gifs until 7th July 2004 (see lzh licensing) if (function_exists("imagegif")) { $blSuccess = resizeGif($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo[0], $aImageInfo[1], $iGdVer); } break; case ($this->_aImageTypes["JPEG"]): case ($this->_aImageTypes["JPG"]): $blSuccess = resizeJpeg($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo, $iGdVer, $hDestinationImage, $iDefQuality); break; case ($this->_aImageTypes["PNG"]): $blSuccess = resizePng($sSrc, $sTarget, $iNewWidth, $iNewHeight, $aImageInfo, $iGdVer, $hDestinationImage); break; } if ($blSuccess && !$blDisableTouch) { @touch($sTarget); } stopProfile("PICTURE_RESIZE"); return $blSuccess; }
[ "protected", "function", "_resize", "(", "$", "aImageInfo", ",", "$", "sSrc", ",", "$", "hDestinationImage", ",", "$", "sTarget", ",", "$", "iNewWidth", ",", "$", "iNewHeight", ",", "$", "iGdVer", ",", "$", "blDisableTouch", ",", "$", "iDefQuality", ")", ...
type dependant image resizing @param array $aImageInfo Contains information on image's type / width / height @param string $sSrc source image @param string $hDestinationImage Destination Image @param string $sTarget Resized Image target @param int $iNewWidth Resized Image's width @param int $iNewHeight Resized Image's height @param mixed $iGdVer used GDVersion, if null or false returns false @param bool $blDisableTouch false if "touch()" should be called for gif resizing @param string $iDefQuality quality for "imagejpeg" function @return bool
[ "type", "dependant", "image", "resizing" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L210-L238
train
OXID-eSales/oxideshop_ce
source/Core/UtilsPic.php
UtilsPic._copyAlteredImage
protected function _copyAlteredImage($sDestinationImage, $sSourceImage, $iNewWidth, $iNewHeight, $aImageInfo, $sTarget, $iGdVer, $blDisableTouch) { $blSuccess = copyAlteredImage($sDestinationImage, $sSourceImage, $iNewWidth, $iNewHeight, $aImageInfo, $sTarget, $iGdVer); if (!$blDisableTouch && $blSuccess) { @touch($sTarget); } return $blSuccess; }
php
protected function _copyAlteredImage($sDestinationImage, $sSourceImage, $iNewWidth, $iNewHeight, $aImageInfo, $sTarget, $iGdVer, $blDisableTouch) { $blSuccess = copyAlteredImage($sDestinationImage, $sSourceImage, $iNewWidth, $iNewHeight, $aImageInfo, $sTarget, $iGdVer); if (!$blDisableTouch && $blSuccess) { @touch($sTarget); } return $blSuccess; }
[ "protected", "function", "_copyAlteredImage", "(", "$", "sDestinationImage", ",", "$", "sSourceImage", ",", "$", "iNewWidth", ",", "$", "iNewHeight", ",", "$", "aImageInfo", ",", "$", "sTarget", ",", "$", "iGdVer", ",", "$", "blDisableTouch", ")", "{", "$", ...
create and copy the resized image @param string $sDestinationImage file + path of destination @param string $sSourceImage file + path of source @param int $iNewWidth new width of the image @param int $iNewHeight new height of the image @param array $aImageInfo additional info @param string $sTarget target file path @param int $iGdVer used gd version @param bool $blDisableTouch wether Touch() should be called or not @return null
[ "create", "and", "copy", "the", "resized", "image" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsPic.php#L254-L262
train
OXID-eSales/oxideshop_ce
source/Core/Module/ModuleCache.php
ModuleCache.resetCache
public function resetCache() { $aTemplates = $this->getModule()->getTemplates(); $oUtils = Registry::getUtils(); $oUtils->resetTemplateCache($aTemplates); $oUtils->resetLanguageCache(); $oUtils->resetMenuCache(); ModuleVariablesLocator::resetModuleVariables(); $this->_clearApcCache(); }
php
public function resetCache() { $aTemplates = $this->getModule()->getTemplates(); $oUtils = Registry::getUtils(); $oUtils->resetTemplateCache($aTemplates); $oUtils->resetLanguageCache(); $oUtils->resetMenuCache(); ModuleVariablesLocator::resetModuleVariables(); $this->_clearApcCache(); }
[ "public", "function", "resetCache", "(", ")", "{", "$", "aTemplates", "=", "$", "this", "->", "getModule", "(", ")", "->", "getTemplates", "(", ")", ";", "$", "oUtils", "=", "Registry", "::", "getUtils", "(", ")", ";", "$", "oUtils", "->", "resetTempla...
Resets template, language and menu xml cache
[ "Resets", "template", "language", "and", "menu", "xml", "cache" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleCache.php#L57-L68
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/Actions.php
Actions.getAction
public function getAction() { $actionId = $this->getViewParameter('action'); if ($actionId && $this->_getLoadActionsParam()) { $artList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $artList->loadActionArticles($actionId); if ($artList->count()) { return $artList; } } }
php
public function getAction() { $actionId = $this->getViewParameter('action'); if ($actionId && $this->_getLoadActionsParam()) { $artList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class); $artList->loadActionArticles($actionId); if ($artList->count()) { return $artList; } } }
[ "public", "function", "getAction", "(", ")", "{", "$", "actionId", "=", "$", "this", "->", "getViewParameter", "(", "'action'", ")", ";", "if", "(", "$", "actionId", "&&", "$", "this", "->", "_getLoadActionsParam", "(", ")", ")", "{", "$", "artList", "...
Returns article list with action articles @return object
[ "Returns", "article", "list", "with", "action", "articles" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/Actions.php#L34-L44
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/Actions.php
Actions._getLoadActionsParam
protected function _getLoadActionsParam() { $this->_blLoadActions = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadAktion'); return $this->_blLoadActions; }
php
protected function _getLoadActionsParam() { $this->_blLoadActions = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadAktion'); return $this->_blLoadActions; }
[ "protected", "function", "_getLoadActionsParam", "(", ")", "{", "$", "this", "->", "_blLoadActions", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'bl_perfLoadAktion'", ")", "...
Returns if actions are ON @return string
[ "Returns", "if", "actions", "are", "ON" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/Actions.php#L51-L56
train
OXID-eSales/oxideshop_ce
source/Application/Component/Widget/Actions.php
Actions.getActionName
public function getActionName() { $actionId = $this->getViewParameter('action'); $action = oxNew(\OxidEsales\Eshop\Application\Model\Actions::class); if ($action->load($actionId)) { return $action->oxactions__oxtitle->value; } }
php
public function getActionName() { $actionId = $this->getViewParameter('action'); $action = oxNew(\OxidEsales\Eshop\Application\Model\Actions::class); if ($action->load($actionId)) { return $action->oxactions__oxtitle->value; } }
[ "public", "function", "getActionName", "(", ")", "{", "$", "actionId", "=", "$", "this", "->", "getViewParameter", "(", "'action'", ")", ";", "$", "action", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "...
Returns action name @return string
[ "Returns", "action", "name" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/Actions.php#L63-L70
train