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/Model/Article.php
Article.hasAmountPrice
public function hasAmountPrice() { if (self::$_blHasAmountPrice === null) { self::$_blHasAmountPrice = false; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "SELECT 1 FROM `oxprice2article` LIMIT 1"; if ($oDb->getOne($sQ)) { self::$_blHasAmountPrice = true; } } return self::$_blHasAmountPrice; }
php
public function hasAmountPrice() { if (self::$_blHasAmountPrice === null) { self::$_blHasAmountPrice = false; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "SELECT 1 FROM `oxprice2article` LIMIT 1"; if ($oDb->getOne($sQ)) { self::$_blHasAmountPrice = true; } } return self::$_blHasAmountPrice; }
[ "public", "function", "hasAmountPrice", "(", ")", "{", "if", "(", "self", "::", "$", "_blHasAmountPrice", "===", "null", ")", "{", "self", "::", "$", "_blHasAmountPrice", "=", "false", ";", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core"...
Checks if articles has amount price @return bool
[ "Checks", "if", "articles", "has", "amount", "price" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3466-L3480
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._selectCategoryIds
protected function _selectCategoryIds($query, $field) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $aResult = $oDb->getAll($query); $aReturn = []; foreach ($aResult as $aValue) { $aValue = array_change_key_case($aValue, CASE_LOWER); $aReturn[] = $aValue[$field]; } return $aReturn; }
php
protected function _selectCategoryIds($query, $field) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $aResult = $oDb->getAll($query); $aReturn = []; foreach ($aResult as $aValue) { $aValue = array_change_key_case($aValue, CASE_LOWER); $aReturn[] = $aValue[$field]; } return $aReturn; }
[ "protected", "function", "_selectCategoryIds", "(", "$", "query", ",", "$", "field", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", ...
Selects category IDs from given SQL statement and ID field name @param string $query sql statement @param string $field category ID field name @return array
[ "Selects", "category", "IDs", "from", "given", "SQL", "statement", "and", "ID", "field", "name" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3573-L3586
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getCategoryIdsSelect
protected function _getCategoryIdsSelect($blActCats = false) { $sO2CView = $this->_getObjectViewName('oxobject2category'); $sCatView = $this->_getObjectViewName('oxcategories'); $sArticleIdSql = 'oxobject2category.oxobjectid=' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()); if ($this->getParentId()) { $sArticleIdSql = '(' . $sArticleIdSql . ' or oxobject2category.oxobjectid=' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getParentId()) . ')'; } $sActiveCategorySql = $blActCats ? $this->_getActiveCategorySelectSnippet() : ''; $sSelect = "select oxobject2category.oxcatnid as oxcatnid from $sO2CView as oxobject2category left join $sCatView as oxcategories on oxcategories.oxid = oxobject2category.oxcatnid where $sArticleIdSql and oxcategories.oxid is not null and oxcategories.oxactive = 1 $sActiveCategorySql order by oxobject2category.oxtime"; return $sSelect; }
php
protected function _getCategoryIdsSelect($blActCats = false) { $sO2CView = $this->_getObjectViewName('oxobject2category'); $sCatView = $this->_getObjectViewName('oxcategories'); $sArticleIdSql = 'oxobject2category.oxobjectid=' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()); if ($this->getParentId()) { $sArticleIdSql = '(' . $sArticleIdSql . ' or oxobject2category.oxobjectid=' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getParentId()) . ')'; } $sActiveCategorySql = $blActCats ? $this->_getActiveCategorySelectSnippet() : ''; $sSelect = "select oxobject2category.oxcatnid as oxcatnid from $sO2CView as oxobject2category left join $sCatView as oxcategories on oxcategories.oxid = oxobject2category.oxcatnid where $sArticleIdSql and oxcategories.oxid is not null and oxcategories.oxactive = 1 $sActiveCategorySql order by oxobject2category.oxtime"; return $sSelect; }
[ "protected", "function", "_getCategoryIdsSelect", "(", "$", "blActCats", "=", "false", ")", "{", "$", "sO2CView", "=", "$", "this", "->", "_getObjectViewName", "(", "'oxobject2category'", ")", ";", "$", "sCatView", "=", "$", "this", "->", "_getObjectViewName", ...
Returns query for article categories select @param bool $blActCats select categories if all parents are active @return string
[ "Returns", "query", "for", "article", "categories", "select" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3595-L3614
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._hasAnyVariant
protected function _hasAnyVariant($blForceCoreTable = null) { if (($sId = $this->getId())) { if ($this->oxarticles__oxshopid->value == \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId()) { return (bool) $this->oxarticles__oxvarcount->value; } $sArticleTable = $this->getViewName($blForceCoreTable); return (bool) \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne("select 1 from $sArticleTable where oxparentid='{$sId}'"); } return false; }
php
protected function _hasAnyVariant($blForceCoreTable = null) { if (($sId = $this->getId())) { if ($this->oxarticles__oxshopid->value == \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId()) { return (bool) $this->oxarticles__oxvarcount->value; } $sArticleTable = $this->getViewName($blForceCoreTable); return (bool) \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne("select 1 from $sArticleTable where oxparentid='{$sId}'"); } return false; }
[ "protected", "function", "_hasAnyVariant", "(", "$", "blForceCoreTable", "=", "null", ")", "{", "if", "(", "(", "$", "sId", "=", "$", "this", "->", "getId", "(", ")", ")", ")", "{", "if", "(", "$", "this", "->", "oxarticles__oxshopid", "->", "value", ...
Checks if parent has ANY variant assigned @param bool $blForceCoreTable force core table usage @return bool
[ "Checks", "if", "parent", "has", "ANY", "variant", "assigned" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3667-L3679
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._saveArtLongDesc
protected function _saveArtLongDesc() { if (in_array("oxlongdesc", $this->_aSkipSaveFields)) { return; } if ($this->_blEmployMultilanguage) { $sValue = $this->getLongDescription()->getRawValue(); if ($sValue !== null) { $oArtExt = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class); $oArtExt->init('oxartextends'); $oArtExt->setLanguage((int) $this->getLanguage()); if (!$oArtExt->load($this->getId())) { $oArtExt->setId($this->getId()); } $oArtExt->oxartextends__oxlongdesc = new \OxidEsales\Eshop\Core\Field($sValue, \OxidEsales\Eshop\Core\Field::T_RAW); $oArtExt->save(); } } else { $oArtExt = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class); $oArtExt->setEnableMultilang(false); $oArtExt->init('oxartextends'); $aObjFields = $oArtExt->_getAllFields(true); if (!$oArtExt->load($this->getId())) { $oArtExt->setId($this->getId()); } foreach ($aObjFields as $sKey => $sValue) { if (preg_match('/^oxlongdesc(_(\d{1,2}))?$/', $sKey)) { $sField = $this->_getFieldLongName($sKey); if (isset($this->$sField)) { $sLongDesc = null; if ($this->$sField instanceof \OxidEsales\Eshop\Core\Field) { $sLongDesc = $this->$sField->getRawValue(); } elseif (is_object($this->$sField)) { $sLongDesc = $this->$sField->value; } if (isset($sLongDesc)) { $sAEField = $oArtExt->_getFieldLongName($sKey); $oArtExt->$sAEField = new \OxidEsales\Eshop\Core\Field($sLongDesc, \OxidEsales\Eshop\Core\Field::T_RAW); } } } } $oArtExt->save(); } }
php
protected function _saveArtLongDesc() { if (in_array("oxlongdesc", $this->_aSkipSaveFields)) { return; } if ($this->_blEmployMultilanguage) { $sValue = $this->getLongDescription()->getRawValue(); if ($sValue !== null) { $oArtExt = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class); $oArtExt->init('oxartextends'); $oArtExt->setLanguage((int) $this->getLanguage()); if (!$oArtExt->load($this->getId())) { $oArtExt->setId($this->getId()); } $oArtExt->oxartextends__oxlongdesc = new \OxidEsales\Eshop\Core\Field($sValue, \OxidEsales\Eshop\Core\Field::T_RAW); $oArtExt->save(); } } else { $oArtExt = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class); $oArtExt->setEnableMultilang(false); $oArtExt->init('oxartextends'); $aObjFields = $oArtExt->_getAllFields(true); if (!$oArtExt->load($this->getId())) { $oArtExt->setId($this->getId()); } foreach ($aObjFields as $sKey => $sValue) { if (preg_match('/^oxlongdesc(_(\d{1,2}))?$/', $sKey)) { $sField = $this->_getFieldLongName($sKey); if (isset($this->$sField)) { $sLongDesc = null; if ($this->$sField instanceof \OxidEsales\Eshop\Core\Field) { $sLongDesc = $this->$sField->getRawValue(); } elseif (is_object($this->$sField)) { $sLongDesc = $this->$sField->value; } if (isset($sLongDesc)) { $sAEField = $oArtExt->_getFieldLongName($sKey); $oArtExt->$sAEField = new \OxidEsales\Eshop\Core\Field($sLongDesc, \OxidEsales\Eshop\Core\Field::T_RAW); } } } } $oArtExt->save(); } }
[ "protected", "function", "_saveArtLongDesc", "(", ")", "{", "if", "(", "in_array", "(", "\"oxlongdesc\"", ",", "$", "this", "->", "_aSkipSaveFields", ")", ")", "{", "return", ";", "}", "if", "(", "$", "this", "->", "_blEmployMultilanguage", ")", "{", "$", ...
inserts article long description to artextends table @return null
[ "inserts", "article", "long", "description", "to", "artextends", "table" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3706-L3753
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getAmountPrice
protected function _getAmountPrice($amount = 1) { startProfile("_getAmountPrice"); $dPrice = $this->_getGroupPrice(); $oAmtPrices = $this->_getAmountPriceList(); foreach ($oAmtPrices as $oAmPrice) { if ($oAmPrice->oxprice2article__oxamount->value <= $amount && $amount <= $oAmPrice->oxprice2article__oxamountto->value && $dPrice > $oAmPrice->oxprice2article__oxaddabs->value ) { $dPrice = $oAmPrice->oxprice2article__oxaddabs->value; } } stopProfile("_getAmountPrice"); return $dPrice; }
php
protected function _getAmountPrice($amount = 1) { startProfile("_getAmountPrice"); $dPrice = $this->_getGroupPrice(); $oAmtPrices = $this->_getAmountPriceList(); foreach ($oAmtPrices as $oAmPrice) { if ($oAmPrice->oxprice2article__oxamount->value <= $amount && $amount <= $oAmPrice->oxprice2article__oxamountto->value && $dPrice > $oAmPrice->oxprice2article__oxaddabs->value ) { $dPrice = $oAmPrice->oxprice2article__oxaddabs->value; } } stopProfile("_getAmountPrice"); return $dPrice; }
[ "protected", "function", "_getAmountPrice", "(", "$", "amount", "=", "1", ")", "{", "startProfile", "(", "\"_getAmountPrice\"", ")", ";", "$", "dPrice", "=", "$", "this", "->", "_getGroupPrice", "(", ")", ";", "$", "oAmtPrices", "=", "$", "this", "->", "...
Modifies article price depending on given amount. Takes data from oxprice2article table. @param int $amount Basket amount @return double
[ "Modifies", "article", "price", "depending", "on", "given", "amount", ".", "Takes", "data", "from", "oxprice2article", "table", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3822-L3840
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._modifySelectListPrice
protected function _modifySelectListPrice($dPrice, $aChosenList = null) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // #690 if ($myConfig->getConfigParam('bl_perfLoadSelectLists') && $myConfig->getConfigParam('bl_perfUseSelectlistPrice')) { $aSelLists = $this->getSelectLists(); foreach ($aSelLists as $key => $aSel) { if (isset($aChosenList[$key]) && isset($aSel[$aChosenList[$key]])) { $oSel = $aSel[$aChosenList[$key]]; if ($oSel->priceUnit == 'abs') { $dPrice += $oSel->price; } elseif ($oSel->priceUnit == '%') { $dPrice += \OxidEsales\Eshop\Core\Price::percent($dPrice, $oSel->price); } } } } return $dPrice; }
php
protected function _modifySelectListPrice($dPrice, $aChosenList = null) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // #690 if ($myConfig->getConfigParam('bl_perfLoadSelectLists') && $myConfig->getConfigParam('bl_perfUseSelectlistPrice')) { $aSelLists = $this->getSelectLists(); foreach ($aSelLists as $key => $aSel) { if (isset($aChosenList[$key]) && isset($aSel[$aChosenList[$key]])) { $oSel = $aSel[$aChosenList[$key]]; if ($oSel->priceUnit == 'abs') { $dPrice += $oSel->price; } elseif ($oSel->priceUnit == '%') { $dPrice += \OxidEsales\Eshop\Core\Price::percent($dPrice, $oSel->price); } } } } return $dPrice; }
[ "protected", "function", "_modifySelectListPrice", "(", "$", "dPrice", ",", "$", "aChosenList", "=", "null", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "// #690", "if...
Modifies article price according to selected select list value @param double $dPrice Modifiable price @param array $aChosenList Selection list array @return double
[ "Modifies", "article", "price", "according", "to", "selected", "select", "list", "value" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3850-L3870
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._fillAmountPriceList
protected function _fillAmountPriceList($aAmPriceList) { $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); // trying to find lowest price value foreach ($aAmPriceList as $sId => $oItem) { /** @var \OxidEsales\Eshop\Core\Price $oItemPrice */ $oItemPrice = $this->_getPriceObject(); if ($oItem->oxprice2article__oxaddabs->value) { $dBasePrice = $oItem->oxprice2article__oxaddabs->value; $dBasePrice = $this->_prepareModifiedPrice($dBasePrice); $oItemPrice->setPrice($dBasePrice); $this->_calculatePrice($oItemPrice); } else { $dBasePrice = $this->_getGroupPrice(); $dBasePrice = $this->_prepareModifiedPrice($dBasePrice); $oItemPrice->setPrice($dBasePrice); $oItemPrice->subtractPercent($oItem->oxprice2article__oxaddperc->value); } $aAmPriceList[$sId]->fbrutprice = $oLang->formatCurrency($oItemPrice->getBruttoPrice()); $aAmPriceList[$sId]->fnetprice = $oLang->formatCurrency($oItemPrice->getNettoPrice()); if ($quantity = $this->getUnitQuantity()) { $aAmPriceList[$sId]->fbrutamountprice = $oLang->formatCurrency($oItemPrice->getBruttoPrice() / $quantity); $aAmPriceList[$sId]->fnetamountprice = $oLang->formatCurrency($oItemPrice->getNettoPrice() / $quantity); } } return $aAmPriceList; }
php
protected function _fillAmountPriceList($aAmPriceList) { $oLang = \OxidEsales\Eshop\Core\Registry::getLang(); // trying to find lowest price value foreach ($aAmPriceList as $sId => $oItem) { /** @var \OxidEsales\Eshop\Core\Price $oItemPrice */ $oItemPrice = $this->_getPriceObject(); if ($oItem->oxprice2article__oxaddabs->value) { $dBasePrice = $oItem->oxprice2article__oxaddabs->value; $dBasePrice = $this->_prepareModifiedPrice($dBasePrice); $oItemPrice->setPrice($dBasePrice); $this->_calculatePrice($oItemPrice); } else { $dBasePrice = $this->_getGroupPrice(); $dBasePrice = $this->_prepareModifiedPrice($dBasePrice); $oItemPrice->setPrice($dBasePrice); $oItemPrice->subtractPercent($oItem->oxprice2article__oxaddperc->value); } $aAmPriceList[$sId]->fbrutprice = $oLang->formatCurrency($oItemPrice->getBruttoPrice()); $aAmPriceList[$sId]->fnetprice = $oLang->formatCurrency($oItemPrice->getNettoPrice()); if ($quantity = $this->getUnitQuantity()) { $aAmPriceList[$sId]->fbrutamountprice = $oLang->formatCurrency($oItemPrice->getBruttoPrice() / $quantity); $aAmPriceList[$sId]->fnetamountprice = $oLang->formatCurrency($oItemPrice->getNettoPrice() / $quantity); } } return $aAmPriceList; }
[ "protected", "function", "_fillAmountPriceList", "(", "$", "aAmPriceList", ")", "{", "$", "oLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", ";", "// trying to find lowest price value", "foreach", "(", "$"...
Fills amount price list object and sets amount price for article object @param array $aAmPriceList Amount price list @return array
[ "Fills", "amount", "price", "list", "object", "and", "sets", "amount", "price", "for", "article", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3879-L3912
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._applyVAT
protected function _applyVAT(\OxidEsales\Eshop\Core\Price $oPrice, $dVat) { startProfile(__FUNCTION__); $oPrice->setVAT($dVat); /** @var \OxidEsales\Eshop\Application\Model\VatSelector $oVatSelector */ $oVatSelector = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\VatSelector::class); if (($dVat = $oVatSelector->getArticleUserVat($this)) !== false) { $oPrice->setUserVat($dVat); } stopProfile(__FUNCTION__); }
php
protected function _applyVAT(\OxidEsales\Eshop\Core\Price $oPrice, $dVat) { startProfile(__FUNCTION__); $oPrice->setVAT($dVat); /** @var \OxidEsales\Eshop\Application\Model\VatSelector $oVatSelector */ $oVatSelector = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\VatSelector::class); if (($dVat = $oVatSelector->getArticleUserVat($this)) !== false) { $oPrice->setUserVat($dVat); } stopProfile(__FUNCTION__); }
[ "protected", "function", "_applyVAT", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Price", "$", "oPrice", ",", "$", "dVat", ")", "{", "startProfile", "(", "__FUNCTION__", ")", ";", "$", "oPrice", "->", "setVAT", "(", "$", "dVat", ")", "...
Applies VAT to article @param \OxidEsales\Eshop\Core\Price $oPrice Price object @param double $dVat VAT percent
[ "Applies", "VAT", "to", "article" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3965-L3975
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._applyCurrency
protected function _applyCurrency(\OxidEsales\Eshop\Core\Price $oPrice, $oCur = null) { if (!$oCur) { $oCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject(); } $oPrice->multiply($oCur->rate); }
php
protected function _applyCurrency(\OxidEsales\Eshop\Core\Price $oPrice, $oCur = null) { if (!$oCur) { $oCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject(); } $oPrice->multiply($oCur->rate); }
[ "protected", "function", "_applyCurrency", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Price", "$", "oPrice", ",", "$", "oCur", "=", "null", ")", "{", "if", "(", "!", "$", "oCur", ")", "{", "$", "oCur", "=", "\\", "OxidEsales", "\\",...
Applies currency factor @param \OxidEsales\Eshop\Core\Price $oPrice Price object @param object $oCur Currency object
[ "Applies", "currency", "factor" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3983-L3990
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getAttribsString
protected function _getAttribsString(&$sAttributeSql, &$iCnt) { // we do not use lists here as we don't need this overhead right now $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sSelect = 'select oxattrid from oxobject2attribute where oxobject2attribute.oxobjectid=' . $oDb->quote($this->getId()); if ($this->getParentId()) { $sSelect .= ' OR oxobject2attribute.oxobjectid=' . $oDb->quote($this->getParentId()); } $sAttributeSql = ''; $aAttributeIds = $oDb->getCol($sSelect); if (is_array($aAttributeIds) && count($aAttributeIds)) { $aAttributeIds = array_unique($aAttributeIds); $iCnt = count($aAttributeIds); $sAttributeSql .= 't1.oxattrid IN ( ' . implode(',', $oDb->quoteArray($aAttributeIds)) . ') '; } }
php
protected function _getAttribsString(&$sAttributeSql, &$iCnt) { // we do not use lists here as we don't need this overhead right now $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sSelect = 'select oxattrid from oxobject2attribute where oxobject2attribute.oxobjectid=' . $oDb->quote($this->getId()); if ($this->getParentId()) { $sSelect .= ' OR oxobject2attribute.oxobjectid=' . $oDb->quote($this->getParentId()); } $sAttributeSql = ''; $aAttributeIds = $oDb->getCol($sSelect); if (is_array($aAttributeIds) && count($aAttributeIds)) { $aAttributeIds = array_unique($aAttributeIds); $iCnt = count($aAttributeIds); $sAttributeSql .= 't1.oxattrid IN ( ' . implode(',', $oDb->quoteArray($aAttributeIds)) . ') '; } }
[ "protected", "function", "_getAttribsString", "(", "&", "$", "sAttributeSql", ",", "&", "$", "iCnt", ")", "{", "// we do not use lists here as we don't need this overhead right now", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProv...
gets attribs string @param string $sAttributeSql Attribute selection snippet @param int $iCnt The number of selected attributes
[ "gets", "attribs", "string" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3998-L4013
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getSimList
protected function _getSimList($sAttributeSql, $iCnt) { // #523A $iAttrPercent = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iAttributesPercent') / 100; // 70% same attributes if (!$iAttrPercent || $iAttrPercent < 0 || $iAttrPercent > 1) { $iAttrPercent = 0.70; } // #1137V iAttributesPercent = 100 doesn't work $iHitMin = ceil($iCnt * $iAttrPercent); $aExcludeIds = []; $aExcludeIds[] = $this->getId(); if ($this->getParentId()) { $aExcludeIds[] = $this->getParentId(); } // we do not use lists here as we don't need this overhead right now $sSelect = "select oxobjectid from oxobject2attribute as t1 where ( $sAttributeSql ) and t1.oxobjectid NOT IN (" . implode(', ', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aExcludeIds)) . ") group by t1.oxobjectid having count(*) >= $iHitMin LIMIT 0, 20"; return \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getCol($sSelect); }
php
protected function _getSimList($sAttributeSql, $iCnt) { // #523A $iAttrPercent = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iAttributesPercent') / 100; // 70% same attributes if (!$iAttrPercent || $iAttrPercent < 0 || $iAttrPercent > 1) { $iAttrPercent = 0.70; } // #1137V iAttributesPercent = 100 doesn't work $iHitMin = ceil($iCnt * $iAttrPercent); $aExcludeIds = []; $aExcludeIds[] = $this->getId(); if ($this->getParentId()) { $aExcludeIds[] = $this->getParentId(); } // we do not use lists here as we don't need this overhead right now $sSelect = "select oxobjectid from oxobject2attribute as t1 where ( $sAttributeSql ) and t1.oxobjectid NOT IN (" . implode(', ', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aExcludeIds)) . ") group by t1.oxobjectid having count(*) >= $iHitMin LIMIT 0, 20"; return \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getCol($sSelect); }
[ "protected", "function", "_getSimList", "(", "$", "sAttributeSql", ",", "$", "iCnt", ")", "{", "// #523A", "$", "iAttrPercent", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", ...
Gets similar list. @param string $sAttributeSql Attribute selection snippet @param int $iCnt Similar list article count @return array
[ "Gets", "similar", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4023-L4047
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._generateSimListSearchStr
protected function _generateSimListSearchStr($sArticleTable, $aList) { $sFieldList = $this->getSelectFields(); $aList = array_slice($aList, 0, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofSimilarArticles')); $sSearch = "select $sFieldList from $sArticleTable where " . $this->getSqlActiveSnippet() . " and $sArticleTable.oxissearch = 1 and $sArticleTable.oxid in ( "; $sSearch .= implode(',', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aList)) . ')'; // #524A -- randomizing articles in attribute list $sSearch .= ' order by rand() '; return $sSearch; }
php
protected function _generateSimListSearchStr($sArticleTable, $aList) { $sFieldList = $this->getSelectFields(); $aList = array_slice($aList, 0, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofSimilarArticles')); $sSearch = "select $sFieldList from $sArticleTable where " . $this->getSqlActiveSnippet() . " and $sArticleTable.oxissearch = 1 and $sArticleTable.oxid in ( "; $sSearch .= implode(',', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aList)) . ')'; // #524A -- randomizing articles in attribute list $sSearch .= ' order by rand() '; return $sSearch; }
[ "protected", "function", "_generateSimListSearchStr", "(", "$", "sArticleTable", ",", "$", "aList", ")", "{", "$", "sFieldList", "=", "$", "this", "->", "getSelectFields", "(", ")", ";", "$", "aList", "=", "array_slice", "(", "$", "aList", ",", "0", ",", ...
Generates search string for similar list. @param string $sArticleTable Article table name @param array $aList A list of original articles @return string
[ "Generates", "search", "string", "for", "similar", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4057-L4070
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._generateSearchStrForCustomerBought
protected function _generateSearchStrForCustomerBought() { $sArtTable = $this->getViewName(); $sOrderArtTable = getViewName('oxorderarticles'); // fetching filter params $sIn = " '{$this->oxarticles__oxid->value}' "; if ($this->oxarticles__oxparentid->value) { // adding article parent $sIn .= ", '{$this->oxarticles__oxparentid->value}' "; $sParentIdForVariants = $this->oxarticles__oxparentid->value; } else { $sParentIdForVariants = $this->getId(); } // adding variants $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $oRs = $oDb->select("select oxid from {$sArtTable} where oxparentid = " . $oDb->quote($sParentIdForVariants) . " and oxid != " . $oDb->quote($this->oxarticles__oxid->value)); if ($oRs != false && $oRs->count() > 0) { while (!$oRs->EOF) { $sIn .= ", " . $oDb->quote(current($oRs->fields)) . " "; $oRs->fetchRow(); } } $iLimit = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCustomerWhoArticles'); $iLimit = $iLimit ? ($iLimit * 10) : 50; // building sql (optimized) return "select distinct {$sArtTable}.* from ( select d.oxorderid as suborderid from {$sOrderArtTable} as d use index ( oxartid ) where d.oxartid in ( {$sIn} ) limit {$iLimit} ) as suborder left join {$sOrderArtTable} force index ( oxorderid ) on suborder.suborderid = {$sOrderArtTable}.oxorderid left join {$sArtTable} on {$sArtTable}.oxid = {$sOrderArtTable}.oxartid where {$sArtTable}.oxid not in ( {$sIn} ) and ( {$sArtTable}.oxissearch = 1 or {$sArtTable}.oxparentid <> '' ) and " . $this->getSqlActiveSnippet(); /* non optimized, but could be used if index forcing is not supported // building sql $sQ = "select distinct {$sArtTable}.* from {$sOrderArtTable}, {$sArtTable} where {$sOrderArtTable}.oxorderid in ( select {$sOrderArtTable}.oxorderid from {$sOrderArtTable} where {$sOrderArtTable}.oxartid in ( {$sIn} ) ) and {$sArtTable}.oxid = {$sOrderArtTable}.oxartid and {$sArtTable}.oxid not in ( {$sIn} ) and ( {$sArtTable}.oxissearch = 1 or {$sArtTable}.oxparentid <> '' ) and ".$this->getSqlActiveSnippet(); */ }
php
protected function _generateSearchStrForCustomerBought() { $sArtTable = $this->getViewName(); $sOrderArtTable = getViewName('oxorderarticles'); // fetching filter params $sIn = " '{$this->oxarticles__oxid->value}' "; if ($this->oxarticles__oxparentid->value) { // adding article parent $sIn .= ", '{$this->oxarticles__oxparentid->value}' "; $sParentIdForVariants = $this->oxarticles__oxparentid->value; } else { $sParentIdForVariants = $this->getId(); } // adding variants $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $oRs = $oDb->select("select oxid from {$sArtTable} where oxparentid = " . $oDb->quote($sParentIdForVariants) . " and oxid != " . $oDb->quote($this->oxarticles__oxid->value)); if ($oRs != false && $oRs->count() > 0) { while (!$oRs->EOF) { $sIn .= ", " . $oDb->quote(current($oRs->fields)) . " "; $oRs->fetchRow(); } } $iLimit = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCustomerWhoArticles'); $iLimit = $iLimit ? ($iLimit * 10) : 50; // building sql (optimized) return "select distinct {$sArtTable}.* from ( select d.oxorderid as suborderid from {$sOrderArtTable} as d use index ( oxartid ) where d.oxartid in ( {$sIn} ) limit {$iLimit} ) as suborder left join {$sOrderArtTable} force index ( oxorderid ) on suborder.suborderid = {$sOrderArtTable}.oxorderid left join {$sArtTable} on {$sArtTable}.oxid = {$sOrderArtTable}.oxartid where {$sArtTable}.oxid not in ( {$sIn} ) and ( {$sArtTable}.oxissearch = 1 or {$sArtTable}.oxparentid <> '' ) and " . $this->getSqlActiveSnippet(); /* non optimized, but could be used if index forcing is not supported // building sql $sQ = "select distinct {$sArtTable}.* from {$sOrderArtTable}, {$sArtTable} where {$sOrderArtTable}.oxorderid in ( select {$sOrderArtTable}.oxorderid from {$sOrderArtTable} where {$sOrderArtTable}.oxartid in ( {$sIn} ) ) and {$sArtTable}.oxid = {$sOrderArtTable}.oxartid and {$sArtTable}.oxid not in ( {$sIn} ) and ( {$sArtTable}.oxissearch = 1 or {$sArtTable}.oxparentid <> '' ) and ".$this->getSqlActiveSnippet(); */ }
[ "protected", "function", "_generateSearchStrForCustomerBought", "(", ")", "{", "$", "sArtTable", "=", "$", "this", "->", "getViewName", "(", ")", ";", "$", "sOrderArtTable", "=", "getViewName", "(", "'oxorderarticles'", ")", ";", "// fetching filter params", "$", ...
Generates SQL select string for getCustomerAlsoBoughtThisProduct @return string
[ "Generates", "SQL", "select", "string", "for", "getCustomerAlsoBoughtThisProduct" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4102-L4147
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article.buildAmountPriceList
protected function buildAmountPriceList() { if ($this->getAmountPriceList() === null) { /** @var \OxidEsales\Eshop\Application\Model\AmountPriceList $oAmPriceList */ $oAmPriceList = oxNew(\OxidEsales\Eshop\Application\Model\AmountPriceList::class); $this->setAmountPriceList($oAmPriceList); if (!$this->skipDiscounts()) { //collecting assigned to article amount-price list $oAmPriceList->load($this); // prepare abs prices if currently having percentages $oBasePrice = $this->_getGroupPrice(); foreach ($oAmPriceList as $oAmPrice) { if ($oAmPrice->oxprice2article__oxaddperc->value) { $oAmPrice->oxprice2article__oxaddabs = new \OxidEsales\Eshop\Core\Field( \OxidEsales\Eshop\Core\Price::percent($oBasePrice, 100 - $oAmPrice->oxprice2article__oxaddperc->value), \OxidEsales\Eshop\Core\Field::T_RAW ); } } } $this->setAmountPriceList($oAmPriceList); } return $this->_oAmountPriceList; }
php
protected function buildAmountPriceList() { if ($this->getAmountPriceList() === null) { /** @var \OxidEsales\Eshop\Application\Model\AmountPriceList $oAmPriceList */ $oAmPriceList = oxNew(\OxidEsales\Eshop\Application\Model\AmountPriceList::class); $this->setAmountPriceList($oAmPriceList); if (!$this->skipDiscounts()) { //collecting assigned to article amount-price list $oAmPriceList->load($this); // prepare abs prices if currently having percentages $oBasePrice = $this->_getGroupPrice(); foreach ($oAmPriceList as $oAmPrice) { if ($oAmPrice->oxprice2article__oxaddperc->value) { $oAmPrice->oxprice2article__oxaddabs = new \OxidEsales\Eshop\Core\Field( \OxidEsales\Eshop\Core\Price::percent($oBasePrice, 100 - $oAmPrice->oxprice2article__oxaddperc->value), \OxidEsales\Eshop\Core\Field::T_RAW ); } } } $this->setAmountPriceList($oAmPriceList); } return $this->_oAmountPriceList; }
[ "protected", "function", "buildAmountPriceList", "(", ")", "{", "if", "(", "$", "this", "->", "getAmountPriceList", "(", ")", "===", "null", ")", "{", "/** @var \\OxidEsales\\Eshop\\Application\\Model\\AmountPriceList $oAmPriceList */", "$", "oAmPriceList", "=", "oxNew", ...
Collecting assigned to article amount-price list. @return \OxidEsales\Eshop\Application\Model\AmountPriceList
[ "Collecting", "assigned", "to", "article", "amount", "-", "price", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4199-L4226
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._isFieldEmpty
protected function _isFieldEmpty($sFieldName) { $mValue = $this->$sFieldName->value; if (is_null($mValue)) { return true; } if ($mValue === '') { return true; } // certain fields with zero value treat as empty $aZeroValueFields = ['oxarticles__oxprice', 'oxarticles__oxvat', 'oxarticles__oxunitquantity']; if (!$mValue && in_array($sFieldName, $aZeroValueFields)) { return true; } if (!strcmp($mValue, '0000-00-00 00:00:00') || !strcmp($mValue, '0000-00-00')) { return true; } $sFieldName = strtolower($sFieldName); if ($sFieldName == 'oxarticles__oxicon' && (strpos($mValue, "nopic_ico.jpg") !== false || strpos( $mValue, "nopic.jpg" ) !== false) ) { return true; } if (strpos($mValue, "nopic.jpg") !== false && ($sFieldName == 'oxarticles__oxthumb' || substr( $sFieldName, 0, 17 ) == 'oxarticles__oxpic' || substr($sFieldName, 0, 18) == 'oxarticles__oxzoom') ) { return true; } return false; }
php
protected function _isFieldEmpty($sFieldName) { $mValue = $this->$sFieldName->value; if (is_null($mValue)) { return true; } if ($mValue === '') { return true; } // certain fields with zero value treat as empty $aZeroValueFields = ['oxarticles__oxprice', 'oxarticles__oxvat', 'oxarticles__oxunitquantity']; if (!$mValue && in_array($sFieldName, $aZeroValueFields)) { return true; } if (!strcmp($mValue, '0000-00-00 00:00:00') || !strcmp($mValue, '0000-00-00')) { return true; } $sFieldName = strtolower($sFieldName); if ($sFieldName == 'oxarticles__oxicon' && (strpos($mValue, "nopic_ico.jpg") !== false || strpos( $mValue, "nopic.jpg" ) !== false) ) { return true; } if (strpos($mValue, "nopic.jpg") !== false && ($sFieldName == 'oxarticles__oxthumb' || substr( $sFieldName, 0, 17 ) == 'oxarticles__oxpic' || substr($sFieldName, 0, 18) == 'oxarticles__oxzoom') ) { return true; } return false; }
[ "protected", "function", "_isFieldEmpty", "(", "$", "sFieldName", ")", "{", "$", "mValue", "=", "$", "this", "->", "$", "sFieldName", "->", "value", ";", "if", "(", "is_null", "(", "$", "mValue", ")", ")", "{", "return", "true", ";", "}", "if", "(", ...
Detects if field is empty. @param string $sFieldName Field name @return bool
[ "Detects", "if", "field", "is", "empty", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4235-L4279
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._isImageField
protected function _isImageField($sFieldName) { return (stristr($sFieldName, '_oxthumb') || stristr($sFieldName, '_oxicon') || stristr( $sFieldName, '_oxzoom' ) || stristr($sFieldName, '_oxpic')); }
php
protected function _isImageField($sFieldName) { return (stristr($sFieldName, '_oxthumb') || stristr($sFieldName, '_oxicon') || stristr( $sFieldName, '_oxzoom' ) || stristr($sFieldName, '_oxpic')); }
[ "protected", "function", "_isImageField", "(", "$", "sFieldName", ")", "{", "return", "(", "stristr", "(", "$", "sFieldName", ",", "'_oxthumb'", ")", "||", "stristr", "(", "$", "sFieldName", ",", "'_oxicon'", ")", "||", "stristr", "(", "$", "sFieldName", "...
Detects if field is an image field by field name @param string $sFieldName Field name @return bool.
[ "Detects", "if", "field", "is", "an", "image", "field", "by", "field", "name" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4327-L4333
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._assignNotBuyableParent
protected function _assignNotBuyableParent() { if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blVariantParentBuyable') && ($this->_blHasVariants || $this->oxarticles__oxvarstock->value || $this->oxarticles__oxvarcount->value) ) { $this->_blNotBuyableParent = true; } }
php
protected function _assignNotBuyableParent() { if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blVariantParentBuyable') && ($this->_blHasVariants || $this->oxarticles__oxvarstock->value || $this->oxarticles__oxvarcount->value) ) { $this->_blNotBuyableParent = true; } }
[ "protected", "function", "_assignNotBuyableParent", "(", ")", "{", "if", "(", "!", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'blVariantParentBuyable'", ")", "&&", "(", "$", "...
if we have variants then depending on config option the parent may be non buyable
[ "if", "we", "have", "variants", "then", "depending", "on", "config", "option", "the", "parent", "may", "be", "non", "buyable" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4355-L4362
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._assignStock
protected function _assignStock() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // ----------------------------------- // stock // ----------------------------------- // #1125 A. must round (using floor()) value taken from database and cast to int if (!$myConfig->getConfigParam('blAllowUnevenAmounts') && !$this->isAdmin()) { $this->oxarticles__oxstock = new \OxidEsales\Eshop\Core\Field((int) floor($this->oxarticles__oxstock->value)); } //GREEN light $this->_iStockStatus = 0; // if we have flag /*1 or*/ 4 - we show always green light if ($myConfig->getConfigParam('blUseStock') && /*$this->oxarticles__oxstockflag->value != 1 && */ $this->oxarticles__oxstockflag->value != 4 ) { //ORANGE light $iStock = $this->oxarticles__oxstock->value; if ($this->_blNotBuyableParent) { $iStock = $this->oxarticles__oxvarstock->value; } if ($iStock <= $myConfig->getConfigParam('sStockWarningLimit') && $iStock > 0) { $this->_iStockStatus = 1; } //RED light if ($iStock <= 0) { $this->_iStockStatus = -1; } } // stock if ($myConfig->getConfigParam('blUseStock') && ($this->oxarticles__oxstockflag->value == 3 || $this->oxarticles__oxstockflag->value == 2)) { $iOnStock = $this->oxarticles__oxstock->value; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blPsBasketReservationEnabled')) { $iOnStock += $this->getSession()->getBasketReservations()->getReservedAmount($this->getId()); } if ($iOnStock <= 0) { $this->setBuyableState(false); } } //exceptional handling for variant parent stock: if ($this->_blNotBuyable && $this->oxarticles__oxvarstock->value) { $this->setBuyableState(true); //but then at least setting notBuaybleParent to true $this->_blNotBuyableParent = true; } //special treatment for lists when blVariantParentBuyable config option is set to false //then we just hide "to basket" button. //if variants are not loaded in the list and this article has variants and parent is not buyable then this article is not buyable if (!$myConfig->getConfigParam('blVariantParentBuyable') && !$myConfig->getConfigParam('blLoadVariants') && $this->oxarticles__oxvarstock->value) { $this->setBuyableState(false); } //setting to non buyable when variant list is empty (for example not loaded or inactive) and $this is non buyable parent if (!$this->_blNotBuyable && $this->_blNotBuyableParent && $this->oxarticles__oxvarcount->value == 0) { $this->setBuyableState(false); } }
php
protected function _assignStock() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // ----------------------------------- // stock // ----------------------------------- // #1125 A. must round (using floor()) value taken from database and cast to int if (!$myConfig->getConfigParam('blAllowUnevenAmounts') && !$this->isAdmin()) { $this->oxarticles__oxstock = new \OxidEsales\Eshop\Core\Field((int) floor($this->oxarticles__oxstock->value)); } //GREEN light $this->_iStockStatus = 0; // if we have flag /*1 or*/ 4 - we show always green light if ($myConfig->getConfigParam('blUseStock') && /*$this->oxarticles__oxstockflag->value != 1 && */ $this->oxarticles__oxstockflag->value != 4 ) { //ORANGE light $iStock = $this->oxarticles__oxstock->value; if ($this->_blNotBuyableParent) { $iStock = $this->oxarticles__oxvarstock->value; } if ($iStock <= $myConfig->getConfigParam('sStockWarningLimit') && $iStock > 0) { $this->_iStockStatus = 1; } //RED light if ($iStock <= 0) { $this->_iStockStatus = -1; } } // stock if ($myConfig->getConfigParam('blUseStock') && ($this->oxarticles__oxstockflag->value == 3 || $this->oxarticles__oxstockflag->value == 2)) { $iOnStock = $this->oxarticles__oxstock->value; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blPsBasketReservationEnabled')) { $iOnStock += $this->getSession()->getBasketReservations()->getReservedAmount($this->getId()); } if ($iOnStock <= 0) { $this->setBuyableState(false); } } //exceptional handling for variant parent stock: if ($this->_blNotBuyable && $this->oxarticles__oxvarstock->value) { $this->setBuyableState(true); //but then at least setting notBuaybleParent to true $this->_blNotBuyableParent = true; } //special treatment for lists when blVariantParentBuyable config option is set to false //then we just hide "to basket" button. //if variants are not loaded in the list and this article has variants and parent is not buyable then this article is not buyable if (!$myConfig->getConfigParam('blVariantParentBuyable') && !$myConfig->getConfigParam('blLoadVariants') && $this->oxarticles__oxvarstock->value) { $this->setBuyableState(false); } //setting to non buyable when variant list is empty (for example not loaded or inactive) and $this is non buyable parent if (!$this->_blNotBuyable && $this->_blNotBuyableParent && $this->oxarticles__oxvarcount->value == 0) { $this->setBuyableState(false); } }
[ "protected", "function", "_assignStock", "(", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "// -----------------------------------", "// stock", "// -------------------------------...
Assigns stock status to article
[ "Assigns", "stock", "status", "to", "article" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4367-L4432
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._assignPersistentParam
protected function _assignPersistentParam() { // Persistent Parameter Handling $aPersParam = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('persparam'); if (isset($aPersParam) && isset($aPersParam[$this->getId()])) { $this->_aPersistParam = $aPersParam[$this->getId()]; } }
php
protected function _assignPersistentParam() { // Persistent Parameter Handling $aPersParam = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('persparam'); if (isset($aPersParam) && isset($aPersParam[$this->getId()])) { $this->_aPersistParam = $aPersParam[$this->getId()]; } }
[ "protected", "function", "_assignPersistentParam", "(", ")", "{", "// Persistent Parameter Handling", "$", "aPersParam", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getSession", "(", ")", "->", "getVariable", "(", "'persparam'", ...
Assigns persistent param to article. @deprecated on b-dev (2015-11-30); Not used anymore. Setting pers params to session was removed since 2.7.
[ "Assigns", "persistent", "param", "to", "article", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4439-L4446
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._assignDynImageDir
protected function _assignDynImageDir() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $sThisShop = $this->oxarticles__oxshopid->value; $this->_sDynImageDir = $myConfig->getPictureUrl(null, false); $this->dabsimagedir = $myConfig->getPictureDir(false); //$sThisShop $this->nossl_dimagedir = $myConfig->getPictureUrl(null, false, false, null, $sThisShop); //$sThisShop $this->ssl_dimagedir = $myConfig->getPictureUrl(null, false, true, null, $sThisShop); //$sThisShop }
php
protected function _assignDynImageDir() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $sThisShop = $this->oxarticles__oxshopid->value; $this->_sDynImageDir = $myConfig->getPictureUrl(null, false); $this->dabsimagedir = $myConfig->getPictureDir(false); //$sThisShop $this->nossl_dimagedir = $myConfig->getPictureUrl(null, false, false, null, $sThisShop); //$sThisShop $this->ssl_dimagedir = $myConfig->getPictureUrl(null, false, true, null, $sThisShop); //$sThisShop }
[ "protected", "function", "_assignDynImageDir", "(", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "sThisShop", "=", "$", "this", "->", "oxarticles__oxshopid", "->", ...
assigns dynimagedir to article
[ "assigns", "dynimagedir", "to", "article" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4451-L4461
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._assignComparisonListFlag
protected function _assignComparisonListFlag() { // #657 add a flag if article is on comparisonlist $aItems = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aFiltcompproducts'); if (isset($aItems[$this->getId()])) { $this->_blIsOnComparisonList = true; } }
php
protected function _assignComparisonListFlag() { // #657 add a flag if article is on comparisonlist $aItems = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aFiltcompproducts'); if (isset($aItems[$this->getId()])) { $this->_blIsOnComparisonList = true; } }
[ "protected", "function", "_assignComparisonListFlag", "(", ")", "{", "// #657 add a flag if article is on comparisonlist", "$", "aItems", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getSession", "(", ")", "->", "getVariable", "(", ...
Adds a flag if article is on comparisonlist.
[ "Adds", "a", "flag", "if", "article", "is", "on", "comparisonlist", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4466-L4474
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._deleteRecords
protected function _deleteRecords($articleId) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $articleId = $oDb->quote($articleId); //remove other records $sDelete = 'delete from oxobject2article where oxarticlenid = ' . $articleId . ' or oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxobject2attribute where oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxobject2category where oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxobject2selectlist where oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxprice2article where oxartid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxreviews where oxtype="oxarticle" and oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxratings where oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxaccessoire2article where oxobjectid = ' . $articleId . ' or oxarticlenid = ' . $articleId . ' '; $oDb->execute($sDelete); //#1508C - deleting oxobject2delivery entries added $sDelete = 'delete from oxobject2delivery where oxobjectid = ' . $articleId . ' and oxtype=\'oxarticles\' '; $oDb->execute($sDelete); $sDelete = 'delete from oxartextends where oxid = ' . $articleId . ' '; $oDb->execute($sDelete); //delete the record foreach ($this->_getLanguageSetTables("oxartextends") as $sSetTbl) { $oDb->execute("delete from $sSetTbl where oxid = {$articleId}"); } $sDelete = 'delete from oxactions2article where oxartid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxobject2list where oxobjectid = ' . $articleId . ' '; return $oDb->execute($sDelete); }
php
protected function _deleteRecords($articleId) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $articleId = $oDb->quote($articleId); //remove other records $sDelete = 'delete from oxobject2article where oxarticlenid = ' . $articleId . ' or oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxobject2attribute where oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxobject2category where oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxobject2selectlist where oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxprice2article where oxartid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxreviews where oxtype="oxarticle" and oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxratings where oxobjectid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxaccessoire2article where oxobjectid = ' . $articleId . ' or oxarticlenid = ' . $articleId . ' '; $oDb->execute($sDelete); //#1508C - deleting oxobject2delivery entries added $sDelete = 'delete from oxobject2delivery where oxobjectid = ' . $articleId . ' and oxtype=\'oxarticles\' '; $oDb->execute($sDelete); $sDelete = 'delete from oxartextends where oxid = ' . $articleId . ' '; $oDb->execute($sDelete); //delete the record foreach ($this->_getLanguageSetTables("oxartextends") as $sSetTbl) { $oDb->execute("delete from $sSetTbl where oxid = {$articleId}"); } $sDelete = 'delete from oxactions2article where oxartid = ' . $articleId . ' '; $oDb->execute($sDelete); $sDelete = 'delete from oxobject2list where oxobjectid = ' . $articleId . ' '; return $oDb->execute($sDelete); }
[ "protected", "function", "_deleteRecords", "(", "$", "articleId", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "articleId", "=", "$", "oDb", "->", "quote", "(", ...
Deletes records in database @param string $articleId Article ID @return int
[ "Deletes", "records", "in", "database" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4517-L4566
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._deleteVariantRecords
protected function _deleteVariantRecords($sOXID) { if ($sOXID) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); //collect variants to remove recursively $query= 'select oxid from ' . $this->getViewName() . ' where oxparentid = ?'; $rs = $database->select($query, [$sOXID]); $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if ($rs != false && $rs->count() > 0) { while (!$rs->EOF) { $oArticle->setId($rs->fields[0]); $oArticle->delete(); $rs->fetchRow(); } } } }
php
protected function _deleteVariantRecords($sOXID) { if ($sOXID) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); //collect variants to remove recursively $query= 'select oxid from ' . $this->getViewName() . ' where oxparentid = ?'; $rs = $database->select($query, [$sOXID]); $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if ($rs != false && $rs->count() > 0) { while (!$rs->EOF) { $oArticle->setId($rs->fields[0]); $oArticle->delete(); $rs->fetchRow(); } } } }
[ "protected", "function", "_deleteVariantRecords", "(", "$", "sOXID", ")", "{", "if", "(", "$", "sOXID", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "//collect vari...
Deletes variant records @param string $sOXID Article ID
[ "Deletes", "variant", "records" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4573-L4589
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._onChangeResetCounts
protected function _onChangeResetCounts($sOxid, $sVendorId = null, $sManufacturerId = null) { $myUtilsCount = \OxidEsales\Eshop\Core\Registry::getUtilsCount(); if ($sVendorId) { $myUtilsCount->resetVendorArticleCount($sVendorId); } if ($sManufacturerId) { $myUtilsCount->resetManufacturerArticleCount($sManufacturerId); } $aCategoryIds = $this->getCategoryIds(); //also reseting category counts foreach ($aCategoryIds as $sCatId) { $myUtilsCount->resetCatArticleCount($sCatId); } }
php
protected function _onChangeResetCounts($sOxid, $sVendorId = null, $sManufacturerId = null) { $myUtilsCount = \OxidEsales\Eshop\Core\Registry::getUtilsCount(); if ($sVendorId) { $myUtilsCount->resetVendorArticleCount($sVendorId); } if ($sManufacturerId) { $myUtilsCount->resetManufacturerArticleCount($sManufacturerId); } $aCategoryIds = $this->getCategoryIds(); //also reseting category counts foreach ($aCategoryIds as $sCatId) { $myUtilsCount->resetCatArticleCount($sCatId); } }
[ "protected", "function", "_onChangeResetCounts", "(", "$", "sOxid", ",", "$", "sVendorId", "=", "null", ",", "$", "sManufacturerId", "=", "null", ")", "{", "$", "myUtilsCount", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "...
Resets category and vendor counts. This method is supposed to be called on article change trigger. @param string $sOxid object to reset id ID @param string $sVendorId Vendor ID @param string $sManufacturerId Manufacturer ID
[ "Resets", "category", "and", "vendor", "counts", ".", "This", "method", "is", "supposed", "to", "be", "called", "on", "article", "change", "trigger", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4619-L4636
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._onChangeUpdateStock
protected function _onChangeUpdateStock($parentId) { if ($parentId) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = 'SELECT oxstock, oxvendorid, oxmanufacturerid FROM oxarticles WHERE oxid = ?'; $rs = $database->select($query, [$parentId]); $oldStock = $rs->fields[0]; $vendorId = $rs->fields[1]; $manufacturerId = $rs->fields[2]; $query = 'SELECT SUM(oxstock) FROM ' . $this->getViewName(true) . ' WHERE oxparentid = ? AND ' . $this->getSqlActiveSnippet(true) . ' AND oxstock > 0 '; $stock = (float) $database->getOne($query, [$parentId]); $query = 'UPDATE oxarticles SET oxvarstock = ? WHERE oxid = ?'; $database->execute($query, [$stock, $parentId]); //now lets update category counts //first detect stock status change for this article (to or from 0) if ($stock < 0) { $stock = 0; } if ($oldStock < 0) { $oldStock = 0; } if ($this->oxarticles__oxstockflag->value == 2 && $oldStock xor $stock) { //means the stock status could be changed (oxstock turns from 0 to 1 or from 1 to 0) // so far we leave it like this but later we could move all count resets to one or two functions $this->_onChangeResetCounts($parentId, $vendorId, $manufacturerId); } } }
php
protected function _onChangeUpdateStock($parentId) { if ($parentId) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = 'SELECT oxstock, oxvendorid, oxmanufacturerid FROM oxarticles WHERE oxid = ?'; $rs = $database->select($query, [$parentId]); $oldStock = $rs->fields[0]; $vendorId = $rs->fields[1]; $manufacturerId = $rs->fields[2]; $query = 'SELECT SUM(oxstock) FROM ' . $this->getViewName(true) . ' WHERE oxparentid = ? AND ' . $this->getSqlActiveSnippet(true) . ' AND oxstock > 0 '; $stock = (float) $database->getOne($query, [$parentId]); $query = 'UPDATE oxarticles SET oxvarstock = ? WHERE oxid = ?'; $database->execute($query, [$stock, $parentId]); //now lets update category counts //first detect stock status change for this article (to or from 0) if ($stock < 0) { $stock = 0; } if ($oldStock < 0) { $oldStock = 0; } if ($this->oxarticles__oxstockflag->value == 2 && $oldStock xor $stock) { //means the stock status could be changed (oxstock turns from 0 to 1 or from 1 to 0) // so far we leave it like this but later we could move all count resets to one or two functions $this->_onChangeResetCounts($parentId, $vendorId, $manufacturerId); } } }
[ "protected", "function", "_onChangeUpdateStock", "(", "$", "parentId", ")", "{", "if", "(", "$", "parentId", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "qu...
Updates article stock. This method is supposed to be called on article change trigger. @param string $parentId product parent id
[ "Updates", "article", "stock", ".", "This", "method", "is", "supposed", "to", "be", "called", "on", "article", "change", "trigger", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4643-L4673
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._onChangeStockResetCount
protected function _onChangeStockResetCount($sOxid) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if ($myConfig->getConfigParam('blUseStock') && $this->oxarticles__oxstockflag->value == 2 && ($this->oxarticles__oxstock->value + $this->oxarticles__oxvarstock->value) <= 0 ) { $this->_onChangeResetCounts( $sOxid, $this->oxarticles__oxvendorid->value, $this->oxarticles__oxmanufacturerid->value ); } }
php
protected function _onChangeStockResetCount($sOxid) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if ($myConfig->getConfigParam('blUseStock') && $this->oxarticles__oxstockflag->value == 2 && ($this->oxarticles__oxstock->value + $this->oxarticles__oxvarstock->value) <= 0 ) { $this->_onChangeResetCounts( $sOxid, $this->oxarticles__oxvendorid->value, $this->oxarticles__oxmanufacturerid->value ); } }
[ "protected", "function", "_onChangeStockResetCount", "(", "$", "sOxid", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "if", "(", "$", "myConfig", "->", "getConfigParam", ...
Resets article count cache when stock value is zero and article goes offline. @param string $sOxid product id
[ "Resets", "article", "count", "cache", "when", "stock", "value", "is", "zero", "and", "article", "goes", "offline", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4680-L4693
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._onChangeUpdateVarCount
protected function _onChangeUpdateVarCount($parentId) { if ($parentId) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = "SELECT COUNT(*) AS varcount FROM oxarticles WHERE oxparentid = ?"; $varCount = (int) $database->getOne($query, [$parentId]); $query = "UPDATE oxarticles SET oxvarcount = ? WHERE oxid = ?"; $database->execute($query, [$varCount, $parentId]); } }
php
protected function _onChangeUpdateVarCount($parentId) { if ($parentId) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $query = "SELECT COUNT(*) AS varcount FROM oxarticles WHERE oxparentid = ?"; $varCount = (int) $database->getOne($query, [$parentId]); $query = "UPDATE oxarticles SET oxvarcount = ? WHERE oxid = ?"; $database->execute($query, [$varCount, $parentId]); } }
[ "protected", "function", "_onChangeUpdateVarCount", "(", "$", "parentId", ")", "{", "if", "(", "$", "parentId", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", ...
Updates variant count. This method is supposed to be called on article change trigger. @param string $parentId Parent ID
[ "Updates", "variant", "count", ".", "This", "method", "is", "supposed", "to", "be", "called", "on", "article", "change", "trigger", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4700-L4711
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._setVarMinMaxPrice
protected function _setVarMinMaxPrice($sParentId) { if ($sParentId) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $sQ = ' SELECT MIN( IF( `oxarticles`.`oxprice` > 0, `oxarticles`.`oxprice`, `p`.`oxprice` ) ) AS `varminprice`, MAX( IF( `oxarticles`.`oxprice` > 0, `oxarticles`.`oxprice`, `p`.`oxprice` ) ) AS `varmaxprice` FROM ' . $this->getViewName(true) . ' AS `oxarticles` LEFT JOIN ' . $this->getViewName(true) . ' AS `p` ON ( `p`.`oxid` = `oxarticles`.`oxparentid` AND `p`.`oxprice` > 0 ) WHERE ' . $this->getSqlActiveSnippet(true) . ' AND ( `oxarticles`.`oxparentid` = ' . $database->quote($sParentId) . ' )'; $aPrices = $database->getRow($sQ); if (isset($aPrices['varminprice'], $aPrices['varmaxprice'])) { $sQ = ' UPDATE `oxarticles` SET `oxvarminprice` = ' . $database->quote($aPrices['varminprice']) . ', `oxvarmaxprice` = ' . $database->quote($aPrices['varmaxprice']) . ' WHERE `oxid` = ' . $database->quote($sParentId); } else { $sQ = ' UPDATE `oxarticles` SET `oxvarminprice` = `oxprice`, `oxvarmaxprice` = `oxprice` WHERE `oxid` = ' . $database->quote($sParentId); } $database->execute($sQ); } }
php
protected function _setVarMinMaxPrice($sParentId) { if ($sParentId) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $sQ = ' SELECT MIN( IF( `oxarticles`.`oxprice` > 0, `oxarticles`.`oxprice`, `p`.`oxprice` ) ) AS `varminprice`, MAX( IF( `oxarticles`.`oxprice` > 0, `oxarticles`.`oxprice`, `p`.`oxprice` ) ) AS `varmaxprice` FROM ' . $this->getViewName(true) . ' AS `oxarticles` LEFT JOIN ' . $this->getViewName(true) . ' AS `p` ON ( `p`.`oxid` = `oxarticles`.`oxparentid` AND `p`.`oxprice` > 0 ) WHERE ' . $this->getSqlActiveSnippet(true) . ' AND ( `oxarticles`.`oxparentid` = ' . $database->quote($sParentId) . ' )'; $aPrices = $database->getRow($sQ); if (isset($aPrices['varminprice'], $aPrices['varmaxprice'])) { $sQ = ' UPDATE `oxarticles` SET `oxvarminprice` = ' . $database->quote($aPrices['varminprice']) . ', `oxvarmaxprice` = ' . $database->quote($aPrices['varmaxprice']) . ' WHERE `oxid` = ' . $database->quote($sParentId); } else { $sQ = ' UPDATE `oxarticles` SET `oxvarminprice` = `oxprice`, `oxvarmaxprice` = `oxprice` WHERE `oxid` = ' . $database->quote($sParentId); } $database->execute($sQ); } }
[ "protected", "function", "_setVarMinMaxPrice", "(", "$", "sParentId", ")", "{", "if", "(", "$", "sParentId", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", "\\", "OxidEsales", ...
Updates variant min price. This method is supposed to be called on article change trigger. @param string $sParentId Parent ID
[ "Updates", "variant", "min", "price", ".", "This", "method", "is", "supposed", "to", "be", "called", "on", "article", "change", "trigger", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4718-L4750
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._hasMasterImage
protected function _hasMasterImage($iIndex) { $sPicName = basename($this->{"oxarticles__oxpic" . $iIndex}->value); if ($sPicName == "nopic.jpg" || $sPicName == "") { return false; } if ($this->isVariant() && $this->getParentArticle() && $this->getParentArticle()->{"oxarticles__oxpic" . $iIndex}->value == $this->{"oxarticles__oxpic" . $iIndex}->value ) { return false; } $sMasterPic = 'product/' . $iIndex . "/" . $sPicName; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getMasterPicturePath($sMasterPic)) { return true; } return false; }
php
protected function _hasMasterImage($iIndex) { $sPicName = basename($this->{"oxarticles__oxpic" . $iIndex}->value); if ($sPicName == "nopic.jpg" || $sPicName == "") { return false; } if ($this->isVariant() && $this->getParentArticle() && $this->getParentArticle()->{"oxarticles__oxpic" . $iIndex}->value == $this->{"oxarticles__oxpic" . $iIndex}->value ) { return false; } $sMasterPic = 'product/' . $iIndex . "/" . $sPicName; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getMasterPicturePath($sMasterPic)) { return true; } return false; }
[ "protected", "function", "_hasMasterImage", "(", "$", "iIndex", ")", "{", "$", "sPicName", "=", "basename", "(", "$", "this", "->", "{", "\"oxarticles__oxpic\"", ".", "$", "iIndex", "}", "->", "value", ")", ";", "if", "(", "$", "sPicName", "==", "\"nopic...
Checks if article has uploaded master image for selected picture @param int $iIndex master picture index @return bool
[ "Checks", "if", "article", "has", "uploaded", "master", "image", "for", "selected", "picture" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4759-L4780
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._isPriceViewModeNetto
protected function _isPriceViewModeNetto() { $blResult = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowNetPrice'); $oUser = $this->getArticleUser(); if ($oUser) { $blResult = $oUser->isPriceViewModeNetto(); } return $blResult; }
php
protected function _isPriceViewModeNetto() { $blResult = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowNetPrice'); $oUser = $this->getArticleUser(); if ($oUser) { $blResult = $oUser->isPriceViewModeNetto(); } return $blResult; }
[ "protected", "function", "_isPriceViewModeNetto", "(", ")", "{", "$", "blResult", "=", "(", "bool", ")", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'blShowNetPrice'", ")", ";"...
Checks and return true if price view mode is netto @return bool
[ "Checks", "and", "return", "true", "if", "price", "view", "mode", "is", "netto" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4788-L4797
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getPriceObject
protected function _getPriceObject($blCalculationModeNetto = null) { /** @var \OxidEsales\Eshop\Core\Price $oPrice */ $oPrice = oxNew(\OxidEsales\Eshop\Core\Price::class); if ($blCalculationModeNetto === null) { $blCalculationModeNetto = $this->_isPriceViewModeNetto(); } if ($blCalculationModeNetto) { $oPrice->setNettoPriceMode(); } else { $oPrice->setBruttoPriceMode(); } return $oPrice; }
php
protected function _getPriceObject($blCalculationModeNetto = null) { /** @var \OxidEsales\Eshop\Core\Price $oPrice */ $oPrice = oxNew(\OxidEsales\Eshop\Core\Price::class); if ($blCalculationModeNetto === null) { $blCalculationModeNetto = $this->_isPriceViewModeNetto(); } if ($blCalculationModeNetto) { $oPrice->setNettoPriceMode(); } else { $oPrice->setBruttoPriceMode(); } return $oPrice; }
[ "protected", "function", "_getPriceObject", "(", "$", "blCalculationModeNetto", "=", "null", ")", "{", "/** @var \\OxidEsales\\Eshop\\Core\\Price $oPrice */", "$", "oPrice", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Price", "::", "cl...
Depending on view mode prepare oxPrice object @param bool $blCalculationModeNetto - if calculation mode netto - true @return oxPice
[ "Depending", "on", "view", "mode", "prepare", "oxPrice", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4807-L4823
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getPriceForView
protected function _getPriceForView($oPrice) { if ($this->_isPriceViewModeNetto()) { $dPrice = $oPrice->getNettoPrice(); } else { $dPrice = $oPrice->getBruttoPrice(); } return $dPrice; }
php
protected function _getPriceForView($oPrice) { if ($this->_isPriceViewModeNetto()) { $dPrice = $oPrice->getNettoPrice(); } else { $dPrice = $oPrice->getBruttoPrice(); } return $dPrice; }
[ "protected", "function", "_getPriceForView", "(", "$", "oPrice", ")", "{", "if", "(", "$", "this", "->", "_isPriceViewModeNetto", "(", ")", ")", "{", "$", "dPrice", "=", "$", "oPrice", "->", "getNettoPrice", "(", ")", ";", "}", "else", "{", "$", "dPric...
Depending on view mode prepare price for viewing @param \OxidEsales\Eshop\Core\Price $oPrice price object @return double
[ "Depending", "on", "view", "mode", "prepare", "price", "for", "viewing" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4832-L4841
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._preparePrice
protected function _preparePrice($dPrice, $dVat, $blCalculationModeNetto = null) { if ($blCalculationModeNetto === null) { $blCalculationModeNetto = $this->_isPriceViewModeNetto(); } $oCurrency = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject(); $blEnterNetPrice = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blEnterNetPrice'); if ($blCalculationModeNetto && !$blEnterNetPrice) { $dPrice = round(\OxidEsales\Eshop\Core\Price::brutto2Netto($dPrice, $dVat), $oCurrency->decimal); } elseif (!$blCalculationModeNetto && $blEnterNetPrice) { $dPrice = round(\OxidEsales\Eshop\Core\Price::netto2Brutto($dPrice, $dVat), $oCurrency->decimal); } return $dPrice; }
php
protected function _preparePrice($dPrice, $dVat, $blCalculationModeNetto = null) { if ($blCalculationModeNetto === null) { $blCalculationModeNetto = $this->_isPriceViewModeNetto(); } $oCurrency = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject(); $blEnterNetPrice = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blEnterNetPrice'); if ($blCalculationModeNetto && !$blEnterNetPrice) { $dPrice = round(\OxidEsales\Eshop\Core\Price::brutto2Netto($dPrice, $dVat), $oCurrency->decimal); } elseif (!$blCalculationModeNetto && $blEnterNetPrice) { $dPrice = round(\OxidEsales\Eshop\Core\Price::netto2Brutto($dPrice, $dVat), $oCurrency->decimal); } return $dPrice; }
[ "protected", "function", "_preparePrice", "(", "$", "dPrice", ",", "$", "dVat", ",", "$", "blCalculationModeNetto", "=", "null", ")", "{", "if", "(", "$", "blCalculationModeNetto", "===", "null", ")", "{", "$", "blCalculationModeNetto", "=", "$", "this", "->...
Depending on view mode prepare price before calculation @param double $dPrice - price @param double $dVat - VAT @param bool $blCalculationModeNetto - if calculation mode netto - true @return double
[ "Depending", "on", "view", "mode", "prepare", "price", "before", "calculation" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4853-L4869
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getUserPriceSufix
protected function _getUserPriceSufix() { $sPriceSuffix = ''; $oUser = $this->getArticleUser(); if ($oUser) { if ($oUser->inGroup('oxidpricea')) { $sPriceSuffix = 'a'; } elseif ($oUser->inGroup('oxidpriceb')) { $sPriceSuffix = 'b'; } elseif ($oUser->inGroup('oxidpricec')) { $sPriceSuffix = 'c'; } } return $sPriceSuffix; }
php
protected function _getUserPriceSufix() { $sPriceSuffix = ''; $oUser = $this->getArticleUser(); if ($oUser) { if ($oUser->inGroup('oxidpricea')) { $sPriceSuffix = 'a'; } elseif ($oUser->inGroup('oxidpriceb')) { $sPriceSuffix = 'b'; } elseif ($oUser->inGroup('oxidpricec')) { $sPriceSuffix = 'c'; } } return $sPriceSuffix; }
[ "protected", "function", "_getUserPriceSufix", "(", ")", "{", "$", "sPriceSuffix", "=", "''", ";", "$", "oUser", "=", "$", "this", "->", "getArticleUser", "(", ")", ";", "if", "(", "$", "oUser", ")", "{", "if", "(", "$", "oUser", "->", "inGroup", "("...
Return price suffix @return null
[ "Return", "price", "suffix" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4877-L4893
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getPrice
protected function _getPrice() { $sPriceSuffix = $this->_getUserPriceSufix(); if ($sPriceSuffix === '') { $dPrice = $this->oxarticles__oxprice->value; } else { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOverrideZeroABCPrices')) { $dPrice = ($this->{'oxarticles__oxprice' . $sPriceSuffix}->value != 0) ? $this->{'oxarticles__oxprice' . $sPriceSuffix}->value : $this->oxarticles__oxprice->value; } else { $dPrice = $this->{'oxarticles__oxprice' . $sPriceSuffix}->value; } } return $dPrice; }
php
protected function _getPrice() { $sPriceSuffix = $this->_getUserPriceSufix(); if ($sPriceSuffix === '') { $dPrice = $this->oxarticles__oxprice->value; } else { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOverrideZeroABCPrices')) { $dPrice = ($this->{'oxarticles__oxprice' . $sPriceSuffix}->value != 0) ? $this->{'oxarticles__oxprice' . $sPriceSuffix}->value : $this->oxarticles__oxprice->value; } else { $dPrice = $this->{'oxarticles__oxprice' . $sPriceSuffix}->value; } } return $dPrice; }
[ "protected", "function", "_getPrice", "(", ")", "{", "$", "sPriceSuffix", "=", "$", "this", "->", "_getUserPriceSufix", "(", ")", ";", "if", "(", "$", "sPriceSuffix", "===", "''", ")", "{", "$", "dPrice", "=", "$", "this", "->", "oxarticles__oxprice", "-...
Return prepared price @return null
[ "Return", "prepared", "price" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4900-L4914
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getVarMinPrice
protected function _getVarMinPrice() { if ($this->_dVarMinPrice === null) { $dPrice = $this->_getShopVarMinPrice(); if (is_null($dPrice)) { $sPriceSuffix = $this->_getUserPriceSufix(); if ($sPriceSuffix === '') { $dPrice = $this->oxarticles__oxvarminprice->value; } else { $sSql = 'SELECT '; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOverrideZeroABCPrices')) { $sSql .= 'MIN( IF(`oxprice' . $sPriceSuffix . '` = 0, `oxprice`, `oxprice' . $sPriceSuffix . '`) ) AS `varminprice` '; } else { $sSql .= 'MIN(`oxprice' . $sPriceSuffix . '`) AS `varminprice` '; } $sSql .= ' FROM ' . $this->getViewName(true) . ' WHERE ' . $this->getSqlActiveSnippet(true) . ' AND ( `oxparentid` = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()) . ' )'; $dPrice = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSql); } } $this->_dVarMinPrice = $dPrice; } return $this->_dVarMinPrice; }
php
protected function _getVarMinPrice() { if ($this->_dVarMinPrice === null) { $dPrice = $this->_getShopVarMinPrice(); if (is_null($dPrice)) { $sPriceSuffix = $this->_getUserPriceSufix(); if ($sPriceSuffix === '') { $dPrice = $this->oxarticles__oxvarminprice->value; } else { $sSql = 'SELECT '; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOverrideZeroABCPrices')) { $sSql .= 'MIN( IF(`oxprice' . $sPriceSuffix . '` = 0, `oxprice`, `oxprice' . $sPriceSuffix . '`) ) AS `varminprice` '; } else { $sSql .= 'MIN(`oxprice' . $sPriceSuffix . '`) AS `varminprice` '; } $sSql .= ' FROM ' . $this->getViewName(true) . ' WHERE ' . $this->getSqlActiveSnippet(true) . ' AND ( `oxparentid` = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()) . ' )'; $dPrice = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSql); } } $this->_dVarMinPrice = $dPrice; } return $this->_dVarMinPrice; }
[ "protected", "function", "_getVarMinPrice", "(", ")", "{", "if", "(", "$", "this", "->", "_dVarMinPrice", "===", "null", ")", "{", "$", "dPrice", "=", "$", "this", "->", "_getShopVarMinPrice", "(", ")", ";", "if", "(", "is_null", "(", "$", "dPrice", ")...
Return variant min price @return null
[ "Return", "variant", "min", "price" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4921-L4950
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._getVarMaxPrice
protected function _getVarMaxPrice() { if ($this->_dVarMaxPrice === null) { $dPrice = $this->_getShopVarMaxPrice(); if (is_null($dPrice)) { $sPriceSuffix = $this->_getUserPriceSufix(); if ($sPriceSuffix === '') { $dPrice = $this->oxarticles__oxvarmaxprice->value; } else { $sSql = 'SELECT '; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOverrideZeroABCPrices')) { $sSql .= 'MAX( IF(`oxprice' . $sPriceSuffix . '` = 0, `oxprice`, `oxprice' . $sPriceSuffix . '`) ) AS `varmaxprice` '; } else { $sSql .= 'MAX(`oxprice' . $sPriceSuffix . '`) AS `varmaxprice` '; } $sSql .= ' FROM ' . $this->getViewName(true) . ' WHERE ' . $this->getSqlActiveSnippet(true) . ' AND ( `oxparentid` = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()) . ' )'; $dPrice = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSql); } } $this->_dVarMaxPrice = $dPrice; } return $this->_dVarMaxPrice; }
php
protected function _getVarMaxPrice() { if ($this->_dVarMaxPrice === null) { $dPrice = $this->_getShopVarMaxPrice(); if (is_null($dPrice)) { $sPriceSuffix = $this->_getUserPriceSufix(); if ($sPriceSuffix === '') { $dPrice = $this->oxarticles__oxvarmaxprice->value; } else { $sSql = 'SELECT '; if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOverrideZeroABCPrices')) { $sSql .= 'MAX( IF(`oxprice' . $sPriceSuffix . '` = 0, `oxprice`, `oxprice' . $sPriceSuffix . '`) ) AS `varmaxprice` '; } else { $sSql .= 'MAX(`oxprice' . $sPriceSuffix . '`) AS `varmaxprice` '; } $sSql .= ' FROM ' . $this->getViewName(true) . ' WHERE ' . $this->getSqlActiveSnippet(true) . ' AND ( `oxparentid` = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()) . ' )'; $dPrice = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sSql); } } $this->_dVarMaxPrice = $dPrice; } return $this->_dVarMaxPrice; }
[ "protected", "function", "_getVarMaxPrice", "(", ")", "{", "if", "(", "$", "this", "->", "_dVarMaxPrice", "===", "null", ")", "{", "$", "dPrice", "=", "$", "this", "->", "_getShopVarMaxPrice", "(", ")", ";", "if", "(", "is_null", "(", "$", "dPrice", ")...
Return variant max price @return null
[ "Return", "variant", "max", "price" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L4957-L4986
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._updateParentDependFields
protected function _updateParentDependFields() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); foreach ($this->_getCopyParentFields() as $sField) { $sValue = isset($this->$sField->value) ? $this->$sField->value : 0; $sSqlSets[] = '`' . str_replace('oxarticles__', '', $sField) . '` = ' . $oDb->quote($sValue); } $sSql = "UPDATE `oxarticles` SET "; $sSql .= implode(', ', $sSqlSets) . ''; $sSql .= " WHERE `oxparentid` = " . $oDb->quote($this->getId()); return $oDb->execute($sSql); }
php
protected function _updateParentDependFields() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); foreach ($this->_getCopyParentFields() as $sField) { $sValue = isset($this->$sField->value) ? $this->$sField->value : 0; $sSqlSets[] = '`' . str_replace('oxarticles__', '', $sField) . '` = ' . $oDb->quote($sValue); } $sSql = "UPDATE `oxarticles` SET "; $sSql .= implode(', ', $sSqlSets) . ''; $sSql .= " WHERE `oxparentid` = " . $oDb->quote($this->getId()); return $oDb->execute($sSql); }
[ "protected", "function", "_updateParentDependFields", "(", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "foreach", "(", "$", "this", "->", "_getCopyParentFields", "(", ")"...
Set parent field value to child - variants in DB @return bool
[ "Set", "parent", "field", "value", "to", "child", "-", "variants", "in", "DB" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L5040-L5054
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._assignParentDependFields
protected function _assignParentDependFields() { $sParent = $this->getParentArticle(); if ($sParent) { foreach ($this->_getCopyParentFields() as $sField) { $this->$sField = new \OxidEsales\Eshop\Core\Field($sParent->$sField->value); } } }
php
protected function _assignParentDependFields() { $sParent = $this->getParentArticle(); if ($sParent) { foreach ($this->_getCopyParentFields() as $sField) { $this->$sField = new \OxidEsales\Eshop\Core\Field($sParent->$sField->value); } } }
[ "protected", "function", "_assignParentDependFields", "(", ")", "{", "$", "sParent", "=", "$", "this", "->", "getParentArticle", "(", ")", ";", "if", "(", "$", "sParent", ")", "{", "foreach", "(", "$", "this", "->", "_getCopyParentFields", "(", ")", "as", ...
Set parent field value to child - variants
[ "Set", "parent", "field", "value", "to", "child", "-", "variants" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L5069-L5077
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article._saveSortingFieldValuesOnLoad
protected function _saveSortingFieldValuesOnLoad() { $aSortingFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSortCols'); $aSortingFields = !empty($aSortingFields) ? (array) $aSortingFields : []; foreach ($aSortingFields as $sField) { $sFullField = $this->_getFieldLongName($sField); $this->_aSortingFieldsOnLoad[$sFullField] = $this->$sFullField->value; } }
php
protected function _saveSortingFieldValuesOnLoad() { $aSortingFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSortCols'); $aSortingFields = !empty($aSortingFields) ? (array) $aSortingFields : []; foreach ($aSortingFields as $sField) { $sFullField = $this->_getFieldLongName($sField); $this->_aSortingFieldsOnLoad[$sFullField] = $this->$sFullField->value; } }
[ "protected", "function", "_saveSortingFieldValuesOnLoad", "(", ")", "{", "$", "aSortingFields", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getConfigParam", "(", "'aSortCols'", ")", ";", "$", "aSo...
Saves values of sorting fields on article load.
[ "Saves", "values", "of", "sorting", "fields", "on", "article", "load", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L5082-L5091
train
OXID-eSales/oxideshop_ce
source/Application/Model/Article.php
Article.getLoadVariantsQuery
protected function getLoadVariantsQuery($blRemoveNotOrderables, $forceCoreTableUsage, $baseObject, $sArticleTable) { return "select " . $baseObject->getSelectFields($forceCoreTableUsage) . " from $sArticleTable where " . $this->getActiveCheckQuery($forceCoreTableUsage) . $this->getVariantsQuery($blRemoveNotOrderables, $forceCoreTableUsage) . " order by $sArticleTable.oxsort"; }
php
protected function getLoadVariantsQuery($blRemoveNotOrderables, $forceCoreTableUsage, $baseObject, $sArticleTable) { return "select " . $baseObject->getSelectFields($forceCoreTableUsage) . " from $sArticleTable where " . $this->getActiveCheckQuery($forceCoreTableUsage) . $this->getVariantsQuery($blRemoveNotOrderables, $forceCoreTableUsage) . " order by $sArticleTable.oxsort"; }
[ "protected", "function", "getLoadVariantsQuery", "(", "$", "blRemoveNotOrderables", ",", "$", "forceCoreTableUsage", ",", "$", "baseObject", ",", "$", "sArticleTable", ")", "{", "return", "\"select \"", ".", "$", "baseObject", "->", "getSelectFields", "(", "$", "f...
Forms query to load variants. @param bool $blRemoveNotOrderables @param bool $forceCoreTableUsage @param oxSimpleVariant|oxarticle $baseObject @param string $sArticleTable @return string
[ "Forms", "query", "to", "load", "variants", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L5103-L5109
train
OXID-eSales/oxideshop_ce
source/Core/Base.php
Base.getSession
public function getSession() { if (self::$_oSession == null) { self::$_oSession = \OxidEsales\Eshop\Core\Registry::getSession(); } return self::$_oSession; }
php
public function getSession() { if (self::$_oSession == null) { self::$_oSession = \OxidEsales\Eshop\Core\Registry::getSession(); } return self::$_oSession; }
[ "public", "function", "getSession", "(", ")", "{", "if", "(", "self", "::", "$", "_oSession", "==", "null", ")", "{", "self", "::", "$", "_oSession", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getSession", "(", ")", ...
oxSession instance getter @return \OxidEsales\Eshop\Core\Session
[ "oxSession", "instance", "getter" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Base.php#L87-L94
train
OXID-eSales/oxideshop_ce
source/Core/Base.php
Base.getUser
public function getUser() { if (self::$_oActUser === null) { self::$_oActUser = false; $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($user->loadActiveUser()) { self::$_oActUser = $user; } } return self::$_oActUser; }
php
public function getUser() { if (self::$_oActUser === null) { self::$_oActUser = false; $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($user->loadActiveUser()) { self::$_oActUser = $user; } } return self::$_oActUser; }
[ "public", "function", "getUser", "(", ")", "{", "if", "(", "self", "::", "$", "_oActUser", "===", "null", ")", "{", "self", "::", "$", "_oActUser", "=", "false", ";", "$", "user", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Applicati...
Active user getter @return \OxidEsales\Eshop\Application\Model\User
[ "Active", "user", "getter" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Base.php#L111-L122
train
OXID-eSales/oxideshop_ce
source/Core/Base.php
Base.dispatchEvent
public function dispatchEvent(\Symfony\Component\EventDispatcher\Event $event) { $container = \OxidEsales\EshopCommunity\Internal\Application\ContainerFactory::getInstance()->getContainer(); $dispatcher = $container->get(EventDispatcherInterface::class); return $dispatcher->dispatch($event::NAME, $event); }
php
public function dispatchEvent(\Symfony\Component\EventDispatcher\Event $event) { $container = \OxidEsales\EshopCommunity\Internal\Application\ContainerFactory::getInstance()->getContainer(); $dispatcher = $container->get(EventDispatcherInterface::class); return $dispatcher->dispatch($event::NAME, $event); }
[ "public", "function", "dispatchEvent", "(", "\\", "Symfony", "\\", "Component", "\\", "EventDispatcher", "\\", "Event", "$", "event", ")", "{", "$", "container", "=", "\\", "OxidEsales", "\\", "EshopCommunity", "\\", "Internal", "\\", "Application", "\\", "Con...
Dispatch given event. @param \Symfony\Component\EventDispatcher\Event $event Event to dispatch @return \Symfony\Component\EventDispatcher\Event
[ "Dispatch", "given", "event", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Base.php#L165-L170
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/UserPayment.php
UserPayment.save
public function save() { parent::save(); $soxId = $this->getEditObjectId(); if ($this->_allowAdminEdit($soxId)) { $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $aDynvalues = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("dynvalue"); if (isset($aDynvalues)) { // store the dynvalues $aParams['oxuserpayments__oxvalue'] = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesToText($aDynvalues); } if ($aParams['oxuserpayments__oxid'] == "-1") { $aParams['oxuserpayments__oxid'] = null; } $oAdress = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class); $oAdress->assign($aParams); $oAdress->save(); } }
php
public function save() { parent::save(); $soxId = $this->getEditObjectId(); if ($this->_allowAdminEdit($soxId)) { $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $aDynvalues = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("dynvalue"); if (isset($aDynvalues)) { // store the dynvalues $aParams['oxuserpayments__oxvalue'] = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesToText($aDynvalues); } if ($aParams['oxuserpayments__oxid'] == "-1") { $aParams['oxuserpayments__oxid'] = null; } $oAdress = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class); $oAdress->assign($aParams); $oAdress->save(); } }
[ "public", "function", "save", "(", ")", "{", "parent", "::", "save", "(", ")", ";", "$", "soxId", "=", "$", "this", "->", "getEditObjectId", "(", ")", ";", "if", "(", "$", "this", "->", "_allowAdminEdit", "(", "$", "soxId", ")", ")", "{", "$", "a...
Saves user payment settings.
[ "Saves", "user", "payment", "settings", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/UserPayment.php#L86-L108
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/UserPayment.php
UserPayment.delPayment
public function delPayment() { $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $soxId = $this->getEditObjectId(); if ($this->_allowAdminEdit($soxId)) { if ($aParams['oxuserpayments__oxid'] != "-1") { $oAdress = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class); if ($oAdress->load($aParams['oxuserpayments__oxid'])) { $this->_blDelete = ( bool ) $oAdress->delete(); } } } }
php
public function delPayment() { $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $soxId = $this->getEditObjectId(); if ($this->_allowAdminEdit($soxId)) { if ($aParams['oxuserpayments__oxid'] != "-1") { $oAdress = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class); if ($oAdress->load($aParams['oxuserpayments__oxid'])) { $this->_blDelete = ( bool ) $oAdress->delete(); } } } }
[ "public", "function", "delPayment", "(", ")", "{", "$", "aParams", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestParameter", "(", "\"editval\"", ")", ";", "$", "soxId", "=", "$", "th...
Deletes selected user payment information.
[ "Deletes", "selected", "user", "payment", "information", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/UserPayment.php#L113-L125
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/UserPayment.php
UserPayment.getUser
public function getUser() { if ($this->_oActiveUser == null) { $this->_oActiveUser = false; $sOxId = $this->getEditObjectId(); if (isset($sOxId) && $sOxId != "-1") { // load object $this->_oActiveUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class); $this->_oActiveUser->load($sOxId); } } return $this->_oActiveUser; }
php
public function getUser() { if ($this->_oActiveUser == null) { $this->_oActiveUser = false; $sOxId = $this->getEditObjectId(); if (isset($sOxId) && $sOxId != "-1") { // load object $this->_oActiveUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class); $this->_oActiveUser->load($sOxId); } } return $this->_oActiveUser; }
[ "public", "function", "getUser", "(", ")", "{", "if", "(", "$", "this", "->", "_oActiveUser", "==", "null", ")", "{", "$", "this", "->", "_oActiveUser", "=", "false", ";", "$", "sOxId", "=", "$", "this", "->", "getEditObjectId", "(", ")", ";", "if", ...
Returns selected user @return oxUser
[ "Returns", "selected", "user" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/UserPayment.php#L132-L145
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/UserPayment.php
UserPayment.getSelUserPayment
public function getSelUserPayment() { if ($this->_oUserPayment == null) { $this->_oUserPayment = false; $sPaymentId = $this->getPaymentId(); if ($sPaymentId != "-1" && isset($sPaymentId)) { $this->_oUserPayment = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class); $this->_oUserPayment->load($sPaymentId); $sTemplate = $this->_oUserPayment->oxuserpayments__oxvalue->value; // generate selected paymenttype $oPaymentTypes = $this->getPaymentTypes(); foreach ($oPaymentTypes as $oPayment) { if ($oPayment->oxpayments__oxid->value == $this->_oUserPayment->oxuserpayments__oxpaymentsid->value) { $oPayment->selected = 1; // if there are no values assigned we set default from paymenttype if (!$sTemplate) { $sTemplate = $oPayment->oxpayments__oxvaldesc->value; } break; } } $this->_oUserPayment->setDynValues(\OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($sTemplate)); } } return $this->_oUserPayment; }
php
public function getSelUserPayment() { if ($this->_oUserPayment == null) { $this->_oUserPayment = false; $sPaymentId = $this->getPaymentId(); if ($sPaymentId != "-1" && isset($sPaymentId)) { $this->_oUserPayment = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class); $this->_oUserPayment->load($sPaymentId); $sTemplate = $this->_oUserPayment->oxuserpayments__oxvalue->value; // generate selected paymenttype $oPaymentTypes = $this->getPaymentTypes(); foreach ($oPaymentTypes as $oPayment) { if ($oPayment->oxpayments__oxid->value == $this->_oUserPayment->oxuserpayments__oxpaymentsid->value) { $oPayment->selected = 1; // if there are no values assigned we set default from paymenttype if (!$sTemplate) { $sTemplate = $oPayment->oxpayments__oxvaldesc->value; } break; } } $this->_oUserPayment->setDynValues(\OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($sTemplate)); } } return $this->_oUserPayment; }
[ "public", "function", "getSelUserPayment", "(", ")", "{", "if", "(", "$", "this", "->", "_oUserPayment", "==", "null", ")", "{", "$", "this", "->", "_oUserPayment", "=", "false", ";", "$", "sPaymentId", "=", "$", "this", "->", "getPaymentId", "(", ")", ...
Returns selected Payment @return object
[ "Returns", "selected", "Payment" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/UserPayment.php#L196-L223
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ContentSeo.php
ContentSeo._getEncoder
protected function _getEncoder() { return \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderContent::class); }
php
protected function _getEncoder() { return \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderContent::class); }
[ "protected", "function", "_getEncoder", "(", ")", "{", "return", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "get", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "SeoEncoderContent", "::", "cla...
Returns current object type seo encoder object @return oxSeoEncoderContent
[ "Returns", "current", "object", "type", "seo", "encoder", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ContentSeo.php#L31-L34
train
OXID-eSales/oxideshop_ce
source/Core/SimpleXml.php
SimpleXml.objectToXml
public function objectToXml($oInput, $sDocument) { $oXml = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><$sDocument/>"); $this->_addSimpleXmlElement($oXml, $oInput); return $oXml->asXml(); }
php
public function objectToXml($oInput, $sDocument) { $oXml = new SimpleXMLElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><$sDocument/>"); $this->_addSimpleXmlElement($oXml, $oInput); return $oXml->asXml(); }
[ "public", "function", "objectToXml", "(", "$", "oInput", ",", "$", "sDocument", ")", "{", "$", "oXml", "=", "new", "SimpleXMLElement", "(", "\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><$sDocument/>\"", ")", ";", "$", "this", "->", "_addSimpleXmlElement", "(",...
Parses object structure to XML string @param object $oInput Input object @param string $sDocument Document name. @return string
[ "Parses", "object", "structure", "to", "XML", "string" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SimpleXml.php#L42-L48
train
OXID-eSales/oxideshop_ce
source/Core/SimpleXml.php
SimpleXml._addChildNode
protected function _addChildNode($oXml, $sKey, $mElement, $sPreferredKey = null) { $aAttributes = []; if (is_array($mElement) && array_key_exists('attributes', $mElement) && is_array($mElement['attributes'])) { $aAttributes = $mElement['attributes']; $mElement = $mElement['value']; } if (is_object($mElement) || is_array($mElement)) { if (is_int(key($mElement))) { $this->_addSimpleXmlElement($oXml, $mElement, $sKey); } else { $oChildNode = $oXml->addChild($sPreferredKey? $sPreferredKey : $sKey); $this->_addNodeAttributes($oChildNode, $aAttributes); $this->_addSimpleXmlElement($oChildNode, $mElement); } } else { $oChildNode = $oXml->addChild($sPreferredKey? $sPreferredKey : $sKey, $mElement); $this->_addNodeAttributes($oChildNode, $aAttributes); } return $oXml; }
php
protected function _addChildNode($oXml, $sKey, $mElement, $sPreferredKey = null) { $aAttributes = []; if (is_array($mElement) && array_key_exists('attributes', $mElement) && is_array($mElement['attributes'])) { $aAttributes = $mElement['attributes']; $mElement = $mElement['value']; } if (is_object($mElement) || is_array($mElement)) { if (is_int(key($mElement))) { $this->_addSimpleXmlElement($oXml, $mElement, $sKey); } else { $oChildNode = $oXml->addChild($sPreferredKey? $sPreferredKey : $sKey); $this->_addNodeAttributes($oChildNode, $aAttributes); $this->_addSimpleXmlElement($oChildNode, $mElement); } } else { $oChildNode = $oXml->addChild($sPreferredKey? $sPreferredKey : $sKey, $mElement); $this->_addNodeAttributes($oChildNode, $aAttributes); } return $oXml; }
[ "protected", "function", "_addChildNode", "(", "$", "oXml", ",", "$", "sKey", ",", "$", "mElement", ",", "$", "sPreferredKey", "=", "null", ")", "{", "$", "aAttributes", "=", "[", "]", ";", "if", "(", "is_array", "(", "$", "mElement", ")", "&&", "arr...
Adds child node to given simple xml object. @param SimpleXMLElement $oXml @param string $sKey @param string|array|object $mElement @param string $sPreferredKey @return SimpleXMLElement
[ "Adds", "child", "node", "to", "given", "simple", "xml", "object", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SimpleXml.php#L92-L114
train
OXID-eSales/oxideshop_ce
source/Core/SimpleXml.php
SimpleXml._addNodeAttributes
protected function _addNodeAttributes($oNode, $aAttributes) { $aAttributes = (array) $aAttributes; foreach ($aAttributes as $sKey => $sValue) { $oNode->addAttribute($sKey, $sValue); } return $oNode; }
php
protected function _addNodeAttributes($oNode, $aAttributes) { $aAttributes = (array) $aAttributes; foreach ($aAttributes as $sKey => $sValue) { $oNode->addAttribute($sKey, $sValue); } return $oNode; }
[ "protected", "function", "_addNodeAttributes", "(", "$", "oNode", ",", "$", "aAttributes", ")", "{", "$", "aAttributes", "=", "(", "array", ")", "$", "aAttributes", ";", "foreach", "(", "$", "aAttributes", "as", "$", "sKey", "=>", "$", "sValue", ")", "{"...
Adds attributes to given node. @param SimpleXMLElement $oNode @param array $aAttributes @return SimpleXMLElement
[ "Adds", "attributes", "to", "given", "node", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SimpleXml.php#L124-L132
train
OXID-eSales/oxideshop_ce
source/Application/Component/UtilsComponent.php
UtilsComponent._toList
protected function _toList($sListType, $sProductId, $dAmount, $aSel) { // only if user is logged in if ($oUser = $this->getUser()) { $sProductId = ($sProductId) ? $sProductId : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('itmid'); $sProductId = ($sProductId) ? $sProductId : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid'); $dAmount = isset($dAmount) ? $dAmount : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('am'); $aSel = $aSel ? $aSel : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sel'); // processing amounts $dAmount = str_replace(',', '.', $dAmount); if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowUnevenAmounts')) { $dAmount = round(( string ) $dAmount); } $oBasket = $oUser->getBasket($sListType); $oBasket->addItemToBasket($sProductId, abs($dAmount), $aSel, ($dAmount == 0)); // recalculate basket count $oBasket->getItemCount(true); } }
php
protected function _toList($sListType, $sProductId, $dAmount, $aSel) { // only if user is logged in if ($oUser = $this->getUser()) { $sProductId = ($sProductId) ? $sProductId : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('itmid'); $sProductId = ($sProductId) ? $sProductId : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid'); $dAmount = isset($dAmount) ? $dAmount : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('am'); $aSel = $aSel ? $aSel : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sel'); // processing amounts $dAmount = str_replace(',', '.', $dAmount); if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowUnevenAmounts')) { $dAmount = round(( string ) $dAmount); } $oBasket = $oUser->getBasket($sListType); $oBasket->addItemToBasket($sProductId, abs($dAmount), $aSel, ($dAmount == 0)); // recalculate basket count $oBasket->getItemCount(true); } }
[ "protected", "function", "_toList", "(", "$", "sListType", ",", "$", "sProductId", ",", "$", "dAmount", ",", "$", "aSel", ")", "{", "// only if user is logged in", "if", "(", "$", "oUser", "=", "$", "this", "->", "getUser", "(", ")", ")", "{", "$", "sP...
Adds chosen product to defined user list. if amount is 0, item is removed from the list @param string $sListType user product list type @param string $sProductId product id @param double $dAmount product amount @param array $aSel product selection list
[ "Adds", "chosen", "product", "to", "defined", "user", "list", ".", "if", "amount", "is", "0", "item", "is", "removed", "from", "the", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/UtilsComponent.php#L135-L156
train
OXID-eSales/oxideshop_ce
source/Application/Model/VoucherSerie.php
VoucherSerie.delete
public function delete($sOxId = null) { if (!$sOxId) { $sOxId = $this->getId(); } $this->unsetDiscountRelations(); $this->unsetUserGroups(); $this->deleteVoucherList(); return parent::delete($sOxId); }
php
public function delete($sOxId = null) { if (!$sOxId) { $sOxId = $this->getId(); } $this->unsetDiscountRelations(); $this->unsetUserGroups(); $this->deleteVoucherList(); return parent::delete($sOxId); }
[ "public", "function", "delete", "(", "$", "sOxId", "=", "null", ")", "{", "if", "(", "!", "$", "sOxId", ")", "{", "$", "sOxId", "=", "$", "this", "->", "getId", "(", ")", ";", "}", "$", "this", "->", "unsetDiscountRelations", "(", ")", ";", "$", ...
Override delete function so we can delete user group and article or category relations first. @param string $sOxId object ID (default null) @return null
[ "Override", "delete", "function", "so", "we", "can", "delete", "user", "group", "and", "article", "or", "category", "relations", "first", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VoucherSerie.php#L47-L58
train
OXID-eSales/oxideshop_ce
source/Application/Model/VoucherSerie.php
VoucherSerie.setUserGroups
public function setUserGroups() { if ($this->_oGroups === null) { $this->_oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); $this->_oGroups->init('oxgroups'); $sViewName = getViewName("oxgroups"); $sSelect = "select gr.* from {$sViewName} as gr, oxobject2group as o2g where o2g.oxobjectid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()) . " and gr.oxid = o2g.oxgroupsid "; $this->_oGroups->selectString($sSelect); } return $this->_oGroups; }
php
public function setUserGroups() { if ($this->_oGroups === null) { $this->_oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); $this->_oGroups->init('oxgroups'); $sViewName = getViewName("oxgroups"); $sSelect = "select gr.* from {$sViewName} as gr, oxobject2group as o2g where o2g.oxobjectid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()) . " and gr.oxid = o2g.oxgroupsid "; $this->_oGroups->selectString($sSelect); } return $this->_oGroups; }
[ "public", "function", "setUserGroups", "(", ")", "{", "if", "(", "$", "this", "->", "_oGroups", "===", "null", ")", "{", "$", "this", "->", "_oGroups", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Model", "\\", "ListModel"...
Collects and returns user group list. @return object
[ "Collects", "and", "returns", "user", "group", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VoucherSerie.php#L65-L77
train
OXID-eSales/oxideshop_ce
source/Application/Model/VoucherSerie.php
VoucherSerie.unsetUserGroups
public function unsetUserGroups() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sDelete = 'delete from oxobject2group where oxobjectid = ' . $oDb->quote($this->getId()); $oDb->execute($sDelete); }
php
public function unsetUserGroups() { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sDelete = 'delete from oxobject2group where oxobjectid = ' . $oDb->quote($this->getId()); $oDb->execute($sDelete); }
[ "public", "function", "unsetUserGroups", "(", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "sDelete", "=", "'delete from oxobject2group where oxobjectid = '", ".", "$", ...
Removes user groups relations.
[ "Removes", "user", "groups", "relations", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VoucherSerie.php#L82-L87
train
OXID-eSales/oxideshop_ce
source/Application/Model/VoucherSerie.php
VoucherSerie.getVoucherList
public function getVoucherList() { $oVoucherList = oxNew(\OxidEsales\Eshop\Application\Model\VoucherList::class); $sSelect = 'select * from oxvouchers where oxvoucherserieid = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()); $oVoucherList->selectString($sSelect); return $oVoucherList; }
php
public function getVoucherList() { $oVoucherList = oxNew(\OxidEsales\Eshop\Application\Model\VoucherList::class); $sSelect = 'select * from oxvouchers where oxvoucherserieid = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->getId()); $oVoucherList->selectString($sSelect); return $oVoucherList; }
[ "public", "function", "getVoucherList", "(", ")", "{", "$", "oVoucherList", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "VoucherList", "::", "class", ")", ";", "$", "sSelect", "=", "'select * from oxvouchers ...
Returns array of a vouchers assigned to this serie. @return array
[ "Returns", "array", "of", "a", "vouchers", "assigned", "to", "this", "serie", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VoucherSerie.php#L104-L111
train
OXID-eSales/oxideshop_ce
source/Application/Model/VoucherSerie.php
VoucherSerie.countVouchers
public function countVouchers() { $aStatus = []; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQuery = 'select count(*) as total from oxvouchers where oxvoucherserieid = ' . $oDb->quote($this->getId()); $aStatus['total'] = $oDb->getOne($sQuery); $sQuery = 'select count(*) as used from oxvouchers where oxvoucherserieid = ' . $oDb->quote($this->getId()) . ' and ((oxorderid is not NULL and oxorderid != "") or (oxdateused is not NULL and oxdateused != 0))'; $aStatus['used'] = $oDb->getOne($sQuery); $aStatus['available'] = $aStatus['total'] - $aStatus['used']; return $aStatus; }
php
public function countVouchers() { $aStatus = []; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQuery = 'select count(*) as total from oxvouchers where oxvoucherserieid = ' . $oDb->quote($this->getId()); $aStatus['total'] = $oDb->getOne($sQuery); $sQuery = 'select count(*) as used from oxvouchers where oxvoucherserieid = ' . $oDb->quote($this->getId()) . ' and ((oxorderid is not NULL and oxorderid != "") or (oxdateused is not NULL and oxdateused != 0))'; $aStatus['used'] = $oDb->getOne($sQuery); $aStatus['available'] = $aStatus['total'] - $aStatus['used']; return $aStatus; }
[ "public", "function", "countVouchers", "(", ")", "{", "$", "aStatus", "=", "[", "]", ";", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "sQuery", "=", "'select count(*) as t...
Returns array of vouchers counts. @return array
[ "Returns", "array", "of", "vouchers", "counts", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/VoucherSerie.php#L128-L142
train
OXID-eSales/oxideshop_ce
source/Application/Model/Vendor.php
Vendor._setRootObjectData
protected function _setRootObjectData() { $this->setId('root'); $this->oxvendor__oxicon = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW); $this->oxvendor__oxtitle = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('BY_VENDOR', $this->getLanguage(), false), \OxidEsales\Eshop\Core\Field::T_RAW); $this->oxvendor__oxshortdesc = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW); return true; }
php
protected function _setRootObjectData() { $this->setId('root'); $this->oxvendor__oxicon = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW); $this->oxvendor__oxtitle = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('BY_VENDOR', $this->getLanguage(), false), \OxidEsales\Eshop\Core\Field::T_RAW); $this->oxvendor__oxshortdesc = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW); return true; }
[ "protected", "function", "_setRootObjectData", "(", ")", "{", "$", "this", "->", "setId", "(", "'root'", ")", ";", "$", "this", "->", "oxvendor__oxicon", "=", "new", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Field", "(", "''", ",", "\\", ...
Sets root vendor data. Returns true @return bool
[ "Sets", "root", "vendor", "data", ".", "Returns", "true" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Vendor.php#L126-L134
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountPasswordController.php
AccountPasswordController.changePassword
public function changePassword() { if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) { return; } $oUser = $this->getUser(); if (!$oUser) { return; } $sOldPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_old', true); $sNewPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new', true); $sConfPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new_confirm', true); /** @var \OxidEsales\Eshop\Core\InputValidator $oInputValidator */ $oInputValidator = \OxidEsales\Eshop\Core\Registry::getInputValidator(); if (($oExcp = $oInputValidator->checkPassword($oUser, $sNewPass, $sConfPass, true))) { switch ($oExcp->getMessage()) { case 'ERROR_MESSAGE_INPUT_EMPTYPASS': case 'ERROR_MESSAGE_PASSWORD_TOO_SHORT': return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay( 'ERROR_MESSAGE_PASSWORD_TOO_SHORT', false, true ); default: return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay( 'ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH', false, true ); } } if (!$sOldPass || !$oUser->isSamePassword($sOldPass)) { /** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */ $oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView(); return $oUtilsView->addErrorToDisplay('ERROR_MESSAGE_CURRENT_PASSWORD_INVALID', false, true); } // testing passed - changing password $oUser->setPassword($sNewPass); if ($oUser->save()) { $this->_blPasswordChanged = true; // deleting user autologin cookies. \OxidEsales\Eshop\Core\Registry::getUtilsServer()->deleteUserCookie(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId()); } }
php
public function changePassword() { if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) { return; } $oUser = $this->getUser(); if (!$oUser) { return; } $sOldPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_old', true); $sNewPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new', true); $sConfPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new_confirm', true); /** @var \OxidEsales\Eshop\Core\InputValidator $oInputValidator */ $oInputValidator = \OxidEsales\Eshop\Core\Registry::getInputValidator(); if (($oExcp = $oInputValidator->checkPassword($oUser, $sNewPass, $sConfPass, true))) { switch ($oExcp->getMessage()) { case 'ERROR_MESSAGE_INPUT_EMPTYPASS': case 'ERROR_MESSAGE_PASSWORD_TOO_SHORT': return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay( 'ERROR_MESSAGE_PASSWORD_TOO_SHORT', false, true ); default: return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay( 'ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH', false, true ); } } if (!$sOldPass || !$oUser->isSamePassword($sOldPass)) { /** @var \OxidEsales\Eshop\Core\UtilsView $oUtilsView */ $oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView(); return $oUtilsView->addErrorToDisplay('ERROR_MESSAGE_CURRENT_PASSWORD_INVALID', false, true); } // testing passed - changing password $oUser->setPassword($sNewPass); if ($oUser->save()) { $this->_blPasswordChanged = true; // deleting user autologin cookies. \OxidEsales\Eshop\Core\Registry::getUtilsServer()->deleteUserCookie(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId()); } }
[ "public", "function", "changePassword", "(", ")", "{", "if", "(", "!", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getSession", "(", ")", "->", "checkSessionChallenge", "(", ")", ")", "{", "return", ";", "}", "$", "oUser", ...
changes current user password @return null
[ "changes", "current", "user", "password" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountPasswordController.php#L61-L110
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderVendor.php
SeoEncoderVendor.getVendorPageUrl
public function getVendorPageUrl($vendor, $pageNumber, $languageId = null, $isFixed = null) { if (!isset($languageId)) { $languageId = $vendor->getLanguage(); } $stdUrl = $vendor->getBaseStdLink($languageId); $parameters = null; $stdUrl = $this->_trimUrl($stdUrl, $languageId); $seoUrl = $this->getVendorUri($vendor, $languageId); if ($isFixed === null) { $isFixed = $this->_isFixed('oxvendor', $vendor->getId(), $languageId); } return $this->assembleFullPageUrl($vendor, 'oxvendor', $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed); }
php
public function getVendorPageUrl($vendor, $pageNumber, $languageId = null, $isFixed = null) { if (!isset($languageId)) { $languageId = $vendor->getLanguage(); } $stdUrl = $vendor->getBaseStdLink($languageId); $parameters = null; $stdUrl = $this->_trimUrl($stdUrl, $languageId); $seoUrl = $this->getVendorUri($vendor, $languageId); if ($isFixed === null) { $isFixed = $this->_isFixed('oxvendor', $vendor->getId(), $languageId); } return $this->assembleFullPageUrl($vendor, 'oxvendor', $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed); }
[ "public", "function", "getVendorPageUrl", "(", "$", "vendor", ",", "$", "pageNumber", ",", "$", "languageId", "=", "null", ",", "$", "isFixed", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "languageId", ")", ")", "{", "$", "languageId", ...
Returns vendor SEO url for specified page @param \OxidEsales\Eshop\Application\Model\Vendor $vendor Vendor object. @param int $pageNumber Number of the page which should be prepared. @param int $languageId Language id. @param bool $isFixed Fixed url marker (default is null). @return string
[ "Returns", "vendor", "SEO", "url", "for", "specified", "page" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderVendor.php#L86-L102
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderVendor.php
SeoEncoderVendor.getVendorUrl
public function getVendorUrl($vendor, $languageId = null) { if (!isset($languageId)) { $languageId = $vendor->getLanguage(); } return $this->_getFullUrl($this->getVendorUri($vendor, $languageId), $languageId); }
php
public function getVendorUrl($vendor, $languageId = null) { if (!isset($languageId)) { $languageId = $vendor->getLanguage(); } return $this->_getFullUrl($this->getVendorUri($vendor, $languageId), $languageId); }
[ "public", "function", "getVendorUrl", "(", "$", "vendor", ",", "$", "languageId", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "languageId", ")", ")", "{", "$", "languageId", "=", "$", "vendor", "->", "getLanguage", "(", ")", ";", "}", ...
Encodes vendor category URLs into SEO format. @param \OxidEsales\Eshop\Application\Model\Vendor $vendor Vendor object @param int $languageId Language id @return null
[ "Encodes", "vendor", "category", "URLs", "into", "SEO", "format", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderVendor.php#L112-L119
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderVendor.php
SeoEncoderVendor.onDeleteVendor
public function onDeleteVendor($vendor) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $vendorId = $vendor->getId(); $database->execute("delete from oxseo where oxobjectid = ? and oxtype = 'oxvendor'", [$vendorId]); $database->execute("delete from oxobject2seodata where oxobjectid = ?", [$vendorId]); $database->execute("delete from oxseohistory where oxobjectid = ?", [$vendorId]); }
php
public function onDeleteVendor($vendor) { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $vendorId = $vendor->getId(); $database->execute("delete from oxseo where oxobjectid = ? and oxtype = 'oxvendor'", [$vendorId]); $database->execute("delete from oxobject2seodata where oxobjectid = ?", [$vendorId]); $database->execute("delete from oxseohistory where oxobjectid = ?", [$vendorId]); }
[ "public", "function", "onDeleteVendor", "(", "$", "vendor", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "vendorId", "=", "$", "vendor", "->", "getId", "(", ...
Deletes Vendor seo entry @param \OxidEsales\Eshop\Application\Model\Vendor $vendor Vendor object
[ "Deletes", "Vendor", "seo", "entry" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderVendor.php#L126-L133
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderVendor.php
SeoEncoderVendor._getAltUri
protected function _getAltUri($vendorId, $languageId) { $seoUrl = null; $vendor = oxNew(\OxidEsales\Eshop\Application\Model\Vendor::class); if ($vendor->loadInLang($languageId, $vendorId)) { $seoUrl = $this->getVendorUri($vendor, $languageId, true); } return $seoUrl; }
php
protected function _getAltUri($vendorId, $languageId) { $seoUrl = null; $vendor = oxNew(\OxidEsales\Eshop\Application\Model\Vendor::class); if ($vendor->loadInLang($languageId, $vendorId)) { $seoUrl = $this->getVendorUri($vendor, $languageId, true); } return $seoUrl; }
[ "protected", "function", "_getAltUri", "(", "$", "vendorId", ",", "$", "languageId", ")", "{", "$", "seoUrl", "=", "null", ";", "$", "vendor", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "Vendor", "::",...
Returns alternative uri used while updating seo. @param string $vendorId Vendor id @param int $languageId Language id @return string
[ "Returns", "alternative", "uri", "used", "while", "updating", "seo", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderVendor.php#L143-L152
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/DeliverySetMainAjax.php
DeliverySetMainAjax.addToSet
public function addToSet() { $aChosenSets = $this->_getActionIds('oxdelivery.oxid'); $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid'); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $sDeliveryViewName = $this->_getViewName('oxdelivery'); $aChosenSets = $this->_getAll($this->_addFilter("select $sDeliveryViewName.oxid " . $this->_getQuery())); } if ($soxId && $soxId != "-1" && is_array($aChosenSets)) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); foreach ($aChosenSets as $sChosenSet) { // check if we have this entry already in // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $sID = $database->getOne("select oxid from oxdel2delset where oxdelid = " . $database->quote($sChosenSet) . " and oxdelsetid = " . $database->quote($soxId)); if (!isset($sID) || !$sID) { $oDel2delset = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $oDel2delset->init('oxdel2delset'); $oDel2delset->oxdel2delset__oxdelid = new \OxidEsales\Eshop\Core\Field($sChosenSet); $oDel2delset->oxdel2delset__oxdelsetid = new \OxidEsales\Eshop\Core\Field($soxId); $oDel2delset->save(); } } } }
php
public function addToSet() { $aChosenSets = $this->_getActionIds('oxdelivery.oxid'); $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid'); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $sDeliveryViewName = $this->_getViewName('oxdelivery'); $aChosenSets = $this->_getAll($this->_addFilter("select $sDeliveryViewName.oxid " . $this->_getQuery())); } if ($soxId && $soxId != "-1" && is_array($aChosenSets)) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); foreach ($aChosenSets as $sChosenSet) { // check if we have this entry already in // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $sID = $database->getOne("select oxid from oxdel2delset where oxdelid = " . $database->quote($sChosenSet) . " and oxdelsetid = " . $database->quote($soxId)); if (!isset($sID) || !$sID) { $oDel2delset = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $oDel2delset->init('oxdel2delset'); $oDel2delset->oxdel2delset__oxdelid = new \OxidEsales\Eshop\Core\Field($sChosenSet); $oDel2delset->oxdel2delset__oxdelsetid = new \OxidEsales\Eshop\Core\Field($soxId); $oDel2delset->save(); } } } }
[ "public", "function", "addToSet", "(", ")", "{", "$", "aChosenSets", "=", "$", "this", "->", "_getActionIds", "(", "'oxdelivery.oxid'", ")", ";", "$", "soxId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ...
Adds this delivery cost to these sets @throws Exception
[ "Adds", "this", "delivery", "cost", "to", "these", "sets" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DeliverySetMainAjax.php#L87-L113
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getReviewAndRatingItemsCount
public function getReviewAndRatingItemsCount() { $user = $this->getUser(); $count = 0; if ($user) { $count = $this ->getContainer() ->get(UserReviewAndRatingBridgeInterface::class) ->getReviewAndRatingListCount($user->getId()); } return $count; }
php
public function getReviewAndRatingItemsCount() { $user = $this->getUser(); $count = 0; if ($user) { $count = $this ->getContainer() ->get(UserReviewAndRatingBridgeInterface::class) ->getReviewAndRatingListCount($user->getId()); } return $count; }
[ "public", "function", "getReviewAndRatingItemsCount", "(", ")", "{", "$", "user", "=", "$", "this", "->", "getUser", "(", ")", ";", "$", "count", "=", "0", ";", "if", "(", "$", "user", ")", "{", "$", "count", "=", "$", "this", "->", "getContainer", ...
Get the total number of reviews for the active user. @return integer Number of reviews
[ "Get", "the", "total", "number", "of", "reviews", "for", "the", "active", "user", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L434-L446
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController._getComponentNames
protected function _getComponentNames() { if (self::$_aCollectedComponentNames === null) { self::$_aCollectedComponentNames = array_merge($this->_aComponentNames, $this->_aUserComponentNames); if (($userComponentNames = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aUserComponentNames'))) { self::$_aCollectedComponentNames = array_merge(self::$_aCollectedComponentNames, $userComponentNames); } if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('_force_no_basket_cmp')) { unset(self::$_aCollectedComponentNames['oxcmp_basket']); } } // resetting array pointer reset(self::$_aCollectedComponentNames); return self::$_aCollectedComponentNames; }
php
protected function _getComponentNames() { if (self::$_aCollectedComponentNames === null) { self::$_aCollectedComponentNames = array_merge($this->_aComponentNames, $this->_aUserComponentNames); if (($userComponentNames = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aUserComponentNames'))) { self::$_aCollectedComponentNames = array_merge(self::$_aCollectedComponentNames, $userComponentNames); } if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('_force_no_basket_cmp')) { unset(self::$_aCollectedComponentNames['oxcmp_basket']); } } // resetting array pointer reset(self::$_aCollectedComponentNames); return self::$_aCollectedComponentNames; }
[ "protected", "function", "_getComponentNames", "(", ")", "{", "if", "(", "self", "::", "$", "_aCollectedComponentNames", "===", "null", ")", "{", "self", "::", "$", "_aCollectedComponentNames", "=", "array_merge", "(", "$", "this", "->", "_aComponentNames", ",",...
Returns component names. At the moment it is not possible to override $_aCollectedComponentNames in oxUBase, so aUserComponentNames was added to config.inc.php file. @return array
[ "Returns", "component", "names", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L456-L474
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController._processRequest
protected function _processRequest() { $utils = \OxidEsales\Eshop\Core\Registry::getUtils(); // non admin, request is not empty and was not processed by seo engine if (!isSearchEngineUrl() && $utils->seoIsActive() && ($requestUrl = getRequestUrl())) { // fetching standard url and looking for it in seo table if ($this->_canRedirect() && ($redirectUrl = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->fetchSeoUrl($requestUrl))) { $utils->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getCurrentShopUrl() . $redirectUrl, false, 301); } elseif (VIEW_INDEXSTATE_INDEX == $this->noIndex()) { // forcing to set no index/follow meta $this->_forceNoIndex(); if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blSeoLogging')) { $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); $id = md5(strtolower($requestUrl) . $shopId . $languageId); // logging "not found" url $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $database->execute( "replace oxseologs ( oxstdurl, oxident, oxshopid, oxlang ) values ( ?, ?, ?, ? ) ", [$requestUrl, $id, $shopId, $languageId] ); } } } }
php
protected function _processRequest() { $utils = \OxidEsales\Eshop\Core\Registry::getUtils(); // non admin, request is not empty and was not processed by seo engine if (!isSearchEngineUrl() && $utils->seoIsActive() && ($requestUrl = getRequestUrl())) { // fetching standard url and looking for it in seo table if ($this->_canRedirect() && ($redirectUrl = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->fetchSeoUrl($requestUrl))) { $utils->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getCurrentShopUrl() . $redirectUrl, false, 301); } elseif (VIEW_INDEXSTATE_INDEX == $this->noIndex()) { // forcing to set no index/follow meta $this->_forceNoIndex(); if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blSeoLogging')) { $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(); $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); $id = md5(strtolower($requestUrl) . $shopId . $languageId); // logging "not found" url $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $database->execute( "replace oxseologs ( oxstdurl, oxident, oxshopid, oxlang ) values ( ?, ?, ?, ? ) ", [$requestUrl, $id, $shopId, $languageId] ); } } } }
[ "protected", "function", "_processRequest", "(", ")", "{", "$", "utils", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getUtils", "(", ")", ";", "// non admin, request is not empty and was not processed by seo engine", "if", "(", "!"...
In non admin mode checks if request was NOT processed by seo handler. If NOT, then tries to load alternative SEO url and if url is available - redirects to it. If no alternative path was found - 404 header is emitted and page is rendered
[ "In", "non", "admin", "mode", "checks", "if", "request", "was", "NOT", "processed", "by", "seo", "handler", ".", "If", "NOT", "then", "tries", "to", "load", "alternative", "SEO", "url", "and", "if", "url", "is", "available", "-", "redirects", "to", "it",...
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L482-L509
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getViewId
public function getViewId() { if (isset($this->_sViewId)) { return $this->_sViewId; } return $this->_sViewId = $this->generateViewId(); }
php
public function getViewId() { if (isset($this->_sViewId)) { return $this->_sViewId; } return $this->_sViewId = $this->generateViewId(); }
[ "public", "function", "getViewId", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_sViewId", ")", ")", "{", "return", "$", "this", "->", "_sViewId", ";", "}", "return", "$", "this", "->", "_sViewId", "=", "$", "this", "->", "generateView...
If current view ID is not set - forms and returns view ID according to language and currency. @return string $this->_sViewId
[ "If", "current", "view", "ID", "is", "not", "set", "-", "forms", "and", "returns", "view", "ID", "according", "to", "language", "and", "currency", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L565-L572
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.generateViewId
protected function generateViewId() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $viewId = $this->generateViewIdBase(); $viewId .= "|" . ((int) $this->_blForceNoIndex) . '|' . ((int) $this->isRootCatChanged()); // #0004798: SSL should be included in viewId if ($config->isSsl()) { $viewId .= "|ssl"; } // #0002866: external global viewID addition if (function_exists('customGetViewId')) { $externalViewId = customGetViewId(); if ($externalViewId !== null) { $viewId .= '|' . md5(serialize($externalViewId)); } } return $viewId; }
php
protected function generateViewId() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $viewId = $this->generateViewIdBase(); $viewId .= "|" . ((int) $this->_blForceNoIndex) . '|' . ((int) $this->isRootCatChanged()); // #0004798: SSL should be included in viewId if ($config->isSsl()) { $viewId .= "|ssl"; } // #0002866: external global viewID addition if (function_exists('customGetViewId')) { $externalViewId = customGetViewId(); if ($externalViewId !== null) { $viewId .= '|' . md5(serialize($externalViewId)); } } return $viewId; }
[ "protected", "function", "generateViewId", "(", ")", "{", "$", "config", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "viewId", "=", "$", "this", "->", "generateViewIdBase", "(", ")", ";",...
Generates current view id. @return string
[ "Generates", "current", "view", "id", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L579-L601
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.generateViewIdBase
protected function generateViewIdBase() { $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); $currencyId = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getShopCurrency(); return "ox|$languageId|$currencyId"; }
php
protected function generateViewIdBase() { $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); $currencyId = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getShopCurrency(); return "ox|$languageId|$currencyId"; }
[ "protected", "function", "generateViewIdBase", "(", ")", "{", "$", "languageId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", "->", "getBaseLanguage", "(", ")", ";", "$", "currencyId", "=", "(", "int", ...
Generates base for view id. @return string
[ "Generates", "base", "for", "view", "id", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L608-L614
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getComponent
public function getComponent($name) { if (isset($name) && isset($this->_oaComponents[$name])) { return $this->_oaComponents[$name]; } }
php
public function getComponent($name) { if (isset($name) && isset($this->_oaComponents[$name])) { return $this->_oaComponents[$name]; } }
[ "public", "function", "getComponent", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "name", ")", "&&", "isset", "(", "$", "this", "->", "_oaComponents", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "_oaComponents", ...
Get component object @param string $name name of component object @return object
[ "Get", "component", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L653-L658
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getListType
public function getListType() { if ($this->_sListType == null) { if ($listType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('listtype')) { $this->_sListType = $listType; } elseif ($listType = \OxidEsales\Eshop\Core\Registry::getConfig()->getGlobalParameter('listtype')) { $this->_sListType = $listType; } } return $this->_sListType; }
php
public function getListType() { if ($this->_sListType == null) { if ($listType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('listtype')) { $this->_sListType = $listType; } elseif ($listType = \OxidEsales\Eshop\Core\Registry::getConfig()->getGlobalParameter('listtype')) { $this->_sListType = $listType; } } return $this->_sListType; }
[ "public", "function", "getListType", "(", ")", "{", "if", "(", "$", "this", "->", "_sListType", "==", "null", ")", "{", "if", "(", "$", "listType", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "...
Get list type @return string list type
[ "Get", "list", "type" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L706-L717
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getListDisplayType
public function getListDisplayType() { if ($this->_sListDisplayType == null) { $this->_sListDisplayType = $this->getCustomListDisplayType(); if (!$this->_sListDisplayType) { $this->_sListDisplayType = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sDefaultListDisplayType'); } $this->_sListDisplayType = in_array(( string ) $this->_sListDisplayType, $this->_aListDisplayTypes) ? $this->_sListDisplayType : 'infogrid'; // writing to session if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('ldtype')) { \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('ldtype', $this->_sListDisplayType); } } return $this->_sListDisplayType; }
php
public function getListDisplayType() { if ($this->_sListDisplayType == null) { $this->_sListDisplayType = $this->getCustomListDisplayType(); if (!$this->_sListDisplayType) { $this->_sListDisplayType = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sDefaultListDisplayType'); } $this->_sListDisplayType = in_array(( string ) $this->_sListDisplayType, $this->_aListDisplayTypes) ? $this->_sListDisplayType : 'infogrid'; // writing to session if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('ldtype')) { \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('ldtype', $this->_sListDisplayType); } } return $this->_sListDisplayType; }
[ "public", "function", "getListDisplayType", "(", ")", "{", "if", "(", "$", "this", "->", "_sListDisplayType", "==", "null", ")", "{", "$", "this", "->", "_sListDisplayType", "=", "$", "this", "->", "getCustomListDisplayType", "(", ")", ";", "if", "(", "!",...
Returns list type @return string
[ "Returns", "list", "type" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L724-L743
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getCustomListDisplayType
public function getCustomListDisplayType() { if ($this->_sCustomListDisplayType == null) { $this->_sCustomListDisplayType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('ldtype'); if (!$this->_sCustomListDisplayType) { $this->_sCustomListDisplayType = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('ldtype'); } } return $this->_sCustomListDisplayType; }
php
public function getCustomListDisplayType() { if ($this->_sCustomListDisplayType == null) { $this->_sCustomListDisplayType = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('ldtype'); if (!$this->_sCustomListDisplayType) { $this->_sCustomListDisplayType = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('ldtype'); } } return $this->_sCustomListDisplayType; }
[ "public", "function", "getCustomListDisplayType", "(", ")", "{", "if", "(", "$", "this", "->", "_sCustomListDisplayType", "==", "null", ")", "{", "$", "this", "->", "_sCustomListDisplayType", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registr...
Returns changed default list type @return string
[ "Returns", "changed", "default", "list", "type" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L750-L761
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.setListType
public function setListType($type) { $this->_sListType = $type; \OxidEsales\Eshop\Core\Registry::getConfig()->setGlobalParameter('listtype', $type); }
php
public function setListType($type) { $this->_sListType = $type; \OxidEsales\Eshop\Core\Registry::getConfig()->setGlobalParameter('listtype', $type); }
[ "public", "function", "setListType", "(", "$", "type", ")", "{", "$", "this", "->", "_sListType", "=", "$", "type", ";", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "setGlobalParameter", "(", "'li...
List type setter @param string $type type of list
[ "List", "type", "setter" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L768-L772
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.loadCurrency
public function loadCurrency() { if ($this->_blLoadCurrency == null) { $this->_blLoadCurrency = false; if ($loadCurrency = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadCurrency')) { $this->_blLoadCurrency = $loadCurrency; } } return $this->_blLoadCurrency; }
php
public function loadCurrency() { if ($this->_blLoadCurrency == null) { $this->_blLoadCurrency = false; if ($loadCurrency = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadCurrency')) { $this->_blLoadCurrency = $loadCurrency; } } return $this->_blLoadCurrency; }
[ "public", "function", "loadCurrency", "(", ")", "{", "if", "(", "$", "this", "->", "_blLoadCurrency", "==", "null", ")", "{", "$", "this", "->", "_blLoadCurrency", "=", "false", ";", "if", "(", "$", "loadCurrency", "=", "\\", "OxidEsales", "\\", "Eshop",...
Returns currency switching option @return bool
[ "Returns", "currency", "switching", "option" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L779-L789
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.dontShowEmptyCategories
public function dontShowEmptyCategories() { if ($this->_blDontShowEmptyCats == null) { $this->_blDontShowEmptyCats = false; if ($dontShowEmptyCats = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blDontShowEmptyCategories')) { $this->_blDontShowEmptyCats = $dontShowEmptyCats; } } return $this->_blDontShowEmptyCats; }
php
public function dontShowEmptyCategories() { if ($this->_blDontShowEmptyCats == null) { $this->_blDontShowEmptyCats = false; if ($dontShowEmptyCats = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blDontShowEmptyCategories')) { $this->_blDontShowEmptyCats = $dontShowEmptyCats; } } return $this->_blDontShowEmptyCats; }
[ "public", "function", "dontShowEmptyCategories", "(", ")", "{", "if", "(", "$", "this", "->", "_blDontShowEmptyCats", "==", "null", ")", "{", "$", "this", "->", "_blDontShowEmptyCats", "=", "false", ";", "if", "(", "$", "dontShowEmptyCats", "=", "\\", "OxidE...
Returns true if empty categories are not loaded @return bool
[ "Returns", "true", "if", "empty", "categories", "are", "not", "loaded" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L796-L806
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.isLanguageLoaded
public function isLanguageLoaded() { if ($this->_blLoadLanguage == null) { $this->_blLoadLanguage = false; if ($loadLanguage = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadLanguages')) { $this->_blLoadLanguage = $loadLanguage; } } return $this->_blLoadLanguage; }
php
public function isLanguageLoaded() { if ($this->_blLoadLanguage == null) { $this->_blLoadLanguage = false; if ($loadLanguage = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadLanguages')) { $this->_blLoadLanguage = $loadLanguage; } } return $this->_blLoadLanguage; }
[ "public", "function", "isLanguageLoaded", "(", ")", "{", "if", "(", "$", "this", "->", "_blLoadLanguage", "==", "null", ")", "{", "$", "this", "->", "_blLoadLanguage", "=", "false", ";", "if", "(", "$", "loadLanguage", "=", "\\", "OxidEsales", "\\", "Esh...
Returns if language should be loaded @return bool
[ "Returns", "if", "language", "should", "be", "loaded" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L823-L833
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getTopNavigationCatCnt
public function getTopNavigationCatCnt() { if ($this->_iTopCatNavItmCnt == null) { $topCategoryNavigationItemsCount = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iTopNaviCatCount'); $this->_iTopCatNavItmCnt = $topCategoryNavigationItemsCount ? $topCategoryNavigationItemsCount : 5; } return $this->_iTopCatNavItmCnt; }
php
public function getTopNavigationCatCnt() { if ($this->_iTopCatNavItmCnt == null) { $topCategoryNavigationItemsCount = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iTopNaviCatCount'); $this->_iTopCatNavItmCnt = $topCategoryNavigationItemsCount ? $topCategoryNavigationItemsCount : 5; } return $this->_iTopCatNavItmCnt; }
[ "public", "function", "getTopNavigationCatCnt", "(", ")", "{", "if", "(", "$", "this", "->", "_iTopCatNavItmCnt", "==", "null", ")", "{", "$", "topCategoryNavigationItemsCount", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "get...
Returns item count in top navigation of categories @return integer
[ "Returns", "item", "count", "in", "top", "navigation", "of", "categories" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L840-L848
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.addRssFeed
public function addRssFeed($title, $url, $key = null) { if (!is_array($this->_aRssLinks)) { $this->_aRssLinks = []; } $url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->prepareUrlForNoSession($url); if ($key === null) { $this->_aRssLinks[] = ['title' => $title, 'link' => $url]; } else { $this->_aRssLinks[$key] = ['title' => $title, 'link' => $url]; } }
php
public function addRssFeed($title, $url, $key = null) { if (!is_array($this->_aRssLinks)) { $this->_aRssLinks = []; } $url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->prepareUrlForNoSession($url); if ($key === null) { $this->_aRssLinks[] = ['title' => $title, 'link' => $url]; } else { $this->_aRssLinks[$key] = ['title' => $title, 'link' => $url]; } }
[ "public", "function", "addRssFeed", "(", "$", "title", ",", "$", "url", ",", "$", "key", "=", "null", ")", "{", "if", "(", "!", "is_array", "(", "$", "this", "->", "_aRssLinks", ")", ")", "{", "$", "this", "->", "_aRssLinks", "=", "[", "]", ";", ...
addRssFeed adds link to rss @param string $title feed page title @param string $url feed url @param int $key feed number
[ "addRssFeed", "adds", "link", "to", "rss" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L857-L870
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getSavedSorting
public function getSavedSorting($sortIdent) { $sorting = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aSorting'); if (isset($sorting[$sortIdent])) { return $sorting[$sortIdent]; } }
php
public function getSavedSorting($sortIdent) { $sorting = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aSorting'); if (isset($sorting[$sortIdent])) { return $sorting[$sortIdent]; } }
[ "public", "function", "getSavedSorting", "(", "$", "sortIdent", ")", "{", "$", "sorting", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getSession", "(", ")", "->", "getVariable", "(", "'aSorting'", ")", ";", "if", "(", "...
Returns sorting variable from session @param string $sortIdent sorting indent @return array
[ "Returns", "sorting", "variable", "from", "session" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L943-L949
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getListOrderBy
public function getListOrderBy() { //if column is with table name split it $columns = explode('.', $this->_sListOrderBy); if (is_array($columns) && count($columns) > 1) { return $columns[1]; } return $this->_sListOrderBy; }
php
public function getListOrderBy() { //if column is with table name split it $columns = explode('.', $this->_sListOrderBy); if (is_array($columns) && count($columns) > 1) { return $columns[1]; } return $this->_sListOrderBy; }
[ "public", "function", "getListOrderBy", "(", ")", "{", "//if column is with table name split it", "$", "columns", "=", "explode", "(", "'.'", ",", "$", "this", "->", "_sListOrderBy", ")", ";", "if", "(", "is_array", "(", "$", "columns", ")", "&&", "count", "...
Template variable getter. Returns string after the list is ordered by @return array
[ "Template", "variable", "getter", ".", "Returns", "string", "after", "the", "list", "is", "ordered", "by" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L976-L986
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getMetaKeywords
public function getMetaKeywords() { if ($this->_sMetaKeywords === null) { $this->_sMetaKeywords = false; // set special meta keywords ? if (($keywords = $this->_getMetaFromSeo('oxkeywords'))) { $this->_sMetaKeywords = $keywords; } elseif (($keywords = $this->_getMetaFromContent($this->_sMetaKeywordsIdent))) { $this->_sMetaKeywords = $this->_prepareMetaKeyword($keywords, false); } else { $this->_sMetaKeywords = $this->_prepareMetaKeyword(false, true); } } return $this->_sMetaKeywords; }
php
public function getMetaKeywords() { if ($this->_sMetaKeywords === null) { $this->_sMetaKeywords = false; // set special meta keywords ? if (($keywords = $this->_getMetaFromSeo('oxkeywords'))) { $this->_sMetaKeywords = $keywords; } elseif (($keywords = $this->_getMetaFromContent($this->_sMetaKeywordsIdent))) { $this->_sMetaKeywords = $this->_prepareMetaKeyword($keywords, false); } else { $this->_sMetaKeywords = $this->_prepareMetaKeyword(false, true); } } return $this->_sMetaKeywords; }
[ "public", "function", "getMetaKeywords", "(", ")", "{", "if", "(", "$", "this", "->", "_sMetaKeywords", "===", "null", ")", "{", "$", "this", "->", "_sMetaKeywords", "=", "false", ";", "// set special meta keywords ?", "if", "(", "(", "$", "keywords", "=", ...
Template variable getter. Returns meta keywords @return string
[ "Template", "variable", "getter", ".", "Returns", "meta", "keywords" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1066-L1082
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getCompareItemCount
public function getCompareItemCount() { if ($this->_iCompItemsCnt === null) { $items = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aFiltcompproducts'); $this->_iCompItemsCnt = is_array($items) ? count($items) : 0; } return $this->_iCompItemsCnt; }
php
public function getCompareItemCount() { if ($this->_iCompItemsCnt === null) { $items = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aFiltcompproducts'); $this->_iCompItemsCnt = is_array($items) ? count($items) : 0; } return $this->_iCompItemsCnt; }
[ "public", "function", "getCompareItemCount", "(", ")", "{", "if", "(", "$", "this", "->", "_iCompItemsCnt", "===", "null", ")", "{", "$", "items", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getSession", "(", ")", "->",...
Template variable getter. Returns comparison article list count. @return integer
[ "Template", "variable", "getter", ".", "Returns", "comparison", "article", "list", "count", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1132-L1140
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.noIndex
public function noIndex() { if ($this->_blForceNoIndex) { $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW; } elseif (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cur')) { $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW; } elseif (0 < \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('pgNr')) { $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW; } else { switch (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('fnc')) { case 'tocomparelist': case 'tobasket': $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW; break; } } return $this->_iViewIndexState; }
php
public function noIndex() { if ($this->_blForceNoIndex) { $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW; } elseif (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cur')) { $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW; } elseif (0 < \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Core\Request::class)->getRequestParameter('pgNr')) { $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW; } else { switch (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('fnc')) { case 'tocomparelist': case 'tobasket': $this->_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW; break; } } return $this->_iViewIndexState; }
[ "public", "function", "noIndex", "(", ")", "{", "if", "(", "$", "this", "->", "_blForceNoIndex", ")", "{", "$", "this", "->", "_iViewIndexState", "=", "VIEW_INDEXSTATE_NOINDEXFOLLOW", ";", "}", "elseif", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", ...
Marks that current view is marked as no index, no follow and article details links must contain no follow tags @return int
[ "Marks", "that", "current", "view", "is", "marked", "as", "no", "index", "no", "follow", "and", "article", "details", "links", "must", "contain", "no", "follow", "tags" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1156-L1174
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController._setNrOfArtPerPage
protected function _setNrOfArtPerPage() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); //setting default values to avoid possible errors showing article list $numberOfCategoryArticles = $config->getConfigParam('iNrofCatArticles'); $numberOfCategoryArticles = ($numberOfCategoryArticles) ? $numberOfCategoryArticles : 10; // checking if all needed data is set switch ($this->getListDisplayType()) { case 'grid': $numbersOfCategoryArticles = $config->getConfigParam('aNrofCatArticlesInGrid'); break; case 'line': case 'infogrid': default: $numbersOfCategoryArticles = $config->getConfigParam('aNrofCatArticles'); } if (!is_array($numbersOfCategoryArticles) || !isset($numbersOfCategoryArticles[0])) { $numbersOfCategoryArticles = [$numberOfCategoryArticles]; $config->setConfigParam('aNrofCatArticles', $numbersOfCategoryArticles); } else { $numberOfCategoryArticles = $numbersOfCategoryArticles[0]; } $viewConfig = $this->getViewConfig(); //value from user input $session = \OxidEsales\Eshop\Core\Registry::getSession(); if (($articlesPerPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('_artperpage'))) { // M45 Possibility to push any "Show articles per page" number parameter $numberOfCategoryArticles = (in_array($articlesPerPage, $numbersOfCategoryArticles)) ? $articlesPerPage : $numberOfCategoryArticles; $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles); $session->setVariable('_artperpage', $numberOfCategoryArticles); } elseif (($sessArtPerPage = $session->getVariable('_artperpage')) && is_numeric($sessArtPerPage)) { // M45 Possibility to push any "Show articles per page" number parameter $numberOfCategoryArticles = (in_array($sessArtPerPage, $numbersOfCategoryArticles)) ? $sessArtPerPage : $numberOfCategoryArticles; $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles); $session->setVariable('_artperpage', $numberOfCategoryArticles); } else { $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles); } //setting number of articles per page to config value $config->setConfigParam('iNrofCatArticles', $numberOfCategoryArticles); }
php
protected function _setNrOfArtPerPage() { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); //setting default values to avoid possible errors showing article list $numberOfCategoryArticles = $config->getConfigParam('iNrofCatArticles'); $numberOfCategoryArticles = ($numberOfCategoryArticles) ? $numberOfCategoryArticles : 10; // checking if all needed data is set switch ($this->getListDisplayType()) { case 'grid': $numbersOfCategoryArticles = $config->getConfigParam('aNrofCatArticlesInGrid'); break; case 'line': case 'infogrid': default: $numbersOfCategoryArticles = $config->getConfigParam('aNrofCatArticles'); } if (!is_array($numbersOfCategoryArticles) || !isset($numbersOfCategoryArticles[0])) { $numbersOfCategoryArticles = [$numberOfCategoryArticles]; $config->setConfigParam('aNrofCatArticles', $numbersOfCategoryArticles); } else { $numberOfCategoryArticles = $numbersOfCategoryArticles[0]; } $viewConfig = $this->getViewConfig(); //value from user input $session = \OxidEsales\Eshop\Core\Registry::getSession(); if (($articlesPerPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('_artperpage'))) { // M45 Possibility to push any "Show articles per page" number parameter $numberOfCategoryArticles = (in_array($articlesPerPage, $numbersOfCategoryArticles)) ? $articlesPerPage : $numberOfCategoryArticles; $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles); $session->setVariable('_artperpage', $numberOfCategoryArticles); } elseif (($sessArtPerPage = $session->getVariable('_artperpage')) && is_numeric($sessArtPerPage)) { // M45 Possibility to push any "Show articles per page" number parameter $numberOfCategoryArticles = (in_array($sessArtPerPage, $numbersOfCategoryArticles)) ? $sessArtPerPage : $numberOfCategoryArticles; $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles); $session->setVariable('_artperpage', $numberOfCategoryArticles); } else { $viewConfig->setViewConfigParam('iartPerPage', $numberOfCategoryArticles); } //setting number of articles per page to config value $config->setConfigParam('iNrofCatArticles', $numberOfCategoryArticles); }
[ "protected", "function", "_setNrOfArtPerPage", "(", ")", "{", "$", "config", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "//setting default values to avoid possible errors showing article list", "$", "numbe...
Sets number of articles per page to config value
[ "Sets", "number", "of", "articles", "per", "page", "to", "config", "value" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1199-L1245
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController._prepareMetaDescription
protected function _prepareMetaDescription($meta, $length = 1024, $removeDuplicatedWords = false) { if ($meta) { $stringModifier = getStr(); if ($length != -1) { /* * * performance - we do not need a huge amount of initial text. * assume that effective text may be double longer than $length * and simple truncate it */ $doubleLength = ($length * 2); $meta = $stringModifier->substr($meta, 0, $doubleLength); } // decoding html entities $meta = $stringModifier->html_entity_decode($meta); // stripping HTML tags $meta = $stringModifier->strip_tags($meta); // removing some special chars $meta = $stringModifier->cleanStr($meta); // removing duplicate words if ($removeDuplicatedWords) { $meta = $this->_removeDuplicatedWords($meta, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSkipTags')); } // some special cases $meta = str_replace(' ,', ',', $meta); $pattern = ["/,[\s\+\-\*]*,/", "/\s+,/"]; $meta = $stringModifier->preg_replace($pattern, ',', $meta); $meta = \OxidEsales\Eshop\Core\Registry::getUtilsString()->minimizeTruncateString($meta, $length); $meta = $stringModifier->htmlspecialchars($meta); return trim($meta); } }
php
protected function _prepareMetaDescription($meta, $length = 1024, $removeDuplicatedWords = false) { if ($meta) { $stringModifier = getStr(); if ($length != -1) { /* * * performance - we do not need a huge amount of initial text. * assume that effective text may be double longer than $length * and simple truncate it */ $doubleLength = ($length * 2); $meta = $stringModifier->substr($meta, 0, $doubleLength); } // decoding html entities $meta = $stringModifier->html_entity_decode($meta); // stripping HTML tags $meta = $stringModifier->strip_tags($meta); // removing some special chars $meta = $stringModifier->cleanStr($meta); // removing duplicate words if ($removeDuplicatedWords) { $meta = $this->_removeDuplicatedWords($meta, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSkipTags')); } // some special cases $meta = str_replace(' ,', ',', $meta); $pattern = ["/,[\s\+\-\*]*,/", "/\s+,/"]; $meta = $stringModifier->preg_replace($pattern, ',', $meta); $meta = \OxidEsales\Eshop\Core\Registry::getUtilsString()->minimizeTruncateString($meta, $length); $meta = $stringModifier->htmlspecialchars($meta); return trim($meta); } }
[ "protected", "function", "_prepareMetaDescription", "(", "$", "meta", ",", "$", "length", "=", "1024", ",", "$", "removeDuplicatedWords", "=", "false", ")", "{", "if", "(", "$", "meta", ")", "{", "$", "stringModifier", "=", "getStr", "(", ")", ";", "if",...
Returns current view meta description data @param string $meta Category path @param int $length Max length of result, -1 for no truncation @param bool $removeDuplicatedWords If true - performs additional duplicate cleaning @return string $string converted string
[ "Returns", "current", "view", "meta", "description", "data" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1263-L1299
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.setItemSorting
public function setItemSorting($sortIdent, $sortBy, $sortDir = null) { $sorting = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aSorting'); $sorting[$sortIdent]['sortby'] = $sortBy; $sorting[$sortIdent]['sortdir'] = $sortDir ? $sortDir : null; \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('aSorting', $sorting); }
php
public function setItemSorting($sortIdent, $sortBy, $sortDir = null) { $sorting = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('aSorting'); $sorting[$sortIdent]['sortby'] = $sortBy; $sorting[$sortIdent]['sortdir'] = $sortDir ? $sortDir : null; \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('aSorting', $sorting); }
[ "public", "function", "setItemSorting", "(", "$", "sortIdent", ",", "$", "sortBy", ",", "$", "sortDir", "=", "null", ")", "{", "$", "sorting", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getSession", "(", ")", "->", "...
Sets sorting item config @param string $sortIdent sortable item id @param string $sortBy sort field @param string $sortDir sort direction (optional)
[ "Sets", "sorting", "item", "config" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1400-L1407
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getSorting
public function getSorting($sortIdent) { $sorting = null; if ($sorting = $this->getUserSelectedSorting()) { $this->setItemSorting($sortIdent, $sorting['sortby'], $sorting['sortdir']); } elseif (!$sorting = $this->getSavedSorting($sortIdent)) { $sorting = $this->getDefaultSorting(); } if ($sorting) { $this->setListOrderBy($sorting['sortby']); $this->setListOrderDirection($sorting['sortdir']); } return $sorting; }
php
public function getSorting($sortIdent) { $sorting = null; if ($sorting = $this->getUserSelectedSorting()) { $this->setItemSorting($sortIdent, $sorting['sortby'], $sorting['sortdir']); } elseif (!$sorting = $this->getSavedSorting($sortIdent)) { $sorting = $this->getDefaultSorting(); } if ($sorting) { $this->setListOrderBy($sorting['sortby']); $this->setListOrderDirection($sorting['sortdir']); } return $sorting; }
[ "public", "function", "getSorting", "(", "$", "sortIdent", ")", "{", "$", "sorting", "=", "null", ";", "if", "(", "$", "sorting", "=", "$", "this", "->", "getUserSelectedSorting", "(", ")", ")", "{", "$", "this", "->", "setItemSorting", "(", "$", "sort...
Returns sorting config for current item @param string $sortIdent sortable item id @return array
[ "Returns", "sorting", "config", "for", "current", "item" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1416-L1432
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getSortingSql
public function getSortingSql($ident) { $sorting = $this->getSorting($ident); if (is_array($sorting)) { $sortBy = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteIdentifier($sorting['sortby']); $sortDir = isset($sorting['sortdir']) ? $sorting['sortdir'] : ''; $sortString = trim($sortBy . ' ' . $sortDir); return $sortString; } }
php
public function getSortingSql($ident) { $sorting = $this->getSorting($ident); if (is_array($sorting)) { $sortBy = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteIdentifier($sorting['sortby']); $sortDir = isset($sorting['sortdir']) ? $sorting['sortdir'] : ''; $sortString = trim($sortBy . ' ' . $sortDir); return $sortString; } }
[ "public", "function", "getSortingSql", "(", "$", "ident", ")", "{", "$", "sorting", "=", "$", "this", "->", "getSorting", "(", "$", "ident", ")", ";", "if", "(", "is_array", "(", "$", "sorting", ")", ")", "{", "$", "sortBy", "=", "\\", "OxidEsales", ...
Returns part of SQL query with sorting params @param string $ident sortable item id @return string
[ "Returns", "part", "of", "SQL", "query", "with", "sorting", "params" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1441-L1451
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getPageTitle
public function getPageTitle() { $titleParts = []; $titleParts[] = $this->getTitlePrefix(); $titleParts[] = $this->getTitle(); $titleParts[] = $this->getTitleSuffix(); $titleParts[] = $this->getTitlePageSuffix(); $titleParts = array_filter($titleParts); return implode(' | ', $titleParts); }
php
public function getPageTitle() { $titleParts = []; $titleParts[] = $this->getTitlePrefix(); $titleParts[] = $this->getTitle(); $titleParts[] = $this->getTitleSuffix(); $titleParts[] = $this->getTitlePageSuffix(); $titleParts = array_filter($titleParts); return implode(' | ', $titleParts); }
[ "public", "function", "getPageTitle", "(", ")", "{", "$", "titleParts", "=", "[", "]", ";", "$", "titleParts", "[", "]", "=", "$", "this", "->", "getTitlePrefix", "(", ")", ";", "$", "titleParts", "[", "]", "=", "$", "this", "->", "getTitle", "(", ...
Returns full page title @return string
[ "Returns", "full", "page", "title" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1486-L1497
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getBaseLink
public function getBaseLink($languageId = null) { if (!isset($languageId)) { $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } $config = \OxidEsales\Eshop\Core\Registry::getConfig(); if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) { if ($displayObj = $this->_getSubject($languageId)) { $url = $displayObj->getLink($languageId); } else { $encoder = \OxidEsales\Eshop\Core\Registry::getSeoEncoder(); $constructedUrl = $config->getShopHomeUrl($languageId) . $this->_getSeoRequestParams(); $url = $encoder->getStaticUrl($constructedUrl, $languageId); } } if (!$url) { $constructedUrl = $config->getShopCurrentURL($languageId) . $this->_getRequestParams(); $url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($constructedUrl, true, null, $languageId); } return $url; }
php
public function getBaseLink($languageId = null) { if (!isset($languageId)) { $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); } $config = \OxidEsales\Eshop\Core\Registry::getConfig(); if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) { if ($displayObj = $this->_getSubject($languageId)) { $url = $displayObj->getLink($languageId); } else { $encoder = \OxidEsales\Eshop\Core\Registry::getSeoEncoder(); $constructedUrl = $config->getShopHomeUrl($languageId) . $this->_getSeoRequestParams(); $url = $encoder->getStaticUrl($constructedUrl, $languageId); } } if (!$url) { $constructedUrl = $config->getShopCurrentURL($languageId) . $this->_getRequestParams(); $url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($constructedUrl, true, null, $languageId); } return $url; }
[ "public", "function", "getBaseLink", "(", "$", "languageId", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "languageId", ")", ")", "{", "$", "languageId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLan...
Get base link of current view @param int $languageId requested language @return string
[ "Get", "base", "link", "of", "current", "view" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1556-L1580
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getLink
public function getLink($languageId = null) { return $this->_addPageNrParam($this->getBaseLink($languageId), $this->getActPage(), $languageId); }
php
public function getLink($languageId = null) { return $this->_addPageNrParam($this->getBaseLink($languageId), $this->getActPage(), $languageId); }
[ "public", "function", "getLink", "(", "$", "languageId", "=", "null", ")", "{", "return", "$", "this", "->", "_addPageNrParam", "(", "$", "this", "->", "getBaseLink", "(", "$", "languageId", ")", ",", "$", "this", "->", "getActPage", "(", ")", ",", "$"...
Get link of current view. In url its include also page number if it is list page @param int $languageId requested language @return string
[ "Get", "link", "of", "current", "view", ".", "In", "url", "its", "include", "also", "page", "number", "if", "it", "is", "list", "page" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1590-L1593
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController._getSeoRequestParams
protected function _getSeoRequestParams() { $class = $this->getClassName(); $function = $this->getFncName(); // #921 S $forbiddenFunctions = ['tobasket', 'login_noredirect', 'addVoucher']; if (in_array($function, $forbiddenFunctions)) { $function = ''; } // #680 $url = "cl={$class}"; if ($function) { $url .= "&amp;fnc={$function}"; } if ($value = basename(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('page'))) { $url .= "&amp;page={$value}"; } if ($value = basename(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('tpl'))) { $url .= "&amp;tpl={$value}"; } if ($value = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxloadid')) { $url .= "&amp;oxloadid={$value}"; } $pageNumber = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr'); if ($pageNumber > 0) { $url .= "&amp;pgNr={$pageNumber}"; } return $url; }
php
protected function _getSeoRequestParams() { $class = $this->getClassName(); $function = $this->getFncName(); // #921 S $forbiddenFunctions = ['tobasket', 'login_noredirect', 'addVoucher']; if (in_array($function, $forbiddenFunctions)) { $function = ''; } // #680 $url = "cl={$class}"; if ($function) { $url .= "&amp;fnc={$function}"; } if ($value = basename(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('page'))) { $url .= "&amp;page={$value}"; } if ($value = basename(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('tpl'))) { $url .= "&amp;tpl={$value}"; } if ($value = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxloadid')) { $url .= "&amp;oxloadid={$value}"; } $pageNumber = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr'); if ($pageNumber > 0) { $url .= "&amp;pgNr={$pageNumber}"; } return $url; }
[ "protected", "function", "_getSeoRequestParams", "(", ")", "{", "$", "class", "=", "$", "this", "->", "getClassName", "(", ")", ";", "$", "function", "=", "$", "this", "->", "getFncName", "(", ")", ";", "// #921 S", "$", "forbiddenFunctions", "=", "[", "...
collects _GET parameters used by eShop SEO and returns uri @return string
[ "collects", "_GET", "parameters", "used", "by", "eShop", "SEO", "and", "returns", "uri" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1719-L1753
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getSortColumns
public function getSortColumns() { if ($this->_aSortColumns === null) { $this->setSortColumns(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSortCols')); } return $this->_aSortColumns; }
php
public function getSortColumns() { if ($this->_aSortColumns === null) { $this->setSortColumns(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSortCols')); } return $this->_aSortColumns; }
[ "public", "function", "getSortColumns", "(", ")", "{", "if", "(", "$", "this", "->", "_aSortColumns", "===", "null", ")", "{", "$", "this", "->", "setSortColumns", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", ...
Template variable getter. Returns sorting columns @return array
[ "Template", "variable", "getter", ".", "Returns", "sorting", "columns" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1780-L1787
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getActiveRecommList
public function getActiveRecommList() { if ($this->_oActiveRecommList === null) { $this->_oActiveRecommList = false; if ($recommendationListId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommid')) { $this->_oActiveRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class); $this->_oActiveRecommList->load($recommendationListId); } } return $this->_oActiveRecommList; }
php
public function getActiveRecommList() { if ($this->_oActiveRecommList === null) { $this->_oActiveRecommList = false; if ($recommendationListId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommid')) { $this->_oActiveRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class); $this->_oActiveRecommList->load($recommendationListId); } } return $this->_oActiveRecommList; }
[ "public", "function", "getActiveRecommList", "(", ")", "{", "if", "(", "$", "this", "->", "_oActiveRecommList", "===", "null", ")", "{", "$", "this", "->", "_oActiveRecommList", "=", "false", ";", "if", "(", "$", "recommendationListId", "=", "\\", "OxidEsale...
Template variable getter. Returns active recommendation lists @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. @return oxRecommList
[ "Template", "variable", "getter", ".", "Returns", "active", "recommendation", "lists" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1823-L1834
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.generatePageNavigationUrl
public function generatePageNavigationUrl() { return \OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl() . $this->_getRequestParams(false); }
php
public function generatePageNavigationUrl() { return \OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl() . $this->_getRequestParams(false); }
[ "public", "function", "generatePageNavigationUrl", "(", ")", "{", "return", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getShopHomeUrl", "(", ")", ".", "$", "this", "->", "_getRequestParams", "(", "f...
Generates URL for page navigation @return string $url String with working page url.
[ "Generates", "URL", "for", "page", "navigation" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1974-L1977
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController._addPageNrParam
protected function _addPageNrParam($url, $page, $languageId = null) { if ($page) { if ((strpos($url, 'pgNr='))) { $url = preg_replace('/pgNr=[0-9]*/', 'pgNr=' . $page, $url); } else { $url .= ((strpos($url, '?') === false) ? '?' : '&amp;') . 'pgNr=' . $page; } } else { $url = preg_replace('/pgNr=[0-9]*/', '', $url); $url = preg_replace('/\&amp\;\&amp\;/', '&amp;', $url); $url = preg_replace('/\?\&amp\;/', '?', $url); $url = preg_replace('/\&amp\;$/', '', $url); } return $url; }
php
protected function _addPageNrParam($url, $page, $languageId = null) { if ($page) { if ((strpos($url, 'pgNr='))) { $url = preg_replace('/pgNr=[0-9]*/', 'pgNr=' . $page, $url); } else { $url .= ((strpos($url, '?') === false) ? '?' : '&amp;') . 'pgNr=' . $page; } } else { $url = preg_replace('/pgNr=[0-9]*/', '', $url); $url = preg_replace('/\&amp\;\&amp\;/', '&amp;', $url); $url = preg_replace('/\?\&amp\;/', '?', $url); $url = preg_replace('/\&amp\;$/', '', $url); } return $url; }
[ "protected", "function", "_addPageNrParam", "(", "$", "url", ",", "$", "page", ",", "$", "languageId", "=", "null", ")", "{", "if", "(", "$", "page", ")", "{", "if", "(", "(", "strpos", "(", "$", "url", ",", "'pgNr='", ")", ")", ")", "{", "$", ...
Adds page number parameter to url and returns modified url, if page number 0 drops from url @param string $url Url to add page number @param int $page Active page number @param int $languageId Language id @return string
[ "Adds", "page", "number", "parameter", "to", "url", "and", "returns", "modified", "url", "if", "page", "number", "0", "drops", "from", "url" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L1988-L2004
train