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/NewsSubscribed.php | NewsSubscribed._insert | protected function _insert()
{
// set subscription date
$this->oxnewssubscribed__oxsubscribed = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s'), \OxidEsales\Eshop\Core\Field::T_RAW);
return parent::_insert();
} | php | protected function _insert()
{
// set subscription date
$this->oxnewssubscribed__oxsubscribed = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s'), \OxidEsales\Eshop\Core\Field::T_RAW);
return parent::_insert();
} | [
"protected",
"function",
"_insert",
"(",
")",
"{",
"// set subscription date",
"$",
"this",
"->",
"oxnewssubscribed__oxsubscribed",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
"(",
"date",
"(",
"'Y-m-d H:i:s'",
")",
",",
"\\",
"... | Inserts nbews object data to DB. Returns true on success.
@return mixed oxid on success or false on failure | [
"Inserts",
"nbews",
"object",
"data",
"to",
"DB",
".",
"Returns",
"true",
"on",
"success",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/NewsSubscribed.php#L120-L126 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/NewsSubscribed.php | NewsSubscribed._update | protected function _update()
{
if (($this->_blWasSubscribed || $this->_blWasPreSubscribed) && !$this->oxnewssubscribed__oxdboptin->value) {
// set unsubscription date
$this->oxnewssubscribed__oxunsubscribed->setValue(date('Y-m-d H:i:s'));
// 0001974 Same object can be called many times without requiring to renew date.
// If so happens, it would have _aSkipSaveFields set to skip date field. So need to check and
// release if _aSkipSaveFields are set for field oxunsubscribed.
$aSkipSaveFieldsKeys = array_keys($this->_aSkipSaveFields, 'oxunsubscribed');
foreach ($aSkipSaveFieldsKeys as $iSkipSaveFieldKey) {
unset($this->_aSkipSaveFields[$iSkipSaveFieldKey]);
}
} else {
// don't update date
$this->_aSkipSaveFields[] = 'oxunsubscribed';
}
return parent::_update();
} | php | protected function _update()
{
if (($this->_blWasSubscribed || $this->_blWasPreSubscribed) && !$this->oxnewssubscribed__oxdboptin->value) {
// set unsubscription date
$this->oxnewssubscribed__oxunsubscribed->setValue(date('Y-m-d H:i:s'));
// 0001974 Same object can be called many times without requiring to renew date.
// If so happens, it would have _aSkipSaveFields set to skip date field. So need to check and
// release if _aSkipSaveFields are set for field oxunsubscribed.
$aSkipSaveFieldsKeys = array_keys($this->_aSkipSaveFields, 'oxunsubscribed');
foreach ($aSkipSaveFieldsKeys as $iSkipSaveFieldKey) {
unset($this->_aSkipSaveFields[$iSkipSaveFieldKey]);
}
} else {
// don't update date
$this->_aSkipSaveFields[] = 'oxunsubscribed';
}
return parent::_update();
} | [
"protected",
"function",
"_update",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"_blWasSubscribed",
"||",
"$",
"this",
"->",
"_blWasPreSubscribed",
")",
"&&",
"!",
"$",
"this",
"->",
"oxnewssubscribed__oxdboptin",
"->",
"value",
")",
"{",
"// set unsub... | We need to check if we unsubscribe here
@return mixed oxid on success or false on failure | [
"We",
"need",
"to",
"check",
"if",
"we",
"unsubscribe",
"here"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/NewsSubscribed.php#L133-L151 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/NewsSubscribed.php | NewsSubscribed.setOptInStatus | public function setOptInStatus($iStatus)
{
$this->oxnewssubscribed__oxdboptin = new \OxidEsales\Eshop\Core\Field($iStatus, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->save();
} | php | public function setOptInStatus($iStatus)
{
$this->oxnewssubscribed__oxdboptin = new \OxidEsales\Eshop\Core\Field($iStatus, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->save();
} | [
"public",
"function",
"setOptInStatus",
"(",
"$",
"iStatus",
")",
"{",
"$",
"this",
"->",
"oxnewssubscribed__oxdboptin",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
"(",
"$",
"iStatus",
",",
"\\",
"OxidEsales",
"\\",
"Eshop",
... | Newsletter subscription status setter
@param int $iStatus subscription status | [
"Newsletter",
"subscription",
"status",
"setter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/NewsSubscribed.php#L168-L172 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/NewsSubscribed.php | NewsSubscribed.setOptInEmailStatus | public function setOptInEmailStatus($iStatus)
{
$this->oxnewssubscribed__oxemailfailed = new \OxidEsales\Eshop\Core\Field($iStatus, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->save();
} | php | public function setOptInEmailStatus($iStatus)
{
$this->oxnewssubscribed__oxemailfailed = new \OxidEsales\Eshop\Core\Field($iStatus, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->save();
} | [
"public",
"function",
"setOptInEmailStatus",
"(",
"$",
"iStatus",
")",
"{",
"$",
"this",
"->",
"oxnewssubscribed__oxemailfailed",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
"(",
"$",
"iStatus",
",",
"\\",
"OxidEsales",
"\\",
... | Newsletter subscription email sending status setter
@param int $iStatus subscription status | [
"Newsletter",
"subscription",
"email",
"sending",
"status",
"setter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/NewsSubscribed.php#L189-L193 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Widget/Information.php | Information._getContentList | protected function _getContentList()
{
if (!$this->_oContentList) {
$this->_oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
}
return $this->_oContentList;
} | php | protected function _getContentList()
{
if (!$this->_oContentList) {
$this->_oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
}
return $this->_oContentList;
} | [
"protected",
"function",
"_getContentList",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_oContentList",
")",
"{",
"$",
"this",
"->",
"_oContentList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"... | Returns content list object.
@return object|oxContentList | [
"Returns",
"content",
"list",
"object",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/Information.php#L57-L64 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/ContentList.php | ContentList.loadCatMenues | public function loadCatMenues()
{
$this->_load(self::TYPE_CATEGORY_MENU);
$aArray = [];
if ($this->count()) {
foreach ($this as $oContent) {
// add into category tree
if (!isset($aArray[$oContent->getCategoryId()])) {
$aArray[$oContent->getCategoryId()] = [];
}
$aArray[$oContent->oxcontents__oxcatid->value][] = $oContent;
}
}
$this->_aArray = $aArray;
} | php | public function loadCatMenues()
{
$this->_load(self::TYPE_CATEGORY_MENU);
$aArray = [];
if ($this->count()) {
foreach ($this as $oContent) {
// add into category tree
if (!isset($aArray[$oContent->getCategoryId()])) {
$aArray[$oContent->getCategoryId()] = [];
}
$aArray[$oContent->oxcontents__oxcatid->value][] = $oContent;
}
}
$this->_aArray = $aArray;
} | [
"public",
"function",
"loadCatMenues",
"(",
")",
"{",
"$",
"this",
"->",
"_load",
"(",
"self",
"::",
"TYPE_CATEGORY_MENU",
")",
";",
"$",
"aArray",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"count",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
... | Load Array of Menue items and change keys of aList to catid | [
"Load",
"Array",
"of",
"Menue",
"items",
"and",
"change",
"keys",
"of",
"aList",
"to",
"catid"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/ContentList.php#L92-L109 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/ContentList.php | ContentList._extractListToArray | protected function _extractListToArray()
{
$aExtractedContents = [];
foreach ($this as $oContent) {
$aExtractedContents[$oContent->getLoadId()] = $oContent;
}
$this->_aArray = $aExtractedContents;
} | php | protected function _extractListToArray()
{
$aExtractedContents = [];
foreach ($this as $oContent) {
$aExtractedContents[$oContent->getLoadId()] = $oContent;
}
$this->_aArray = $aExtractedContents;
} | [
"protected",
"function",
"_extractListToArray",
"(",
")",
"{",
"$",
"aExtractedContents",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"oContent",
")",
"{",
"$",
"aExtractedContents",
"[",
"$",
"oContent",
"->",
"getLoadId",
"(",
")",
"]",
... | Extract oxContentList object to associative array with oxloadid as keys. | [
"Extract",
"oxContentList",
"object",
"to",
"associative",
"array",
"with",
"oxloadid",
"as",
"keys",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/ContentList.php#L149-L157 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/ContentList.php | ContentList._getSQLByType | protected function _getSQLByType($iType)
{
$sSQLAdd = '';
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sSQLType = " AND `oxtype` = " . $oDb->quote($iType);
if ($iType == self::TYPE_CATEGORY_MENU) {
$sSQLAdd = " AND `oxcatid` IS NOT NULL AND `oxsnippet` = '0'";
}
if ($iType == self::TYPE_SERVICE_LIST) {
$sIdents = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($this->getServiceKeys()));
$sSQLAdd = " AND OXLOADID IN (" . $sIdents . ")";
$sSQLType = '';
}
$sViewName = $this->getBaseObject()->getViewName();
$sSql = "SELECT * FROM {$sViewName} WHERE `oxactive` = '1' $sSQLType AND `oxshopid` = " . $oDb->quote($this->_sShopID) . " $sSQLAdd ORDER BY `oxloadid`";
return $sSql;
} | php | protected function _getSQLByType($iType)
{
$sSQLAdd = '';
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sSQLType = " AND `oxtype` = " . $oDb->quote($iType);
if ($iType == self::TYPE_CATEGORY_MENU) {
$sSQLAdd = " AND `oxcatid` IS NOT NULL AND `oxsnippet` = '0'";
}
if ($iType == self::TYPE_SERVICE_LIST) {
$sIdents = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($this->getServiceKeys()));
$sSQLAdd = " AND OXLOADID IN (" . $sIdents . ")";
$sSQLType = '';
}
$sViewName = $this->getBaseObject()->getViewName();
$sSql = "SELECT * FROM {$sViewName} WHERE `oxactive` = '1' $sSQLType AND `oxshopid` = " . $oDb->quote($this->_sShopID) . " $sSQLAdd ORDER BY `oxloadid`";
return $sSql;
} | [
"protected",
"function",
"_getSQLByType",
"(",
"$",
"iType",
")",
"{",
"$",
"sSQLAdd",
"=",
"''",
";",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sSQLType",
"=",
"\" A... | Creates SQL by type.
@param integer $iType type.
@return string | [
"Creates",
"SQL",
"by",
"type",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/ContentList.php#L166-L185 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Widget/Recommendation.php | Recommendation.getSimilarRecommLists | public function getSimilarRecommLists()
{
$aArticleIds = $this->getViewParameter("aArticleIds");
$oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
return $oRecommList->getRecommListsByIds($aArticleIds);
} | php | public function getSimilarRecommLists()
{
$aArticleIds = $this->getViewParameter("aArticleIds");
$oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
return $oRecommList->getRecommListsByIds($aArticleIds);
} | [
"public",
"function",
"getSimilarRecommLists",
"(",
")",
"{",
"$",
"aArticleIds",
"=",
"$",
"this",
"->",
"getViewParameter",
"(",
"\"aArticleIds\"",
")",
";",
"$",
"oRecommList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",... | Returns similar recommendation list.
@return array | [
"Returns",
"similar",
"recommendation",
"list",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/Recommendation.php#L38-L45 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ThankYouController.php | ThankYouController.getCurrencyCovIndex | public function getCurrencyCovIndex()
{
if ($this->_dConvIndex === null) {
// currency conversion index value
$oCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
$this->_dConvIndex = 1 / $oCur->rate;
}
return $this->_dConvIndex;
} | php | public function getCurrencyCovIndex()
{
if ($this->_dConvIndex === null) {
// currency conversion index value
$oCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
$this->_dConvIndex = 1 / $oCur->rate;
}
return $this->_dConvIndex;
} | [
"public",
"function",
"getCurrencyCovIndex",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_dConvIndex",
"===",
"null",
")",
"{",
"// currency conversion index value",
"$",
"oCur",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
... | Template variable getter. Returns currency conversion index value
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"currency",
"conversion",
"index",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ThankYouController.php#L190-L199 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ThankYouController.php | ThankYouController.getIPaymentBasket | public function getIPaymentBasket()
{
if ($this->_dIPaymentBasket === null) {
$this->_dIPaymentBasket = $this->getBasket()->getPrice()->getBruttoPrice() * 100;
}
return $this->_dIPaymentBasket;
} | php | public function getIPaymentBasket()
{
if ($this->_dIPaymentBasket === null) {
$this->_dIPaymentBasket = $this->getBasket()->getPrice()->getBruttoPrice() * 100;
}
return $this->_dIPaymentBasket;
} | [
"public",
"function",
"getIPaymentBasket",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_dIPaymentBasket",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_dIPaymentBasket",
"=",
"$",
"this",
"->",
"getBasket",
"(",
")",
"->",
"getPrice",
"(",
")",
"->",
... | Template variable getter. Returns ipayment basket price
@return double | [
"Template",
"variable",
"getter",
".",
"Returns",
"ipayment",
"basket",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ThankYouController.php#L206-L213 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ThankYouController.php | ThankYouController.getIPaymentAccount | public function getIPaymentAccount()
{
if ($this->_sIPaymentAccount === null) {
$this->_sIPaymentAccount = false;
$this->_sIPaymentAccount = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iShopID_iPayment_Account');
}
return $this->_sIPaymentAccount;
} | php | public function getIPaymentAccount()
{
if ($this->_sIPaymentAccount === null) {
$this->_sIPaymentAccount = false;
$this->_sIPaymentAccount = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iShopID_iPayment_Account');
}
return $this->_sIPaymentAccount;
} | [
"public",
"function",
"getIPaymentAccount",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sIPaymentAccount",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_sIPaymentAccount",
"=",
"false",
";",
"$",
"this",
"->",
"_sIPaymentAccount",
"=",
"\\",
"OxidEsales",... | Template variable getter. Returns ipayment account
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"ipayment",
"account"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ThankYouController.php#L220-L228 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ThankYouController.php | ThankYouController.getIPaymentUser | public function getIPaymentUser()
{
if ($this->_sIPaymentUser === null) {
$this->_sIPaymentUser = false;
$this->_sIPaymentUser = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iShopID_iPayment_User');
}
return $this->_sIPaymentUser;
} | php | public function getIPaymentUser()
{
if ($this->_sIPaymentUser === null) {
$this->_sIPaymentUser = false;
$this->_sIPaymentUser = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iShopID_iPayment_User');
}
return $this->_sIPaymentUser;
} | [
"public",
"function",
"getIPaymentUser",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sIPaymentUser",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_sIPaymentUser",
"=",
"false",
";",
"$",
"this",
"->",
"_sIPaymentUser",
"=",
"\\",
"OxidEsales",
"\\",
"... | Template variable getter. Returns ipayment user name
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"ipayment",
"user",
"name"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ThankYouController.php#L235-L243 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ThankYouController.php | ThankYouController.getIPaymentPassword | public function getIPaymentPassword()
{
if ($this->_sIPaymentPassword === null) {
$this->_sIPaymentPassword = false;
$this->_sIPaymentPassword = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iShopID_iPayment_Passwort');
}
return $this->_sIPaymentPassword;
} | php | public function getIPaymentPassword()
{
if ($this->_sIPaymentPassword === null) {
$this->_sIPaymentPassword = false;
$this->_sIPaymentPassword = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iShopID_iPayment_Passwort');
}
return $this->_sIPaymentPassword;
} | [
"public",
"function",
"getIPaymentPassword",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sIPaymentPassword",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_sIPaymentPassword",
"=",
"false",
";",
"$",
"this",
"->",
"_sIPaymentPassword",
"=",
"\\",
"OxidEsal... | Template variable getter. Returns ipayment password
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"ipayment",
"password"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ThankYouController.php#L250-L258 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ThankYouController.php | ThankYouController.getMailError | public function getMailError()
{
if ($this->_sMailError === null) {
$this->_sMailError = false;
$this->_sMailError = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('mailerror');
}
return $this->_sMailError;
} | php | public function getMailError()
{
if ($this->_sMailError === null) {
$this->_sMailError = false;
$this->_sMailError = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('mailerror');
}
return $this->_sMailError;
} | [
"public",
"function",
"getMailError",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sMailError",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_sMailError",
"=",
"false",
";",
"$",
"this",
"->",
"_sMailError",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\... | Template variable getter. Returns mail error
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"mail",
"error"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ThankYouController.php#L265-L273 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ThankYouController.php | ThankYouController.getOrder | public function getOrder()
{
if ($this->_oOrder === null) {
$this->_oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
// loading order sometimes needed in template
if ($sOrderId = $this->getBasket()->getOrderId()) {
$this->_oOrder->load($sOrderId);
}
}
return $this->_oOrder;
} | php | public function getOrder()
{
if ($this->_oOrder === null) {
$this->_oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
// loading order sometimes needed in template
if ($sOrderId = $this->getBasket()->getOrderId()) {
$this->_oOrder->load($sOrderId);
}
}
return $this->_oOrder;
} | [
"public",
"function",
"getOrder",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oOrder",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oOrder",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Order",
... | Template variable getter. Returns order
@return oxOrder | [
"Template",
"variable",
"getter",
".",
"Returns",
"order"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ThankYouController.php#L280-L291 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ThankYouController.php | ThankYouController.getCountryISO3 | public function getCountryISO3()
{
$oOrder = $this->getOrder();
if ($oOrder) {
$oCountry = oxNew(\OxidEsales\Eshop\Application\Model\Country::class);
$oCountry->load($oOrder->oxorder__oxbillcountryid->value);
return $oCountry->oxcountry__oxisoalpha3->value;
}
} | php | public function getCountryISO3()
{
$oOrder = $this->getOrder();
if ($oOrder) {
$oCountry = oxNew(\OxidEsales\Eshop\Application\Model\Country::class);
$oCountry->load($oOrder->oxorder__oxbillcountryid->value);
return $oCountry->oxcountry__oxisoalpha3->value;
}
} | [
"public",
"function",
"getCountryISO3",
"(",
")",
"{",
"$",
"oOrder",
"=",
"$",
"this",
"->",
"getOrder",
"(",
")",
";",
"if",
"(",
"$",
"oOrder",
")",
"{",
"$",
"oCountry",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"... | Template variable getter. Returns country ISO 3
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"country",
"ISO",
"3"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ThankYouController.php#L298-L307 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ListReview.php | ListReview._buildSelectString | protected function _buildSelectString($oObject = null)
{
$sArtTable = getViewName('oxarticles', $this->_iEditLang);
$sQ = "select oxreviews.oxid, oxreviews.oxcreate, oxreviews.oxtext, oxreviews.oxobjectid, {$sArtTable}.oxparentid, {$sArtTable}.oxtitle as oxtitle, {$sArtTable}.oxvarselect as oxvarselect, oxparentarticles.oxtitle as parenttitle, ";
$sQ .= "concat( {$sArtTable}.oxtitle, if(isnull(oxparentarticles.oxtitle), '', oxparentarticles.oxtitle), {$sArtTable}.oxvarselect) as arttitle from oxreviews ";
$sQ .= "left join $sArtTable as {$sArtTable} on {$sArtTable}.oxid=oxreviews.oxobjectid and 'oxarticle' = oxreviews.oxtype ";
$sQ .= "left join $sArtTable as oxparentarticles on oxparentarticles.oxid = {$sArtTable}.oxparentid ";
$sQ .= "where 1 and oxreviews.oxlang = '{$this->_iEditLang}' ";
//removing parent id checking from sql
$sStr = "/\s+and\s+" . $sArtTable . "\.oxparentid\s*=\s*''/";
$sQ = getStr()->preg_replace($sStr, " ", $sQ);
return " $sQ and {$sArtTable}.oxid is not null ";
} | php | protected function _buildSelectString($oObject = null)
{
$sArtTable = getViewName('oxarticles', $this->_iEditLang);
$sQ = "select oxreviews.oxid, oxreviews.oxcreate, oxreviews.oxtext, oxreviews.oxobjectid, {$sArtTable}.oxparentid, {$sArtTable}.oxtitle as oxtitle, {$sArtTable}.oxvarselect as oxvarselect, oxparentarticles.oxtitle as parenttitle, ";
$sQ .= "concat( {$sArtTable}.oxtitle, if(isnull(oxparentarticles.oxtitle), '', oxparentarticles.oxtitle), {$sArtTable}.oxvarselect) as arttitle from oxreviews ";
$sQ .= "left join $sArtTable as {$sArtTable} on {$sArtTable}.oxid=oxreviews.oxobjectid and 'oxarticle' = oxreviews.oxtype ";
$sQ .= "left join $sArtTable as oxparentarticles on oxparentarticles.oxid = {$sArtTable}.oxparentid ";
$sQ .= "where 1 and oxreviews.oxlang = '{$this->_iEditLang}' ";
//removing parent id checking from sql
$sStr = "/\s+and\s+" . $sArtTable . "\.oxparentid\s*=\s*''/";
$sQ = getStr()->preg_replace($sStr, " ", $sQ);
return " $sQ and {$sArtTable}.oxid is not null ";
} | [
"protected",
"function",
"_buildSelectString",
"(",
"$",
"oObject",
"=",
"null",
")",
"{",
"$",
"sArtTable",
"=",
"getViewName",
"(",
"'oxarticles'",
",",
"$",
"this",
"->",
"_iEditLang",
")",
";",
"$",
"sQ",
"=",
"\"select oxreviews.oxid, oxreviews.oxcreate, oxre... | Returns select query string
@param object $oObject list item object
@return string | [
"Returns",
"select",
"query",
"string"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ListReview.php#L63-L79 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ListReview.php | ListReview._prepareWhereQuery | protected function _prepareWhereQuery($aWhere, $sSql)
{
$sSql = parent::_prepareWhereQuery($aWhere, $sSql);
$sArtTable = getViewName('oxarticles', $this->_iEditLang);
$sArtTitleField = "{$sArtTable}.oxtitle";
// if searching in article title field, updating sql for this case
if ($this->_aWhere[$sArtTitleField]) {
$sSqlForTitle = " (CONCAT( {$sArtTable}.oxtitle, if(isnull(oxparentarticles.oxtitle), '', oxparentarticles.oxtitle), {$sArtTable}.oxvarselect)) ";
$sSql = getStr()->preg_replace("/{$sArtTable}\.oxtitle\s+like/", "$sSqlForTitle like", $sSql);
}
return $sSql;
} | php | protected function _prepareWhereQuery($aWhere, $sSql)
{
$sSql = parent::_prepareWhereQuery($aWhere, $sSql);
$sArtTable = getViewName('oxarticles', $this->_iEditLang);
$sArtTitleField = "{$sArtTable}.oxtitle";
// if searching in article title field, updating sql for this case
if ($this->_aWhere[$sArtTitleField]) {
$sSqlForTitle = " (CONCAT( {$sArtTable}.oxtitle, if(isnull(oxparentarticles.oxtitle), '', oxparentarticles.oxtitle), {$sArtTable}.oxvarselect)) ";
$sSql = getStr()->preg_replace("/{$sArtTable}\.oxtitle\s+like/", "$sSqlForTitle like", $sSql);
}
return $sSql;
} | [
"protected",
"function",
"_prepareWhereQuery",
"(",
"$",
"aWhere",
",",
"$",
"sSql",
")",
"{",
"$",
"sSql",
"=",
"parent",
"::",
"_prepareWhereQuery",
"(",
"$",
"aWhere",
",",
"$",
"sSql",
")",
";",
"$",
"sArtTable",
"=",
"getViewName",
"(",
"'oxarticles'"... | Adds filtering conditions to query string
@param array $aWhere filter conditions
@param string $sSql query string
@return string | [
"Adds",
"filtering",
"conditions",
"to",
"query",
"string"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ListReview.php#L89-L103 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ActionsOrderAjax.php | ActionsOrderAjax.setSorting | public function setSorting()
{
$sSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
$sQuotedSelectionId = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sSelId);
$sSelect = "select * from oxobject2selectlist where oxobjectid= {$sQuotedSelectionId} order by oxsort";
$oList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oList->init("oxbase", "oxobject2selectlist");
$oList->selectString($sSelect);
// fixing indexes
$iSelCnt = 0;
$aIdx2Id = [];
foreach ($oList as $sKey => $oSel) {
if ($oSel->oxobject2selectlist__oxsort->value != $iSelCnt) {
$oSel->oxobject2selectlist__oxsort->setValue($iSelCnt);
// saving new index
$oSel->save();
}
$aIdx2Id[$iSelCnt] = $sKey;
$iSelCnt++;
}
//
if (($iKey = array_search(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sortoxid'), $aIdx2Id)) !== false) {
$iDir = (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('direction') == 'up') ? ($iKey - 1) : ($iKey + 1);
if (isset($aIdx2Id[$iDir])) {
// exchanging indexes
$oDir1 = $oList->offsetGet($aIdx2Id[$iDir]);
$oDir2 = $oList->offsetGet($aIdx2Id[$iKey]);
$iCopy = $oDir1->oxobject2selectlist__oxsort->value;
$oDir1->oxobject2selectlist__oxsort->setValue($oDir2->oxobject2selectlist__oxsort->value);
$oDir2->oxobject2selectlist__oxsort->setValue($iCopy);
$oDir1->save();
$oDir2->save();
}
}
$sQAdd = $this->_getQuery();
$sQ = 'select ' . $this->_getQueryCols() . $sQAdd;
$sCountQ = 'select count( * ) ' . $sQAdd;
$this->_outputResponse($this->_getData($sCountQ, $sQ));
} | php | public function setSorting()
{
$sSelId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
$sQuotedSelectionId = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sSelId);
$sSelect = "select * from oxobject2selectlist where oxobjectid= {$sQuotedSelectionId} order by oxsort";
$oList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oList->init("oxbase", "oxobject2selectlist");
$oList->selectString($sSelect);
// fixing indexes
$iSelCnt = 0;
$aIdx2Id = [];
foreach ($oList as $sKey => $oSel) {
if ($oSel->oxobject2selectlist__oxsort->value != $iSelCnt) {
$oSel->oxobject2selectlist__oxsort->setValue($iSelCnt);
// saving new index
$oSel->save();
}
$aIdx2Id[$iSelCnt] = $sKey;
$iSelCnt++;
}
//
if (($iKey = array_search(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sortoxid'), $aIdx2Id)) !== false) {
$iDir = (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('direction') == 'up') ? ($iKey - 1) : ($iKey + 1);
if (isset($aIdx2Id[$iDir])) {
// exchanging indexes
$oDir1 = $oList->offsetGet($aIdx2Id[$iDir]);
$oDir2 = $oList->offsetGet($aIdx2Id[$iKey]);
$iCopy = $oDir1->oxobject2selectlist__oxsort->value;
$oDir1->oxobject2selectlist__oxsort->setValue($oDir2->oxobject2selectlist__oxsort->value);
$oDir2->oxobject2selectlist__oxsort->setValue($iCopy);
$oDir1->save();
$oDir2->save();
}
}
$sQAdd = $this->_getQuery();
$sQ = 'select ' . $this->_getQueryCols() . $sQAdd;
$sCountQ = 'select count( * ) ' . $sQAdd;
$this->_outputResponse($this->_getData($sCountQ, $sQ));
} | [
"public",
"function",
"setSorting",
"(",
")",
"{",
"$",
"sSelId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"'oxid'",
")",
";",
"$",
"sQuotedSelectionId",
"=",
"\\... | Applies sorting for selection lists | [
"Applies",
"sorting",
"for",
"selection",
"lists"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ActionsOrderAjax.php#L58-L105 | train |
OXID-eSales/oxideshop_ce | source/Internal/Module/MetaData/Service/MetaDataNormalizer.php | MetaDataNormalizer.normalizeData | public function normalizeData(array $data): array
{
$normalizedMetaData = [];
foreach ($data as $key => $value) {
$normalizedKey = strtolower($key);
$normalizedValue = $this->normalizeValues($normalizedKey, $value);
$normalizedMetaData[$normalizedKey] = $normalizedValue;
}
return $normalizedMetaData;
} | php | public function normalizeData(array $data): array
{
$normalizedMetaData = [];
foreach ($data as $key => $value) {
$normalizedKey = strtolower($key);
$normalizedValue = $this->normalizeValues($normalizedKey, $value);
$normalizedMetaData[$normalizedKey] = $normalizedValue;
}
return $normalizedMetaData;
} | [
"public",
"function",
"normalizeData",
"(",
"array",
"$",
"data",
")",
":",
"array",
"{",
"$",
"normalizedMetaData",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"normalizedKey",
"=",
"strtolower... | Normalize the array aModule in metadata.php
@param array $data
@return array | [
"Normalize",
"the",
"array",
"aModule",
"in",
"metadata",
".",
"php"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Module/MetaData/Service/MetaDataNormalizer.php#L21-L31 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/VoucherSerieList.php | VoucherSerieList.deleteEntry | public function deleteEntry()
{
// first we remove vouchers
$oVoucherSerie = oxNew(\OxidEsales\Eshop\Application\Model\VoucherSerie::class);
$oVoucherSerie->load($this->getEditObjectId());
$oVoucherSerie->deleteVoucherList();
parent::deleteEntry();
} | php | public function deleteEntry()
{
// first we remove vouchers
$oVoucherSerie = oxNew(\OxidEsales\Eshop\Application\Model\VoucherSerie::class);
$oVoucherSerie->load($this->getEditObjectId());
$oVoucherSerie->deleteVoucherList();
parent::deleteEntry();
} | [
"public",
"function",
"deleteEntry",
"(",
")",
"{",
"// first we remove vouchers",
"$",
"oVoucherSerie",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"VoucherSerie",
"::",
"class",
")",
";",
"$",
"oVoucherSerie"... | Deletes selected Voucherserie. | [
"Deletes",
"selected",
"Voucherserie",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/VoucherSerieList.php#L34-L42 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountOrderController.php | AccountOrderController.getOrderList | public function getOrderList()
{
if ($this->_aOrderList === null) {
$this->_aOrderList = [];
// Load user Orderlist
if ($oUser = $this->getUser()) {
$iNrofCatArticles = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
$this->_iAllArtCnt = $oUser->getOrderCount();
if ($this->_iAllArtCnt && $this->_iAllArtCnt > 0) {
$this->_aOrderList = $oUser->getOrders($iNrofCatArticles, $this->getActPage());
$this->_iCntPages = ceil($this->_iAllArtCnt / $iNrofCatArticles);
}
}
}
return $this->_aOrderList;
} | php | public function getOrderList()
{
if ($this->_aOrderList === null) {
$this->_aOrderList = [];
// Load user Orderlist
if ($oUser = $this->getUser()) {
$iNrofCatArticles = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
$this->_iAllArtCnt = $oUser->getOrderCount();
if ($this->_iAllArtCnt && $this->_iAllArtCnt > 0) {
$this->_aOrderList = $oUser->getOrders($iNrofCatArticles, $this->getActPage());
$this->_iCntPages = ceil($this->_iAllArtCnt / $iNrofCatArticles);
}
}
}
return $this->_aOrderList;
} | [
"public",
"function",
"getOrderList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aOrderList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_aOrderList",
"=",
"[",
"]",
";",
"// Load user Orderlist",
"if",
"(",
"$",
"oUser",
"=",
"$",
"this",
"->",
... | Template variable getter. Returns orders
@return array | [
"Template",
"variable",
"getter",
".",
"Returns",
"orders"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountOrderController.php#L81-L99 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountOrderController.php | AccountOrderController.getOrderArticleList | public function getOrderArticleList()
{
if ($this->_aArticlesList === null) {
// marking as set
$this->_aArticlesList = false;
$oOrdersList = $this->getOrderList();
if ($oOrdersList && $oOrdersList->count()) {
$this->_aArticlesList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$this->_aArticlesList->loadOrderArticles($oOrdersList);
}
}
return $this->_aArticlesList;
} | php | public function getOrderArticleList()
{
if ($this->_aArticlesList === null) {
// marking as set
$this->_aArticlesList = false;
$oOrdersList = $this->getOrderList();
if ($oOrdersList && $oOrdersList->count()) {
$this->_aArticlesList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$this->_aArticlesList->loadOrderArticles($oOrdersList);
}
}
return $this->_aArticlesList;
} | [
"public",
"function",
"getOrderArticleList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aArticlesList",
"===",
"null",
")",
"{",
"// marking as set",
"$",
"this",
"->",
"_aArticlesList",
"=",
"false",
";",
"$",
"oOrdersList",
"=",
"$",
"this",
"->",
"g... | Template variable getter. Returns ordered articles
@return \OxidEsales\Eshop\Application\Model\ArticleList | false | [
"Template",
"variable",
"getter",
".",
"Returns",
"ordered",
"articles"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountOrderController.php#L106-L119 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountOrderController.php | AccountOrderController.getPageNavigation | public function getPageNavigation()
{
if ($this->_oPageNavigation === null) {
$this->_oPageNavigation = $this->generatePageNavigation();
}
return $this->_oPageNavigation;
} | php | public function getPageNavigation()
{
if ($this->_oPageNavigation === null) {
$this->_oPageNavigation = $this->generatePageNavigation();
}
return $this->_oPageNavigation;
} | [
"public",
"function",
"getPageNavigation",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oPageNavigation",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oPageNavigation",
"=",
"$",
"this",
"->",
"generatePageNavigation",
"(",
")",
";",
"}",
"return",
"$",... | Template variable getter. Returns page navigation
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"page",
"navigation"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountOrderController.php#L126-L133 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ToolsList.php | ToolsList.updateViews | public function updateViews()
{
//preventing edit for anyone except malladmin
if (\OxidEsales\Eshop\Core\Registry::getSession()->getVariable("malladmin")) {
$oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
$this->_aViewData["blViewSuccess"] = $oMetaData->updateViews();
}
} | php | public function updateViews()
{
//preventing edit for anyone except malladmin
if (\OxidEsales\Eshop\Core\Registry::getSession()->getVariable("malladmin")) {
$oMetaData = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
$this->_aViewData["blViewSuccess"] = $oMetaData->updateViews();
}
} | [
"public",
"function",
"updateViews",
"(",
")",
"{",
"//preventing edit for anyone except malladmin",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
"\"malladmin\"",
")",
")",
... | Performs full view update | [
"Performs",
"full",
"view",
"update"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ToolsList.php#L31-L38 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ToolsList.php | ToolsList._processFiles | protected function _processFiles()
{
if (isset($_FILES['myfile']['name'])) {
// process all files
foreach ($_FILES['myfile']['name'] as $key => $value) {
$aSource = $_FILES['myfile']['tmp_name'];
$sSource = $aSource[$key];
$value = strtolower($value);
// add type to name
$aFilename = explode(".", $value);
//hack?
$aBadFiles = ["php", 'php4', 'php5', "jsp", "cgi", "cmf", "exe"];
if (in_array($aFilename[1], $aBadFiles)) {
\OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit("File didn't pass our allowed files filter.");
}
//reading SQL dump file
if (filesize($sSource) > 0) {
$rHandle = fopen($sSource, "r");
$sContents = fread($rHandle, filesize($sSource));
fclose($rHandle);
//reading only one SQL dump file
return $sContents;
}
return;
}
}
return;
} | php | protected function _processFiles()
{
if (isset($_FILES['myfile']['name'])) {
// process all files
foreach ($_FILES['myfile']['name'] as $key => $value) {
$aSource = $_FILES['myfile']['tmp_name'];
$sSource = $aSource[$key];
$value = strtolower($value);
// add type to name
$aFilename = explode(".", $value);
//hack?
$aBadFiles = ["php", 'php4', 'php5', "jsp", "cgi", "cmf", "exe"];
if (in_array($aFilename[1], $aBadFiles)) {
\OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit("File didn't pass our allowed files filter.");
}
//reading SQL dump file
if (filesize($sSource) > 0) {
$rHandle = fopen($sSource, "r");
$sContents = fread($rHandle, filesize($sSource));
fclose($rHandle);
//reading only one SQL dump file
return $sContents;
}
return;
}
}
return;
} | [
"protected",
"function",
"_processFiles",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_FILES",
"[",
"'myfile'",
"]",
"[",
"'name'",
"]",
")",
")",
"{",
"// process all files",
"foreach",
"(",
"$",
"_FILES",
"[",
"'myfile'",
"]",
"[",
"'name'",
"]",
"... | Processes files containing SQL queries
@return mixed | [
"Processes",
"files",
"containing",
"SQL",
"queries"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ToolsList.php#L125-L159 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleVariant.php | ArticleVariant.render | public function render()
{
parent::render();
$soxId = $this->getEditObjectId();
$sSLViewName = getViewName('oxselectlist');
// all selectlists
$oAllSel = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oAllSel->init("oxselectlist");
$sQ = "select * from $sSLViewName";
$oAllSel->selectString($sQ);
$this->_aViewData["allsel"] = $oAllSel;
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$this->_aViewData["edit"] = $oArticle;
if (isset($soxId) && $soxId != "-1") {
// load object
$oArticle->loadInLang($this->_iEditLang, $soxId);
if ($oArticle->isDerived()) {
$this->_aViewData['readonly'] = true;
}
$_POST["language"] = $_GET["language"] = $this->_iEditLang;
$oVariants = $oArticle->getAdminVariants($this->_iEditLang);
$this->_aViewData["mylist"] = $oVariants;
// load object in other languages
$oOtherLang = $oArticle->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) {
// echo "language entry doesn't exist! using: ".key($oOtherLang);
$oArticle->loadInLang(key($oOtherLang), $soxId);
}
foreach ($oOtherLang as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang;
}
if ($oArticle->oxarticles__oxparentid->value) {
$this->_aViewData["parentarticle"] = $this->_getProductParent($oArticle->oxarticles__oxparentid->value);
$this->_aViewData["oxparentid"] = $oArticle->oxarticles__oxparentid->value;
$this->_aViewData["issubvariant"] = 1;
// A. disable variant information editing for variant
$this->_aViewData["readonly"] = 1;
}
$this->_aViewData["editlanguage"] = $this->_iEditLang;
$aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang);
if (count($aLang)) {
$this->_aViewData["posslang"] = $aLang;
}
foreach ($oOtherLang as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = $oLang;
}
}
return "article_variant.tpl";
} | php | public function render()
{
parent::render();
$soxId = $this->getEditObjectId();
$sSLViewName = getViewName('oxselectlist');
// all selectlists
$oAllSel = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oAllSel->init("oxselectlist");
$sQ = "select * from $sSLViewName";
$oAllSel->selectString($sQ);
$this->_aViewData["allsel"] = $oAllSel;
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$this->_aViewData["edit"] = $oArticle;
if (isset($soxId) && $soxId != "-1") {
// load object
$oArticle->loadInLang($this->_iEditLang, $soxId);
if ($oArticle->isDerived()) {
$this->_aViewData['readonly'] = true;
}
$_POST["language"] = $_GET["language"] = $this->_iEditLang;
$oVariants = $oArticle->getAdminVariants($this->_iEditLang);
$this->_aViewData["mylist"] = $oVariants;
// load object in other languages
$oOtherLang = $oArticle->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) {
// echo "language entry doesn't exist! using: ".key($oOtherLang);
$oArticle->loadInLang(key($oOtherLang), $soxId);
}
foreach ($oOtherLang as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang;
}
if ($oArticle->oxarticles__oxparentid->value) {
$this->_aViewData["parentarticle"] = $this->_getProductParent($oArticle->oxarticles__oxparentid->value);
$this->_aViewData["oxparentid"] = $oArticle->oxarticles__oxparentid->value;
$this->_aViewData["issubvariant"] = 1;
// A. disable variant information editing for variant
$this->_aViewData["readonly"] = 1;
}
$this->_aViewData["editlanguage"] = $this->_iEditLang;
$aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang);
if (count($aLang)) {
$this->_aViewData["posslang"] = $aLang;
}
foreach ($oOtherLang as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = $oLang;
}
}
return "article_variant.tpl";
} | [
"public",
"function",
"render",
"(",
")",
"{",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"sSLViewName",
"=",
"getViewName",
"(",
"'oxselectlist'",
")",
";",
"// all selectlists",
... | Loads article variants data, passes it to Smarty engine and returns name of
template file "article_variant.tpl".
@return string | [
"Loads",
"article",
"variants",
"data",
"passes",
"it",
"to",
"Smarty",
"engine",
"and",
"returns",
"name",
"of",
"template",
"file",
"article_variant",
".",
"tpl",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleVariant.php#L33-L100 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleVariant.php | ArticleVariant.savevariant | public function savevariant($sOXID = null, $aParams = null)
{
if (!isset($sOXID) && !isset($aParams)) {
$sOXID = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("voxid");
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
}
// varianthandling
$soxparentId = $this->getEditObjectId();
if (isset($soxparentId) && $soxparentId && $soxparentId != "-1") {
$aParams['oxarticles__oxparentid'] = $soxparentId;
} else {
unset($aParams['oxarticles__oxparentid']);
}
/** @var \OxidEsales\Eshop\Application\Model\Article $oArticle */
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($sOXID != "-1") {
$oArticle->loadInLang($this->_iEditLang, $sOXID);
}
// checkbox handling
if (is_array($aParams) && !isset($aParams['oxarticles__oxactive'])) {
$aParams['oxarticles__oxactive'] = 0;
}
if (!$this->_isAnythingChanged($oArticle, $aParams)) {
return;
}
$oArticle->setLanguage(0);
$oArticle->assign($aParams);
$oArticle->setLanguage($this->_iEditLang);
// #0004473
$oArticle->resetRemindStatus();
if ($sOXID == "-1") {
if ($oParent = $this->_getProductParent($oArticle->oxarticles__oxparentid->value)) {
// assign field from parent for new variant
// #4406
$oArticle->oxarticles__oxisconfigurable = new \OxidEsales\Eshop\Core\Field($oParent->oxarticles__oxisconfigurable->value);
$oArticle->oxarticles__oxremindactive = new \OxidEsales\Eshop\Core\Field($oParent->oxarticles__oxremindactive->value);
}
}
$oArticle->save();
} | php | public function savevariant($sOXID = null, $aParams = null)
{
if (!isset($sOXID) && !isset($aParams)) {
$sOXID = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("voxid");
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
}
// varianthandling
$soxparentId = $this->getEditObjectId();
if (isset($soxparentId) && $soxparentId && $soxparentId != "-1") {
$aParams['oxarticles__oxparentid'] = $soxparentId;
} else {
unset($aParams['oxarticles__oxparentid']);
}
/** @var \OxidEsales\Eshop\Application\Model\Article $oArticle */
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($sOXID != "-1") {
$oArticle->loadInLang($this->_iEditLang, $sOXID);
}
// checkbox handling
if (is_array($aParams) && !isset($aParams['oxarticles__oxactive'])) {
$aParams['oxarticles__oxactive'] = 0;
}
if (!$this->_isAnythingChanged($oArticle, $aParams)) {
return;
}
$oArticle->setLanguage(0);
$oArticle->assign($aParams);
$oArticle->setLanguage($this->_iEditLang);
// #0004473
$oArticle->resetRemindStatus();
if ($sOXID == "-1") {
if ($oParent = $this->_getProductParent($oArticle->oxarticles__oxparentid->value)) {
// assign field from parent for new variant
// #4406
$oArticle->oxarticles__oxisconfigurable = new \OxidEsales\Eshop\Core\Field($oParent->oxarticles__oxisconfigurable->value);
$oArticle->oxarticles__oxremindactive = new \OxidEsales\Eshop\Core\Field($oParent->oxarticles__oxremindactive->value);
}
}
$oArticle->save();
} | [
"public",
"function",
"savevariant",
"(",
"$",
"sOXID",
"=",
"null",
",",
"$",
"aParams",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"sOXID",
")",
"&&",
"!",
"isset",
"(",
"$",
"aParams",
")",
")",
"{",
"$",
"sOXID",
"=",
"\\",
"... | Saves article variant.
@param string $sOXID Object ID
@param array $aParams Parameters
@return null | [
"Saves",
"article",
"variant",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleVariant.php#L110-L157 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleVariant.php | ArticleVariant._isAnythingChanged | protected function _isAnythingChanged($oProduct, $aData)
{
if (!is_array($aData)) {
return true;
}
foreach ($aData as $sKey => $sValue) {
if (isset($oProduct->$sKey) && $oProduct->$sKey->value != $aData[$sKey]) {
return true;
}
}
return false;
} | php | protected function _isAnythingChanged($oProduct, $aData)
{
if (!is_array($aData)) {
return true;
}
foreach ($aData as $sKey => $sValue) {
if (isset($oProduct->$sKey) && $oProduct->$sKey->value != $aData[$sKey]) {
return true;
}
}
return false;
} | [
"protected",
"function",
"_isAnythingChanged",
"(",
"$",
"oProduct",
",",
"$",
"aData",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"aData",
")",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
"aData",
"as",
"$",
"sKey",
"=>",
"$",
... | Checks if anything is changed in given data compared with existing product values.
@param \OxidEsales\Eshop\Application\Model\Article $oProduct Product to be checked.
@param array $aData Data provided for check.
@return bool | [
"Checks",
"if",
"anything",
"is",
"changed",
"in",
"given",
"data",
"compared",
"with",
"existing",
"product",
"values",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleVariant.php#L167-L179 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleVariant.php | ArticleVariant._getProductParent | protected function _getProductParent($sParentId)
{
if ($this->_oProductParent === null ||
($this->_oProductParent !== false && $this->_oProductParent->getId() != $sParentId)
) {
$this->_oProductParent = false;
$oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($oProduct->load($sParentId)) {
$this->_oProductParent = $oProduct;
}
}
return $this->_oProductParent;
} | php | protected function _getProductParent($sParentId)
{
if ($this->_oProductParent === null ||
($this->_oProductParent !== false && $this->_oProductParent->getId() != $sParentId)
) {
$this->_oProductParent = false;
$oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($oProduct->load($sParentId)) {
$this->_oProductParent = $oProduct;
}
}
return $this->_oProductParent;
} | [
"protected",
"function",
"_getProductParent",
"(",
"$",
"sParentId",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oProductParent",
"===",
"null",
"||",
"(",
"$",
"this",
"->",
"_oProductParent",
"!==",
"false",
"&&",
"$",
"this",
"->",
"_oProductParent",
"->",
... | Returns variant parent object
@param string $sParentId parent product id
@return \OxidEsales\Eshop\Application\Model\Article | [
"Returns",
"variant",
"parent",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleVariant.php#L188-L201 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleVariant.php | ArticleVariant.savevariants | public function savevariants()
{
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
if (is_array($aParams)) {
foreach ($aParams as $soxId => $aVarParams) {
$this->savevariant($soxId, $aVarParams);
}
}
$this->resetContentCache();
} | php | public function savevariants()
{
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
if (is_array($aParams)) {
foreach ($aParams as $soxId => $aVarParams) {
$this->savevariant($soxId, $aVarParams);
}
}
$this->resetContentCache();
} | [
"public",
"function",
"savevariants",
"(",
")",
"{",
"$",
"aParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"\"editval\"",
")",
";",
"if",
"(",
"is_array",
"(",... | Saves all article variants at once. | [
"Saves",
"all",
"article",
"variants",
"at",
"once",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleVariant.php#L206-L216 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleVariant.php | ArticleVariant.deleteVariant | public function deleteVariant()
{
$editObjectOxid = $this->getEditObjectId();
$editObject = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$editObject->load($editObjectOxid);
if ($editObject->isDerived()) {
return;
}
$this->resetContentCache();
$variantOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestRawParameter("voxid");
$variant = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$variant->delete($variantOxid);
} | php | public function deleteVariant()
{
$editObjectOxid = $this->getEditObjectId();
$editObject = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$editObject->load($editObjectOxid);
if ($editObject->isDerived()) {
return;
}
$this->resetContentCache();
$variantOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestRawParameter("voxid");
$variant = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$variant->delete($variantOxid);
} | [
"public",
"function",
"deleteVariant",
"(",
")",
"{",
"$",
"editObjectOxid",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"editObject",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Artic... | Deletes article variant.
@return null | [
"Deletes",
"article",
"variant",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleVariant.php#L223-L237 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleVariant.php | ArticleVariant.changename | public function changename()
{
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$this->resetContentCache();
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($soxId != "-1") {
$oArticle->loadInLang($this->_iEditLang, $soxId);
}
$oArticle->setLanguage(0);
$oArticle->assign($aParams);
$oArticle->setLanguage($this->_iEditLang);
$oArticle->save();
} | php | public function changename()
{
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$this->resetContentCache();
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($soxId != "-1") {
$oArticle->loadInLang($this->_iEditLang, $soxId);
}
$oArticle->setLanguage(0);
$oArticle->assign($aParams);
$oArticle->setLanguage($this->_iEditLang);
$oArticle->save();
} | [
"public",
"function",
"changename",
"(",
")",
"{",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"aParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRe... | Changes name of variant. | [
"Changes",
"name",
"of",
"variant",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleVariant.php#L242-L258 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleVariant.php | ArticleVariant.addsel | public function addsel()
{
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($oArticle->load($this->getEditObjectId())) {
//Disable editing for derived articles
if ($oArticle->isDerived()) {
return;
}
$this->resetContentCache();
if ($aSels = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("allsel")) {
$oVariantHandler = oxNew(\OxidEsales\Eshop\Application\Model\VariantHandler::class);
$oVariantHandler->genVariantFromSell($aSels, $oArticle);
}
}
} | php | public function addsel()
{
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($oArticle->load($this->getEditObjectId())) {
//Disable editing for derived articles
if ($oArticle->isDerived()) {
return;
}
$this->resetContentCache();
if ($aSels = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("allsel")) {
$oVariantHandler = oxNew(\OxidEsales\Eshop\Application\Model\VariantHandler::class);
$oVariantHandler->genVariantFromSell($aSels, $oArticle);
}
}
} | [
"public",
"function",
"addsel",
"(",
")",
"{",
"$",
"oArticle",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Article",
"::",
"class",
")",
";",
"if",
"(",
"$",
"oArticle",
"->",
"load",
"(",
"$",
"t... | Add selection list
@return null | [
"Add",
"selection",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleVariant.php#L266-L282 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ReviewController.php | ReviewController.getReviewUser | public function getReviewUser()
{
if ($this->_oRevUser === null) {
$this->_oRevUser = false;
$oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
if ($sUserId = $oUser->getReviewUserId($this->getReviewUserHash())) {
// review user, by link or other source?
if ($oUser->load($sUserId)) {
$this->_oRevUser = $oUser;
}
} elseif ($oUser = $this->getUser()) {
// session user?
$this->_oRevUser = $oUser;
}
}
return $this->_oRevUser;
} | php | public function getReviewUser()
{
if ($this->_oRevUser === null) {
$this->_oRevUser = false;
$oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
if ($sUserId = $oUser->getReviewUserId($this->getReviewUserHash())) {
// review user, by link or other source?
if ($oUser->load($sUserId)) {
$this->_oRevUser = $oUser;
}
} elseif ($oUser = $this->getUser()) {
// session user?
$this->_oRevUser = $oUser;
}
}
return $this->_oRevUser;
} | [
"public",
"function",
"getReviewUser",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oRevUser",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oRevUser",
"=",
"false",
";",
"$",
"oUser",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Ap... | Returns review user object
@return oxuser | [
"Returns",
"review",
"user",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ReviewController.php#L243-L261 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ReviewController.php | ReviewController.getActiveRecommList | public function getActiveRecommList()
{
if (!$this->getViewConfig()->getShowListmania()) {
return false;
}
if ($this->_oActiveRecommList === null) {
$this->_oActiveRecommList = false;
if ($sRecommId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommid')) {
$oActiveRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
if ($oActiveRecommList->load($sRecommId)) {
$this->_oActiveRecommList = $oActiveRecommList;
}
}
}
return $this->_oActiveRecommList;
} | php | public function getActiveRecommList()
{
if (!$this->getViewConfig()->getShowListmania()) {
return false;
}
if ($this->_oActiveRecommList === null) {
$this->_oActiveRecommList = false;
if ($sRecommId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommid')) {
$oActiveRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
if ($oActiveRecommList->load($sRecommId)) {
$this->_oActiveRecommList = $oActiveRecommList;
}
}
}
return $this->_oActiveRecommList;
} | [
"public",
"function",
"getActiveRecommList",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getViewConfig",
"(",
")",
"->",
"getShowListmania",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"_oActiveRecommList",
"==="... | Template variable getter. Returns active recommlist
@deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
@return oxRecommList | [
"Template",
"variable",
"getter",
".",
"Returns",
"active",
"recommlist"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ReviewController.php#L318-L336 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ReviewController.php | ReviewController.getActiveRecommItems | public function getActiveRecommItems()
{
if ($this->_oActiveRecommItems === null) {
$this->_oActiveRecommItems = false;
if ($oActiveRecommList = $this->getActiveRecommList()) {
// sets active page
$iActPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr');
$iActPage = ($iActPage < 0) ? 0 : $iActPage;
// load only lists which we show on screen
$iNrofCatArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10;
$oList = $oActiveRecommList->getArticles($iNrofCatArticles * $iActPage, $iNrofCatArticles);
if ($oList && $oList->count()) {
foreach ($oList as $oItem) {
$oItem->text = $oActiveRecommList->getArtDescription($oItem->getId());
}
$this->_oActiveRecommItems = $oList;
}
}
}
return $this->_oActiveRecommItems;
} | php | public function getActiveRecommItems()
{
if ($this->_oActiveRecommItems === null) {
$this->_oActiveRecommItems = false;
if ($oActiveRecommList = $this->getActiveRecommList()) {
// sets active page
$iActPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr');
$iActPage = ($iActPage < 0) ? 0 : $iActPage;
// load only lists which we show on screen
$iNrofCatArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10;
$oList = $oActiveRecommList->getArticles($iNrofCatArticles * $iActPage, $iNrofCatArticles);
if ($oList && $oList->count()) {
foreach ($oList as $oItem) {
$oItem->text = $oActiveRecommList->getArtDescription($oItem->getId());
}
$this->_oActiveRecommItems = $oList;
}
}
}
return $this->_oActiveRecommItems;
} | [
"public",
"function",
"getActiveRecommItems",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oActiveRecommItems",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oActiveRecommItems",
"=",
"false",
";",
"if",
"(",
"$",
"oActiveRecommList",
"=",
"$",
"this",
"... | Template variable getter. Returns active recommlist's items
@deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"active",
"recommlist",
"s",
"items"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ReviewController.php#L404-L429 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._getSqlSelectFieldsForTree | protected function _getSqlSelectFieldsForTree($sTable, $aColumns = null)
{
if ($aColumns && count($aColumns)) {
foreach ($aColumns as $key => $val) {
$aColumns[$key] .= ' as ' . $val;
}
return "$sTable." . implode(", $sTable.", $aColumns);
}
$sFieldList = "$sTable.oxid as oxid, $sTable.oxactive as oxactive,"
. " $sTable.oxhidden as oxhidden, $sTable.oxparentid as oxparentid,"
. " $sTable.oxdefsort as oxdefsort, $sTable.oxdefsortmode as oxdefsortmode,"
. " $sTable.oxleft as oxleft, $sTable.oxright as oxright,"
. " $sTable.oxrootid as oxrootid, $sTable.oxsort as oxsort,"
. " $sTable.oxtitle as oxtitle, $sTable.oxdesc as oxdesc,"
. " $sTable.oxpricefrom as oxpricefrom, $sTable.oxpriceto as oxpriceto,"
. " $sTable.oxicon as oxicon, $sTable.oxextlink as oxextlink,"
. " $sTable.oxthumb as oxthumb, $sTable.oxpromoicon as oxpromoicon";
$sFieldList .= $this->getActivityFieldsSql($sTable);
return $sFieldList;
} | php | protected function _getSqlSelectFieldsForTree($sTable, $aColumns = null)
{
if ($aColumns && count($aColumns)) {
foreach ($aColumns as $key => $val) {
$aColumns[$key] .= ' as ' . $val;
}
return "$sTable." . implode(", $sTable.", $aColumns);
}
$sFieldList = "$sTable.oxid as oxid, $sTable.oxactive as oxactive,"
. " $sTable.oxhidden as oxhidden, $sTable.oxparentid as oxparentid,"
. " $sTable.oxdefsort as oxdefsort, $sTable.oxdefsortmode as oxdefsortmode,"
. " $sTable.oxleft as oxleft, $sTable.oxright as oxright,"
. " $sTable.oxrootid as oxrootid, $sTable.oxsort as oxsort,"
. " $sTable.oxtitle as oxtitle, $sTable.oxdesc as oxdesc,"
. " $sTable.oxpricefrom as oxpricefrom, $sTable.oxpriceto as oxpriceto,"
. " $sTable.oxicon as oxicon, $sTable.oxextlink as oxextlink,"
. " $sTable.oxthumb as oxthumb, $sTable.oxpromoicon as oxpromoicon";
$sFieldList .= $this->getActivityFieldsSql($sTable);
return $sFieldList;
} | [
"protected",
"function",
"_getSqlSelectFieldsForTree",
"(",
"$",
"sTable",
",",
"$",
"aColumns",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"aColumns",
"&&",
"count",
"(",
"$",
"aColumns",
")",
")",
"{",
"foreach",
"(",
"$",
"aColumns",
"as",
"$",
"key",
"... | return fields to select while loading category tree
@param string $sTable table name
@param array $aColumns required column names (optional)
@return string return | [
"return",
"fields",
"to",
"select",
"while",
"loading",
"category",
"tree"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L133-L156 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._getSelectString | protected function _getSelectString($blReverse = false, $aColumns = null, $sOrder = null)
{
$sViewName = $this->getBaseObject()->getViewName();
$sFieldList = $this->_getSqlSelectFieldsForTree($sViewName, $aColumns);
//excluding long desc
if (!$this->isAdmin() && !$this->_blHideEmpty && !$this->getLoadFull()) {
$oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if (!($this->_sActCat && $oCat->load($this->_sActCat) && $oCat->oxcategories__oxrootid->value)) {
$oCat = null;
$this->_sActCat = null;
}
$sUnion = $this->_getDepthSqlUnion($oCat, $aColumns);
$sWhere = $this->_getDepthSqlSnippet($oCat);
} else {
$sUnion = '';
$sWhere = '1';
}
if (!$sOrder) {
$sOrdDir = $blReverse ? 'desc' : 'asc';
$sOrder = "oxrootid $sOrdDir, oxleft $sOrdDir";
}
return "select $sFieldList from $sViewName where $sWhere $sUnion order by $sOrder";
} | php | protected function _getSelectString($blReverse = false, $aColumns = null, $sOrder = null)
{
$sViewName = $this->getBaseObject()->getViewName();
$sFieldList = $this->_getSqlSelectFieldsForTree($sViewName, $aColumns);
//excluding long desc
if (!$this->isAdmin() && !$this->_blHideEmpty && !$this->getLoadFull()) {
$oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if (!($this->_sActCat && $oCat->load($this->_sActCat) && $oCat->oxcategories__oxrootid->value)) {
$oCat = null;
$this->_sActCat = null;
}
$sUnion = $this->_getDepthSqlUnion($oCat, $aColumns);
$sWhere = $this->_getDepthSqlSnippet($oCat);
} else {
$sUnion = '';
$sWhere = '1';
}
if (!$sOrder) {
$sOrdDir = $blReverse ? 'desc' : 'asc';
$sOrder = "oxrootid $sOrdDir, oxleft $sOrdDir";
}
return "select $sFieldList from $sViewName where $sWhere $sUnion order by $sOrder";
} | [
"protected",
"function",
"_getSelectString",
"(",
"$",
"blReverse",
"=",
"false",
",",
"$",
"aColumns",
"=",
"null",
",",
"$",
"sOrder",
"=",
"null",
")",
"{",
"$",
"sViewName",
"=",
"$",
"this",
"->",
"getBaseObject",
"(",
")",
"->",
"getViewName",
"(",... | constructs the sql string to get the category list
@param bool $blReverse list loading order, true for tree, false for simple list (optional, default false)
@param array $aColumns required column names (optional)
@param string $sOrder order by string (optional)
@return string | [
"constructs",
"the",
"sql",
"string",
"to",
"get",
"the",
"category",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L179-L205 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._getDepthSqlSnippet | protected function _getDepthSqlSnippet($oCat)
{
$sViewName = $this->getBaseObject()->getViewName();
$sDepthSnippet = ' ( 0';
// load complete tree of active category, if it exists
if ($oCat) {
// select children here, siblings will be selected from union
$sDepthSnippet .= " or ($sViewName.oxparentid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($oCat->oxcategories__oxid->value) . ")";
}
// load 1'st category level (roots)
if ($this->getLoadLevel() >= 1) {
$sDepthSnippet .= " or $sViewName.oxparentid = 'oxrootid'";
}
// load 2'nd category level ()
if ($this->getLoadLevel() >= 2) {
$sDepthSnippet .= " or $sViewName.oxrootid = $sViewName.oxparentid or $sViewName.oxid = $sViewName.oxrootid";
}
$sDepthSnippet .= ' ) ';
return $sDepthSnippet;
} | php | protected function _getDepthSqlSnippet($oCat)
{
$sViewName = $this->getBaseObject()->getViewName();
$sDepthSnippet = ' ( 0';
// load complete tree of active category, if it exists
if ($oCat) {
// select children here, siblings will be selected from union
$sDepthSnippet .= " or ($sViewName.oxparentid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($oCat->oxcategories__oxid->value) . ")";
}
// load 1'st category level (roots)
if ($this->getLoadLevel() >= 1) {
$sDepthSnippet .= " or $sViewName.oxparentid = 'oxrootid'";
}
// load 2'nd category level ()
if ($this->getLoadLevel() >= 2) {
$sDepthSnippet .= " or $sViewName.oxrootid = $sViewName.oxparentid or $sViewName.oxid = $sViewName.oxrootid";
}
$sDepthSnippet .= ' ) ';
return $sDepthSnippet;
} | [
"protected",
"function",
"_getDepthSqlSnippet",
"(",
"$",
"oCat",
")",
"{",
"$",
"sViewName",
"=",
"$",
"this",
"->",
"getBaseObject",
"(",
")",
"->",
"getViewName",
"(",
")",
";",
"$",
"sDepthSnippet",
"=",
"' ( 0'",
";",
"// load complete tree of active catego... | constructs the sql snippet responsible for depth optimizations,
loads only selected category's siblings
@param \OxidEsales\Eshop\Application\Model\Category $oCat selected category
@return string | [
"constructs",
"the",
"sql",
"snippet",
"responsible",
"for",
"depth",
"optimizations",
"loads",
"only",
"selected",
"category",
"s",
"siblings"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L215-L239 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList.buildTree | public function buildTree($sActCat)
{
startProfile("buildTree");
$this->_sActCat = $sActCat;
$this->load();
// PostProcessing
if (!$this->isAdmin()) {
// remove inactive categories
$this->_ppRemoveInactiveCategories();
// add active cat as full object
$this->_ppLoadFullCategory($sActCat);
// builds navigation path
$this->_ppAddPathInfo();
// add content categories
$this->_ppAddContentCategories();
// build tree structure
$this->_ppBuildTree();
}
stopProfile("buildTree");
} | php | public function buildTree($sActCat)
{
startProfile("buildTree");
$this->_sActCat = $sActCat;
$this->load();
// PostProcessing
if (!$this->isAdmin()) {
// remove inactive categories
$this->_ppRemoveInactiveCategories();
// add active cat as full object
$this->_ppLoadFullCategory($sActCat);
// builds navigation path
$this->_ppAddPathInfo();
// add content categories
$this->_ppAddContentCategories();
// build tree structure
$this->_ppBuildTree();
}
stopProfile("buildTree");
} | [
"public",
"function",
"buildTree",
"(",
"$",
"sActCat",
")",
"{",
"startProfile",
"(",
"\"buildTree\"",
")",
";",
"$",
"this",
"->",
"_sActCat",
"=",
"$",
"sActCat",
";",
"$",
"this",
"->",
"load",
"(",
")",
";",
"// PostProcessing",
"if",
"(",
"!",
"$... | Fetches reversed raw categories and does all necessary postprocessing for
removing invisible or forbidden categories, building oc navigation path,
adding content categories and building tree structure.
@param string $sActCat Active category (default null) | [
"Fetches",
"reversed",
"raw",
"categories",
"and",
"does",
"all",
"necessary",
"postprocessing",
"for",
"removing",
"invisible",
"or",
"forbidden",
"categories",
"building",
"oc",
"navigation",
"path",
"adding",
"content",
"categories",
"and",
"building",
"tree",
"s... | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L296-L322 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._ppLoadFullCategory | protected function _ppLoadFullCategory($sId)
{
if (isset($this->_aArray[$sId])) {
$oNewCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($oNewCat->load($sId)) {
// replace aArray object with fully loaded category
$this->_aArray[$sId] = $oNewCat;
}
} else {
$this->_sActCat = null;
}
} | php | protected function _ppLoadFullCategory($sId)
{
if (isset($this->_aArray[$sId])) {
$oNewCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($oNewCat->load($sId)) {
// replace aArray object with fully loaded category
$this->_aArray[$sId] = $oNewCat;
}
} else {
$this->_sActCat = null;
}
} | [
"protected",
"function",
"_ppLoadFullCategory",
"(",
"$",
"sId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_aArray",
"[",
"$",
"sId",
"]",
")",
")",
"{",
"$",
"oNewCat",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Applic... | set full category object in tree
@param string $sId category id | [
"set",
"full",
"category",
"object",
"in",
"tree"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L329-L340 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList.loadList | public function loadList()
{
startProfile('buildCategoryList');
$this->setLoadFull(true);
$this->selectString($this->_getSelectString(false, null, 'oxparentid, oxsort, oxtitle'));
// build tree structure
$this->_ppBuildTree();
// PostProcessing
// add tree depth info
$this->_ppAddDepthInformation();
stopProfile('buildCategoryList');
} | php | public function loadList()
{
startProfile('buildCategoryList');
$this->setLoadFull(true);
$this->selectString($this->_getSelectString(false, null, 'oxparentid, oxsort, oxtitle'));
// build tree structure
$this->_ppBuildTree();
// PostProcessing
// add tree depth info
$this->_ppAddDepthInformation();
stopProfile('buildCategoryList');
} | [
"public",
"function",
"loadList",
"(",
")",
"{",
"startProfile",
"(",
"'buildCategoryList'",
")",
";",
"$",
"this",
"->",
"setLoadFull",
"(",
"true",
")",
";",
"$",
"this",
"->",
"selectString",
"(",
"$",
"this",
"->",
"_getSelectString",
"(",
"false",
","... | Fetches raw categories and does postprocessing for adding depth information | [
"Fetches",
"raw",
"categories",
"and",
"does",
"postprocessing",
"for",
"adding",
"depth",
"information"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L345-L359 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._ppRemoveInactiveCategories | protected function _ppRemoveInactiveCategories()
{
// Collect all items which must be remove
$aRemoveList = [];
foreach ($this->_aArray as $sId => $oCat) {
if ($oCat->oxcategories__oxppremove->value) {
if (!isset($aRemoveList[$oCat->oxcategories__oxrootid->value])) {
$aRemoveList[$oCat->oxcategories__oxrootid->value] = [];
}
$aRemoveList[$oCat->oxcategories__oxrootid->value][$oCat->oxcategories__oxleft->value] = $oCat->oxcategories__oxright->value;
unset($this->_aArray[$sId]);
} else {
unset($oCat->oxcategories__oxppremove);
}
}
// Remove collected item's children from the list too (in the ranges).
foreach ($this->_aArray as $sId => $oCat) {
if (isset($aRemoveList[$oCat->oxcategories__oxrootid->value]) &&
is_array($aRemoveList[$oCat->oxcategories__oxrootid->value])
) {
foreach ($aRemoveList[$oCat->oxcategories__oxrootid->value] as $iLeft => $iRight) {
if (($iLeft <= $oCat->oxcategories__oxleft->value)
&& ($iRight >= $oCat->oxcategories__oxleft->value)
) {
// this is a child in an inactive range (parent already gone)
unset($this->_aArray[$sId]);
break 1;
}
}
}
}
} | php | protected function _ppRemoveInactiveCategories()
{
// Collect all items which must be remove
$aRemoveList = [];
foreach ($this->_aArray as $sId => $oCat) {
if ($oCat->oxcategories__oxppremove->value) {
if (!isset($aRemoveList[$oCat->oxcategories__oxrootid->value])) {
$aRemoveList[$oCat->oxcategories__oxrootid->value] = [];
}
$aRemoveList[$oCat->oxcategories__oxrootid->value][$oCat->oxcategories__oxleft->value] = $oCat->oxcategories__oxright->value;
unset($this->_aArray[$sId]);
} else {
unset($oCat->oxcategories__oxppremove);
}
}
// Remove collected item's children from the list too (in the ranges).
foreach ($this->_aArray as $sId => $oCat) {
if (isset($aRemoveList[$oCat->oxcategories__oxrootid->value]) &&
is_array($aRemoveList[$oCat->oxcategories__oxrootid->value])
) {
foreach ($aRemoveList[$oCat->oxcategories__oxrootid->value] as $iLeft => $iRight) {
if (($iLeft <= $oCat->oxcategories__oxleft->value)
&& ($iRight >= $oCat->oxcategories__oxleft->value)
) {
// this is a child in an inactive range (parent already gone)
unset($this->_aArray[$sId]);
break 1;
}
}
}
}
} | [
"protected",
"function",
"_ppRemoveInactiveCategories",
"(",
")",
"{",
"// Collect all items which must be remove",
"$",
"aRemoveList",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_aArray",
"as",
"$",
"sId",
"=>",
"$",
"oCat",
")",
"{",
"if",
"(",
... | Category list postprocessing routine, responsible for removal of inactive of forbidden categories, and subcategories. | [
"Category",
"list",
"postprocessing",
"routine",
"responsible",
"for",
"removal",
"of",
"inactive",
"of",
"forbidden",
"categories",
"and",
"subcategories",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L408-L440 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._ppAddPathInfo | protected function _ppAddPathInfo()
{
if (is_null($this->_sActCat)) {
return;
}
$aPath = [];
$sCurrentCat = $this->_sActCat;
while ($sCurrentCat != 'oxrootid' && isset($this[$sCurrentCat])) {
$oCat = $this[$sCurrentCat];
$oCat->setExpanded(true);
$aPath[$sCurrentCat] = $oCat;
$sCurrentCat = $oCat->oxcategories__oxparentid->value;
}
$this->_aPath = array_reverse($aPath);
} | php | protected function _ppAddPathInfo()
{
if (is_null($this->_sActCat)) {
return;
}
$aPath = [];
$sCurrentCat = $this->_sActCat;
while ($sCurrentCat != 'oxrootid' && isset($this[$sCurrentCat])) {
$oCat = $this[$sCurrentCat];
$oCat->setExpanded(true);
$aPath[$sCurrentCat] = $oCat;
$sCurrentCat = $oCat->oxcategories__oxparentid->value;
}
$this->_aPath = array_reverse($aPath);
} | [
"protected",
"function",
"_ppAddPathInfo",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_sActCat",
")",
")",
"{",
"return",
";",
"}",
"$",
"aPath",
"=",
"[",
"]",
";",
"$",
"sCurrentCat",
"=",
"$",
"this",
"->",
"_sActCat",
";",
"w... | Category list postprocessing routine, responsible for generation of active category path
@return null | [
"Category",
"list",
"postprocessing",
"routine",
"responsible",
"for",
"generation",
"of",
"active",
"category",
"path"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L447-L464 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._ppAddContentCategories | protected function _ppAddContentCategories()
{
// load content pages for adding them into menu tree
$oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
$oContentList->loadCatMenues();
foreach ($oContentList as $sCatId => $aContent) {
if (array_key_exists($sCatId, $this->_aArray)) {
$this[$sCatId]->setContentCats($aContent);
}
}
} | php | protected function _ppAddContentCategories()
{
// load content pages for adding them into menu tree
$oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
$oContentList->loadCatMenues();
foreach ($oContentList as $sCatId => $aContent) {
if (array_key_exists($sCatId, $this->_aArray)) {
$this[$sCatId]->setContentCats($aContent);
}
}
} | [
"protected",
"function",
"_ppAddContentCategories",
"(",
")",
"{",
"// load content pages for adding them into menu tree",
"$",
"oContentList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"ContentList",
"::",
"class",
... | Category list postprocessing routine, responsible adding of content categories | [
"Category",
"list",
"postprocessing",
"routine",
"responsible",
"adding",
"of",
"content",
"categories"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L469-L480 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._ppBuildTree | protected function _ppBuildTree()
{
$aTree = [];
foreach ($this->_aArray as $oCat) {
$sParentId = $oCat->oxcategories__oxparentid->value;
if ($sParentId != 'oxrootid') {
if (isset($this->_aArray[$sParentId])) {
$this->_aArray[$sParentId]->setSubCat($oCat, $oCat->getId());
}
} else {
$aTree[$oCat->getId()] = $oCat;
}
}
$this->assign($aTree);
} | php | protected function _ppBuildTree()
{
$aTree = [];
foreach ($this->_aArray as $oCat) {
$sParentId = $oCat->oxcategories__oxparentid->value;
if ($sParentId != 'oxrootid') {
if (isset($this->_aArray[$sParentId])) {
$this->_aArray[$sParentId]->setSubCat($oCat, $oCat->getId());
}
} else {
$aTree[$oCat->getId()] = $oCat;
}
}
$this->assign($aTree);
} | [
"protected",
"function",
"_ppBuildTree",
"(",
")",
"{",
"$",
"aTree",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_aArray",
"as",
"$",
"oCat",
")",
"{",
"$",
"sParentId",
"=",
"$",
"oCat",
"->",
"oxcategories__oxparentid",
"->",
"value",
";... | Category list postprocessing routine, responsible building an sorting of hierarchical category tree | [
"Category",
"list",
"postprocessing",
"routine",
"responsible",
"building",
"an",
"sorting",
"of",
"hierarchical",
"category",
"tree"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L485-L500 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._ppAddDepthInformation | protected function _ppAddDepthInformation()
{
$aTree = [];
foreach ($this->_aArray as $oCat) {
$aTree[$oCat->getId()] = $oCat;
$aSubCats = $oCat->getSubCats();
if (count($aSubCats) > 0) {
foreach ($aSubCats as $oSubCat) {
$aTree = $this->_addDepthInfo($aTree, $oSubCat);
}
}
}
$this->assign($aTree);
} | php | protected function _ppAddDepthInformation()
{
$aTree = [];
foreach ($this->_aArray as $oCat) {
$aTree[$oCat->getId()] = $oCat;
$aSubCats = $oCat->getSubCats();
if (count($aSubCats) > 0) {
foreach ($aSubCats as $oSubCat) {
$aTree = $this->_addDepthInfo($aTree, $oSubCat);
}
}
}
$this->assign($aTree);
} | [
"protected",
"function",
"_ppAddDepthInformation",
"(",
")",
"{",
"$",
"aTree",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"_aArray",
"as",
"$",
"oCat",
")",
"{",
"$",
"aTree",
"[",
"$",
"oCat",
"->",
"getId",
"(",
")",
"]",
"=",
"$",
... | Category list postprocessing routine, responsible for making flat category tree and adding depth information.
Requires reversed category list! | [
"Category",
"list",
"postprocessing",
"routine",
"responsible",
"for",
"making",
"flat",
"category",
"tree",
"and",
"adding",
"depth",
"information",
".",
"Requires",
"reversed",
"category",
"list!"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L506-L519 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList._addDepthInfo | protected function _addDepthInfo($aTree, $oCat, $sDepth = "")
{
$sDepth .= "-";
$oCat->oxcategories__oxtitle->setValue($sDepth . ' ' . $oCat->oxcategories__oxtitle->value);
$aTree[$oCat->getId()] = $oCat;
$aSubCats = $oCat->getSubCats();
if (count($aSubCats) > 0) {
foreach ($aSubCats as $oSubCat) {
$aTree = $this->_addDepthInfo($aTree, $oSubCat, $sDepth);
}
}
return $aTree;
} | php | protected function _addDepthInfo($aTree, $oCat, $sDepth = "")
{
$sDepth .= "-";
$oCat->oxcategories__oxtitle->setValue($sDepth . ' ' . $oCat->oxcategories__oxtitle->value);
$aTree[$oCat->getId()] = $oCat;
$aSubCats = $oCat->getSubCats();
if (count($aSubCats) > 0) {
foreach ($aSubCats as $oSubCat) {
$aTree = $this->_addDepthInfo($aTree, $oSubCat, $sDepth);
}
}
return $aTree;
} | [
"protected",
"function",
"_addDepthInfo",
"(",
"$",
"aTree",
",",
"$",
"oCat",
",",
"$",
"sDepth",
"=",
"\"\"",
")",
"{",
"$",
"sDepth",
".=",
"\"-\"",
";",
"$",
"oCat",
"->",
"oxcategories__oxtitle",
"->",
"setValue",
"(",
"$",
"sDepth",
".",
"' '",
"... | Recursive function to add depth information
@param array $aTree new category tree
@param object $oCat category object
@param string $sDepth string to show category depth
@return array $aTree | [
"Recursive",
"function",
"to",
"add",
"depth",
"information"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L530-L543 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/CategoryList.php | CategoryList.updateCategoryTree | public function updateCategoryTree($blVerbose = true, $sShopID = null)
{
// Only called from admin and admin mode reads from master (see ESDEV-3804 and ESDEV-3822).
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$database->startTransaction();
try {
$sWhere = $this->getInitialUpdateCategoryTreeCondition($blVerbose);
$database->execute("update oxcategories set oxleft = 0, oxright = 0 where $sWhere");
$database->execute("update oxcategories set oxleft = 1, oxright = 2 where oxparentid = 'oxrootid' and $sWhere");
// Get all root categories
$rs = $database->select("select oxid, oxtitle from oxcategories where oxparentid = 'oxrootid' and $sWhere order by oxsort", false);
if ($rs != false && $rs->count() > 0) {
while (!$rs->EOF) {
$this->_aUpdateInfo[] = "<b>Processing : " . $rs->fields[1] . "</b>(" . $rs->fields[0] . ")<br>";
if ($blVerbose) {
echo next($this->_aUpdateInfo);
}
$oxRootId = $rs->fields[0];
$this->_updateNodes($oxRootId, true, $oxRootId);
$rs->fetchRow();
}
}
$database->commitTransaction();
} catch (Exception $exception) {
$database->rollbackTransaction();
throw $exception;
}
$this->onUpdateCategoryTree();
} | php | public function updateCategoryTree($blVerbose = true, $sShopID = null)
{
// Only called from admin and admin mode reads from master (see ESDEV-3804 and ESDEV-3822).
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$database->startTransaction();
try {
$sWhere = $this->getInitialUpdateCategoryTreeCondition($blVerbose);
$database->execute("update oxcategories set oxleft = 0, oxright = 0 where $sWhere");
$database->execute("update oxcategories set oxleft = 1, oxright = 2 where oxparentid = 'oxrootid' and $sWhere");
// Get all root categories
$rs = $database->select("select oxid, oxtitle from oxcategories where oxparentid = 'oxrootid' and $sWhere order by oxsort", false);
if ($rs != false && $rs->count() > 0) {
while (!$rs->EOF) {
$this->_aUpdateInfo[] = "<b>Processing : " . $rs->fields[1] . "</b>(" . $rs->fields[0] . ")<br>";
if ($blVerbose) {
echo next($this->_aUpdateInfo);
}
$oxRootId = $rs->fields[0];
$this->_updateNodes($oxRootId, true, $oxRootId);
$rs->fetchRow();
}
}
$database->commitTransaction();
} catch (Exception $exception) {
$database->rollbackTransaction();
throw $exception;
}
$this->onUpdateCategoryTree();
} | [
"public",
"function",
"updateCategoryTree",
"(",
"$",
"blVerbose",
"=",
"true",
",",
"$",
"sShopID",
"=",
"null",
")",
"{",
"// Only called from admin and admin mode reads from master (see ESDEV-3804 and ESDEV-3822).",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Esho... | Rebuilds nested sets information by updating oxLeft and oxRight category attributes, from oxParentId
@param bool $blVerbose Set to true for output the update status for user,
@param string $sShopID the shop id | [
"Rebuilds",
"nested",
"sets",
"information",
"by",
"updating",
"oxLeft",
"and",
"oxRight",
"category",
"attributes",
"from",
"oxParentId"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/CategoryList.php#L551-L584 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/OrderList.php | OrderList._prepareWhereQuery | protected function _prepareWhereQuery($whereQuery, $fullQuery)
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = parent::_prepareWhereQuery($whereQuery, $fullQuery);
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$folders = $config->getConfigParam('aOrderfolder');
$folder = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('folder');
// Searching for empty oxfolder fields
if ($folder && $folder != '-1') {
$query .= " and ( oxorder.oxfolder = " . $database->quote($folder) . " )";
} elseif (!$folder && is_array($folders)) {
$folderNames = array_keys($folders);
$query .= " and ( oxorder.oxfolder = " . $database->quote($folderNames[0]) . " )";
}
return $query;
} | php | protected function _prepareWhereQuery($whereQuery, $fullQuery)
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = parent::_prepareWhereQuery($whereQuery, $fullQuery);
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$folders = $config->getConfigParam('aOrderfolder');
$folder = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('folder');
// Searching for empty oxfolder fields
if ($folder && $folder != '-1') {
$query .= " and ( oxorder.oxfolder = " . $database->quote($folder) . " )";
} elseif (!$folder && is_array($folders)) {
$folderNames = array_keys($folders);
$query .= " and ( oxorder.oxfolder = " . $database->quote($folderNames[0]) . " )";
}
return $query;
} | [
"protected",
"function",
"_prepareWhereQuery",
"(",
"$",
"whereQuery",
",",
"$",
"fullQuery",
")",
"{",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"query",
"=",
"paren... | Adding folder check
@param array $whereQuery SQL condition array
@param string $fullQuery SQL query string
@return string | [
"Adding",
"folder",
"check"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderList.php#L120-L136 | train |
OXID-eSales/oxideshop_ce | source/Core/Routing/ModuleControllerMapProvider.php | ModuleControllerMapProvider.getControllerMap | public function getControllerMap()
{
$controllerMap = [];
$moduleControllersByModuleId = Registry::getUtilsObject()->getModuleVar(ClassProviderStorage::STORAGE_KEY);
if (is_array($moduleControllersByModuleId)) {
$controllerMap = $this->flattenControllersMap($moduleControllersByModuleId);
}
return $controllerMap;
} | php | public function getControllerMap()
{
$controllerMap = [];
$moduleControllersByModuleId = Registry::getUtilsObject()->getModuleVar(ClassProviderStorage::STORAGE_KEY);
if (is_array($moduleControllersByModuleId)) {
$controllerMap = $this->flattenControllersMap($moduleControllersByModuleId);
}
return $controllerMap;
} | [
"public",
"function",
"getControllerMap",
"(",
")",
"{",
"$",
"controllerMap",
"=",
"[",
"]",
";",
"$",
"moduleControllersByModuleId",
"=",
"Registry",
"::",
"getUtilsObject",
"(",
")",
"->",
"getModuleVar",
"(",
"ClassProviderStorage",
"::",
"STORAGE_KEY",
")",
... | Get the controller map of the modules.
Returns an associative array, where
- the keys are the controller ids
- the values are the routed class names
@return array | [
"Get",
"the",
"controller",
"map",
"of",
"the",
"modules",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Routing/ModuleControllerMapProvider.php#L29-L39 | train |
OXID-eSales/oxideshop_ce | source/Internal/Common/Factory/ConnectionFactory.php | ConnectionFactory.get | public static function get()
{
$database = DatabaseProvider::getDb();
$r = new \ReflectionMethod(Database::class, 'getConnection');
$r->setAccessible(true);
return $r->invoke($database);
} | php | public static function get()
{
$database = DatabaseProvider::getDb();
$r = new \ReflectionMethod(Database::class, 'getConnection');
$r->setAccessible(true);
return $r->invoke($database);
} | [
"public",
"static",
"function",
"get",
"(",
")",
"{",
"$",
"database",
"=",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"r",
"=",
"new",
"\\",
"ReflectionMethod",
"(",
"Database",
"::",
"class",
",",
"'getConnection'",
")",
";",
"$",
"r",
"-... | Uses reflection to fetch the database connection from
the DatabaseProvider.
@return Connection | [
"Uses",
"reflection",
"to",
"fetch",
"the",
"database",
"connection",
"from",
"the",
"DatabaseProvider",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Common/Factory/ConnectionFactory.php#L28-L36 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/MoreDetailsController.php | MoreDetailsController.getProductId | public function getProductId()
{
if ($this->_sProductId === null) {
$this->_sProductId = $this->getProduct()->getId();
}
return $this->_sProductId;
} | php | public function getProductId()
{
if ($this->_sProductId === null) {
$this->_sProductId = $this->getProduct()->getId();
}
return $this->_sProductId;
} | [
"public",
"function",
"getProductId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sProductId",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_sProductId",
"=",
"$",
"this",
"->",
"getProduct",
"(",
")",
"->",
"getId",
"(",
")",
";",
"}",
"return",
... | Template variable getter. Returns current product id
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"current",
"product",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/MoreDetailsController.php#L58-L65 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/MoreDetailsController.php | MoreDetailsController.getActPictureId | public function getActPictureId()
{
if ($this->_sActPicId === null) {
$this->_sActPicId = false;
$aPicGallery = $this->getProduct()->getPictureGallery();
if ($aPicGallery['ZoomPic']) {
$sActPicId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('actpicid');
$this->_sActPicId = $sActPicId ? $sActPicId : 1;
}
}
return $this->_sActPicId;
} | php | public function getActPictureId()
{
if ($this->_sActPicId === null) {
$this->_sActPicId = false;
$aPicGallery = $this->getProduct()->getPictureGallery();
if ($aPicGallery['ZoomPic']) {
$sActPicId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('actpicid');
$this->_sActPicId = $sActPicId ? $sActPicId : 1;
}
}
return $this->_sActPicId;
} | [
"public",
"function",
"getActPictureId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sActPicId",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_sActPicId",
"=",
"false",
";",
"$",
"aPicGallery",
"=",
"$",
"this",
"->",
"getProduct",
"(",
")",
"->",
... | Template variable getter. Returns active picture id
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"active",
"picture",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/MoreDetailsController.php#L72-L85 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/MoreDetailsController.php | MoreDetailsController.getArtZoomPics | public function getArtZoomPics()
{
if ($this->_aArtZoomPics === null) {
$this->_aArtZoomPics = false;
//Get picture gallery
$aPicGallery = $this->getProduct()->getPictureGallery();
$blArtPic = $aPicGallery['ZoomPic'];
$aArtPics = $aPicGallery['ZoomPics'];
if ($blArtPic) {
$this->_aArtZoomPics = $aArtPics;
}
}
return $this->_aArtZoomPics;
} | php | public function getArtZoomPics()
{
if ($this->_aArtZoomPics === null) {
$this->_aArtZoomPics = false;
//Get picture gallery
$aPicGallery = $this->getProduct()->getPictureGallery();
$blArtPic = $aPicGallery['ZoomPic'];
$aArtPics = $aPicGallery['ZoomPics'];
if ($blArtPic) {
$this->_aArtZoomPics = $aArtPics;
}
}
return $this->_aArtZoomPics;
} | [
"public",
"function",
"getArtZoomPics",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aArtZoomPics",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_aArtZoomPics",
"=",
"false",
";",
"//Get picture gallery",
"$",
"aPicGallery",
"=",
"$",
"this",
"->",
"getP... | Template variable getter. Returns article zoom pictures
@return array | [
"Template",
"variable",
"getter",
".",
"Returns",
"article",
"zoom",
"pictures"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/MoreDetailsController.php#L92-L107 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/MoreDetailsController.php | MoreDetailsController.getProduct | public function getProduct()
{
if ($this->_oProduct === null) {
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$oArticle->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid'));
$this->_oProduct = $oArticle;
}
return $this->_oProduct;
} | php | public function getProduct()
{
if ($this->_oProduct === null) {
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$oArticle->load(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid'));
$this->_oProduct = $oArticle;
}
return $this->_oProduct;
} | [
"public",
"function",
"getProduct",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oProduct",
"===",
"null",
")",
"{",
"$",
"oArticle",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Article",
"::",
"cl... | Template variable getter. Returns active product
@return oxArticle | [
"Template",
"variable",
"getter",
".",
"Returns",
"active",
"product"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/MoreDetailsController.php#L114-L123 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Content.php | Content.getExpanded | public function getExpanded()
{
if (!isset($this->_blExpanded)) {
$this->_blExpanded = ($this->getId() == \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxcid'));
}
return $this->_blExpanded;
} | php | public function getExpanded()
{
if (!isset($this->_blExpanded)) {
$this->_blExpanded = ($this->getId() == \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxcid'));
}
return $this->_blExpanded;
} | [
"public",
"function",
"getExpanded",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_blExpanded",
")",
")",
"{",
"$",
"this",
"->",
"_blExpanded",
"=",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
"==",
"\\",
"OxidEsales",
"\\",
"Es... | Returns the expanded state of the content category.
@return bool | [
"Returns",
"the",
"expanded",
"state",
"of",
"the",
"content",
"category",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Content.php#L93-L100 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Content.php | Content._loadFromDb | protected function _loadFromDb($sLoadId)
{
$sTable = $this->getViewName();
$sShopId = $this->getShopId();
$aParams = [$sTable . '.oxloadid' => $sLoadId, $sTable . '.oxshopid' => $sShopId];
$sSelect = $this->buildSelectString($aParams);
//Loads "credits" content object and its text (first available)
if ($sLoadId == 'oxcredits') {
// fetching column names
$sColQ = "SHOW COLUMNS FROM oxcontents WHERE field LIKE 'oxcontent%'";
$aCols = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getAll($sColQ);
// building subquery
$sPattern = "IF ( %s != '', %s, %s ) ";
$iCount = count($aCols) - 1;
$sContQ = "SELECT {$sPattern}";
foreach ($aCols as $iKey => $aCol) {
$sContQ = sprintf($sContQ, $aCol[0], $aCol[0], $iCount != $iKey ? $sPattern : "''");
}
$sContQ .= " FROM oxcontents WHERE oxloadid = '{$sLoadId}' AND oxshopid = '{$sShopId}'";
$sSelect = $this->buildSelectString($aParams);
$sSelect = str_replace("`{$sTable}`.`oxcontent`", "( $sContQ ) as oxcontent", $sSelect);
}
$aData = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC)->getRow($sSelect);
return $aData;
} | php | protected function _loadFromDb($sLoadId)
{
$sTable = $this->getViewName();
$sShopId = $this->getShopId();
$aParams = [$sTable . '.oxloadid' => $sLoadId, $sTable . '.oxshopid' => $sShopId];
$sSelect = $this->buildSelectString($aParams);
//Loads "credits" content object and its text (first available)
if ($sLoadId == 'oxcredits') {
// fetching column names
$sColQ = "SHOW COLUMNS FROM oxcontents WHERE field LIKE 'oxcontent%'";
$aCols = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getAll($sColQ);
// building subquery
$sPattern = "IF ( %s != '', %s, %s ) ";
$iCount = count($aCols) - 1;
$sContQ = "SELECT {$sPattern}";
foreach ($aCols as $iKey => $aCol) {
$sContQ = sprintf($sContQ, $aCol[0], $aCol[0], $iCount != $iKey ? $sPattern : "''");
}
$sContQ .= " FROM oxcontents WHERE oxloadid = '{$sLoadId}' AND oxshopid = '{$sShopId}'";
$sSelect = $this->buildSelectString($aParams);
$sSelect = str_replace("`{$sTable}`.`oxcontent`", "( $sContQ ) as oxcontent", $sSelect);
}
$aData = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC)->getRow($sSelect);
return $aData;
} | [
"protected",
"function",
"_loadFromDb",
"(",
"$",
"sLoadId",
")",
"{",
"$",
"sTable",
"=",
"$",
"this",
"->",
"getViewName",
"(",
")",
";",
"$",
"sShopId",
"=",
"$",
"this",
"->",
"getShopId",
"(",
")",
";",
"$",
"aParams",
"=",
"[",
"$",
"sTable",
... | Get data from db.
@param string $sLoadId id
@return array | [
"Get",
"data",
"from",
"db",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Content.php#L129-L160 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Content.php | Content.loadByIdent | public function loadByIdent($loadId, $onlyActive = false)
{
return $this->assignContentData($this->_loadFromDb($loadId), $onlyActive);
} | php | public function loadByIdent($loadId, $onlyActive = false)
{
return $this->assignContentData($this->_loadFromDb($loadId), $onlyActive);
} | [
"public",
"function",
"loadByIdent",
"(",
"$",
"loadId",
",",
"$",
"onlyActive",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"assignContentData",
"(",
"$",
"this",
"->",
"_loadFromDb",
"(",
"$",
"loadId",
")",
",",
"$",
"onlyActive",
")",
";",
... | Loads Content by using field oxloadid instead of oxid.
@param string $loadId content load ID
@param string $onlyActive selection state - active/inactive
@return bool | [
"Loads",
"Content",
"by",
"using",
"field",
"oxloadid",
"instead",
"of",
"oxid",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Content.php#L170-L173 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Content.php | Content.assignContentData | protected function assignContentData($fetchedContent, $onlyActive = false)
{
$filteredContent = $this->filterInactive($fetchedContent, $onlyActive);
if (!is_null($filteredContent)) {
$this->assign($filteredContent);
return true;
}
return false;
} | php | protected function assignContentData($fetchedContent, $onlyActive = false)
{
$filteredContent = $this->filterInactive($fetchedContent, $onlyActive);
if (!is_null($filteredContent)) {
$this->assign($filteredContent);
return true;
}
return false;
} | [
"protected",
"function",
"assignContentData",
"(",
"$",
"fetchedContent",
",",
"$",
"onlyActive",
"=",
"false",
")",
"{",
"$",
"filteredContent",
"=",
"$",
"this",
"->",
"filterInactive",
"(",
"$",
"fetchedContent",
",",
"$",
"onlyActive",
")",
";",
"if",
"(... | Assign content data, filter inactive if needed.
@param array $fetchedContent Item data to assign
@param bool $onlyActive Only assign if item is active
@return bool | [
"Assign",
"content",
"data",
"filter",
"inactive",
"if",
"needed",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Content.php#L183-L193 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Content.php | Content.filterInactive | protected function filterInactive($data, $checkIfActive = false)
{
return $data && (!$checkIfActive || ($checkIfActive && $data['OXACTIVE']) == '1') ? $data : null;
} | php | protected function filterInactive($data, $checkIfActive = false)
{
return $data && (!$checkIfActive || ($checkIfActive && $data['OXACTIVE']) == '1') ? $data : null;
} | [
"protected",
"function",
"filterInactive",
"(",
"$",
"data",
",",
"$",
"checkIfActive",
"=",
"false",
")",
"{",
"return",
"$",
"data",
"&&",
"(",
"!",
"$",
"checkIfActive",
"||",
"(",
"$",
"checkIfActive",
"&&",
"$",
"data",
"[",
"'OXACTIVE'",
"]",
")",
... | Decide if content item can be loaded by checking item activity if needed
@param array $data
@param bool $checkIfActive
@return array | null | [
"Decide",
"if",
"content",
"item",
"can",
"be",
"loaded",
"by",
"checking",
"item",
"activity",
"if",
"needed"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Content.php#L203-L206 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Content.php | Content.assign | public function assign($dbRecord)
{
parent::assign($dbRecord);
// workaround for firefox showing &lang= as &9001;= entity, mantis#0001272
if ($this->oxcontents__oxcontent) {
$this->oxcontents__oxcontent->setValue(str_replace('&lang=', '&lang=', $this->oxcontents__oxcontent->value), \OxidEsales\Eshop\Core\Field::T_RAW);
}
} | php | public function assign($dbRecord)
{
parent::assign($dbRecord);
// workaround for firefox showing &lang= as &9001;= entity, mantis#0001272
if ($this->oxcontents__oxcontent) {
$this->oxcontents__oxcontent->setValue(str_replace('&lang=', '&lang=', $this->oxcontents__oxcontent->value), \OxidEsales\Eshop\Core\Field::T_RAW);
}
} | [
"public",
"function",
"assign",
"(",
"$",
"dbRecord",
")",
"{",
"parent",
"::",
"assign",
"(",
"$",
"dbRecord",
")",
";",
"// workaround for firefox showing &lang= as &9001;= entity, mantis#0001272",
"if",
"(",
"$",
"this",
"->",
"oxcontents__oxcontent",
")",
"{",
"... | Replace the "&" into "&" and call base class.
@param array $dbRecord database record | [
"Replace",
"the",
"&",
";",
"into",
"&",
"and",
"call",
"base",
"class",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Content.php#L233-L241 | train |
OXID-eSales/oxideshop_ce | source/Core/Output.php | Output.addVersionTags | final public function addVersionTags($sOutput)
{
// DISPLAY IT
$sVersion = \OxidEsales\Eshop\Core\Registry::getConfig()->getVersion();
$sEdition = \OxidEsales\Eshop\Core\Registry::getConfig()->getFullEdition();
$sCurYear = date("Y");
// SHOW ONLY MAJOR VERSION NUMBER
$aVersion = explode('.', $sVersion);
$sMajorVersion = reset($aVersion);
$sShopMode = $this->getShopMode();
// Replacing only once per page
$sSearch = "</head>";
$sReplace = "</head>\n <!-- OXID eShop {$sEdition}, Version {$sMajorVersion}{$sShopMode}, Shopping Cart System (c) OXID eSales AG 2003 - {$sCurYear} - https://www.oxid-esales.com -->";
$sOutput = ltrim($sOutput);
if (($pos = stripos($sOutput, $sSearch)) !== false) {
$sOutput = substr_replace($sOutput, $sReplace, $pos, strlen($sSearch));
}
return $sOutput;
} | php | final public function addVersionTags($sOutput)
{
// DISPLAY IT
$sVersion = \OxidEsales\Eshop\Core\Registry::getConfig()->getVersion();
$sEdition = \OxidEsales\Eshop\Core\Registry::getConfig()->getFullEdition();
$sCurYear = date("Y");
// SHOW ONLY MAJOR VERSION NUMBER
$aVersion = explode('.', $sVersion);
$sMajorVersion = reset($aVersion);
$sShopMode = $this->getShopMode();
// Replacing only once per page
$sSearch = "</head>";
$sReplace = "</head>\n <!-- OXID eShop {$sEdition}, Version {$sMajorVersion}{$sShopMode}, Shopping Cart System (c) OXID eSales AG 2003 - {$sCurYear} - https://www.oxid-esales.com -->";
$sOutput = ltrim($sOutput);
if (($pos = stripos($sOutput, $sSearch)) !== false) {
$sOutput = substr_replace($sOutput, $sReplace, $pos, strlen($sSearch));
}
return $sOutput;
} | [
"final",
"public",
"function",
"addVersionTags",
"(",
"$",
"sOutput",
")",
"{",
"// DISPLAY IT",
"$",
"sVersion",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getVersion",
"(",
")",
";",
"$",
... | Add a version tag to a html page
@param string $sOutput htmlheader
@return string | [
"Add",
"a",
"version",
"tag",
"to",
"a",
"html",
"page"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Output.php#L86-L109 | train |
OXID-eSales/oxideshop_ce | source/Core/Output.php | Output.flushOutput | public function flushOutput()
{
switch ($this->_sOutputFormat) {
case self::OUTPUT_FORMAT_JSON:
echo getStr()->jsonEncode($this->_aBuffer);
break;
case self::OUTPUT_FORMAT_HTML:
default:
break;
}
} | php | public function flushOutput()
{
switch ($this->_sOutputFormat) {
case self::OUTPUT_FORMAT_JSON:
echo getStr()->jsonEncode($this->_aBuffer);
break;
case self::OUTPUT_FORMAT_HTML:
default:
break;
}
} | [
"public",
"function",
"flushOutput",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"_sOutputFormat",
")",
"{",
"case",
"self",
"::",
"OUTPUT_FORMAT_JSON",
":",
"echo",
"getStr",
"(",
")",
"->",
"jsonEncode",
"(",
"$",
"this",
"->",
"_aBuffer",
")",
";... | flush pending output | [
"flush",
"pending",
"output"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Output.php#L179-L189 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/NewsController.php | NewsController.getNews | public function getNews()
{
if ($this->_oNewsList === null) {
$this->_oNewsList = false;
$iPerPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iPerPage = $iPerPage ? $iPerPage : 10;
$oActNews = oxNew(\OxidEsales\Eshop\Application\Model\NewsList::class);
if ($iCnt = $oActNews->getCount()) {
$this->_iCntPages = ceil($iCnt / $iPerPage);
$oActNews->loadNews($this->getActPage() * $iPerPage, $iPerPage);
$this->_oNewsList = $oActNews;
}
}
return $this->_oNewsList;
} | php | public function getNews()
{
if ($this->_oNewsList === null) {
$this->_oNewsList = false;
$iPerPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iPerPage = $iPerPage ? $iPerPage : 10;
$oActNews = oxNew(\OxidEsales\Eshop\Application\Model\NewsList::class);
if ($iCnt = $oActNews->getCount()) {
$this->_iCntPages = ceil($iCnt / $iPerPage);
$oActNews->loadNews($this->getActPage() * $iPerPage, $iPerPage);
$this->_oNewsList = $oActNews;
}
}
return $this->_oNewsList;
} | [
"public",
"function",
"getNews",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oNewsList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oNewsList",
"=",
"false",
";",
"$",
"iPerPage",
"=",
"(",
"int",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
... | Template variable getter. Returns newslist
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"newslist"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/NewsController.php#L60-L78 | train |
OXID-eSales/oxideshop_ce | source/Core/DisplayError.php | DisplayError.getOxMessage | public function getOxMessage()
{
$translatedMessage = \OxidEsales\Eshop\Core\Registry::getLang()->translateString($this->_sMessage);
if (!empty($this->_aFormatParameters)) {
$translatedMessage = vsprintf($translatedMessage, $this->_aFormatParameters);
}
return $translatedMessage;
} | php | public function getOxMessage()
{
$translatedMessage = \OxidEsales\Eshop\Core\Registry::getLang()->translateString($this->_sMessage);
if (!empty($this->_aFormatParameters)) {
$translatedMessage = vsprintf($translatedMessage, $this->_aFormatParameters);
}
return $translatedMessage;
} | [
"public",
"function",
"getOxMessage",
"(",
")",
"{",
"$",
"translatedMessage",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
"->",
"translateString",
"(",
"$",
"this",
"->",
"_sMessage",
")",
";",
"if",
... | Formats message using vsprintf if property _aFormatParameters was set and returns translated message.
@return string stored message | [
"Formats",
"message",
"using",
"vsprintf",
"if",
"property",
"_aFormatParameters",
"was",
"set",
"and",
"returns",
"translated",
"message",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/DisplayError.php#L29-L37 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Widget/ArticleBox.php | ArticleBox.getActiveCategory | public function getActiveCategory()
{
$oCategory = \OxidEsales\Eshop\Core\Registry::getConfig()->getTopActiveView()->getActiveCategory();
if ($oCategory) {
$this->setActiveCategory($oCategory);
}
return $this->_oActCategory;
} | php | public function getActiveCategory()
{
$oCategory = \OxidEsales\Eshop\Core\Registry::getConfig()->getTopActiveView()->getActiveCategory();
if ($oCategory) {
$this->setActiveCategory($oCategory);
}
return $this->_oActCategory;
} | [
"public",
"function",
"getActiveCategory",
"(",
")",
"{",
"$",
"oCategory",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getTopActiveView",
"(",
")",
"->",
"getActiveCategory",
"(",
")",
";",
"... | Returns active category
@return null|oxCategory | [
"Returns",
"active",
"category"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleBox.php#L45-L53 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Widget/ArticleBox.php | ArticleBox.render | public function render()
{
parent::render();
$sWidgetType = $this->getViewParameter('sWidgetType');
$sListType = $this->getViewParameter('sListType');
if ($sWidgetType && $sListType) {
$this->_sTemplate = "widget/" . $sWidgetType . "/" . $sListType . ".tpl";
}
$sForceTemplate = $this->getViewParameter('oxwtemplate');
if ($sForceTemplate) {
$this->_sTemplate = $sForceTemplate;
}
return $this->_sTemplate;
} | php | public function render()
{
parent::render();
$sWidgetType = $this->getViewParameter('sWidgetType');
$sListType = $this->getViewParameter('sListType');
if ($sWidgetType && $sListType) {
$this->_sTemplate = "widget/" . $sWidgetType . "/" . $sListType . ".tpl";
}
$sForceTemplate = $this->getViewParameter('oxwtemplate');
if ($sForceTemplate) {
$this->_sTemplate = $sForceTemplate;
}
return $this->_sTemplate;
} | [
"public",
"function",
"render",
"(",
")",
"{",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"sWidgetType",
"=",
"$",
"this",
"->",
"getViewParameter",
"(",
"'sWidgetType'",
")",
";",
"$",
"sListType",
"=",
"$",
"this",
"->",
"getViewParameter",
"(",
"'s... | Renders template based on widget type or just use directly passed path of template
@return string | [
"Renders",
"template",
"based",
"on",
"widget",
"type",
"or",
"just",
"use",
"directly",
"passed",
"path",
"of",
"template"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleBox.php#L60-L77 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Widget/ArticleBox.php | ArticleBox.getProduct | public function getProduct()
{
if (is_null($this->_oArticle)) {
if ($this->getViewParameter('_object')) {
$oArticle = $this->getViewParameter('_object');
} else {
$sAddDynParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getTopActiveView()->getAddUrlParams();
$sAddDynParams = $this->updateDynamicParameters($sAddDynParams);
$oArticle = $this->_getArticleById($this->getViewParameter('anid'));
$this->_addDynParamsToLink($sAddDynParams, $oArticle);
}
$this->setProduct($oArticle);
}
return $this->_oArticle;
} | php | public function getProduct()
{
if (is_null($this->_oArticle)) {
if ($this->getViewParameter('_object')) {
$oArticle = $this->getViewParameter('_object');
} else {
$sAddDynParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getTopActiveView()->getAddUrlParams();
$sAddDynParams = $this->updateDynamicParameters($sAddDynParams);
$oArticle = $this->_getArticleById($this->getViewParameter('anid'));
$this->_addDynParamsToLink($sAddDynParams, $oArticle);
}
$this->setProduct($oArticle);
}
return $this->_oArticle;
} | [
"public",
"function",
"getProduct",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_oArticle",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getViewParameter",
"(",
"'_object'",
")",
")",
"{",
"$",
"oArticle",
"=",
"$",
"this",
"->",
... | Get product article
@return \OxidEsales\Eshop\Application\Model\Article | [
"Get",
"product",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleBox.php#L94-L112 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Widget/ArticleBox.php | ArticleBox.getLink | public function getLink($iLang = null)
{
return \OxidEsales\Eshop\Core\Registry::getConfig()->getTopActiveView()->getLink($iLang);
} | php | public function getLink($iLang = null)
{
return \OxidEsales\Eshop\Core\Registry::getConfig()->getTopActiveView()->getLink($iLang);
} | [
"public",
"function",
"getLink",
"(",
"$",
"iLang",
"=",
"null",
")",
"{",
"return",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getTopActiveView",
"(",
")",
"->",
"getLink",
"(",
"$",
"iLang",
... | get link of current top view
@param int $iLang requested language
@return string | [
"get",
"link",
"of",
"current",
"top",
"view"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleBox.php#L121-L124 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Widget/ArticleBox.php | ArticleBox._addDynParamsToLink | protected function _addDynParamsToLink($sAddDynParams, $oArticle)
{
$blAddedParams = false;
if ($sAddDynParams) {
$blSeo = \OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive();
if (!$blSeo) {
// only if seo is off..
$oArticle->appendStdLink($sAddDynParams);
}
$oArticle->appendLink($sAddDynParams);
$blAddedParams = true;
}
return $blAddedParams;
} | php | protected function _addDynParamsToLink($sAddDynParams, $oArticle)
{
$blAddedParams = false;
if ($sAddDynParams) {
$blSeo = \OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive();
if (!$blSeo) {
// only if seo is off..
$oArticle->appendStdLink($sAddDynParams);
}
$oArticle->appendLink($sAddDynParams);
$blAddedParams = true;
}
return $blAddedParams;
} | [
"protected",
"function",
"_addDynParamsToLink",
"(",
"$",
"sAddDynParams",
",",
"$",
"oArticle",
")",
"{",
"$",
"blAddedParams",
"=",
"false",
";",
"if",
"(",
"$",
"sAddDynParams",
")",
"{",
"$",
"blSeo",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core... | Appends dyn params to url.
@param string $sAddDynParams Dyn params
@param \OxidEsales\Eshop\Application\Model\Article $oArticle Article
@return bool | [
"Appends",
"dyn",
"params",
"to",
"url",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleBox.php#L251-L265 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Widget/ArticleBox.php | ArticleBox._getArticleById | protected function _getArticleById($sArticleId)
{
/** @var \OxidEsales\Eshop\Application\Model\Article $oArticle */
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$oArticle->load($sArticleId);
$iLinkType = $this->getViewParameter('iLinkType');
if ($this->getViewParameter('inlist')) {
$oArticle->setInList();
}
if ($iLinkType) {
$oArticle->setLinkType($iLinkType);
}
// @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
if ($oRecommList = $this->getActiveRecommList()) {
$oArticle->text = $oRecommList->getArtDescription($oArticle->getId());
}
// END deprecated
return $oArticle;
} | php | protected function _getArticleById($sArticleId)
{
/** @var \OxidEsales\Eshop\Application\Model\Article $oArticle */
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$oArticle->load($sArticleId);
$iLinkType = $this->getViewParameter('iLinkType');
if ($this->getViewParameter('inlist')) {
$oArticle->setInList();
}
if ($iLinkType) {
$oArticle->setLinkType($iLinkType);
}
// @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
if ($oRecommList = $this->getActiveRecommList()) {
$oArticle->text = $oRecommList->getArtDescription($oArticle->getId());
}
// END deprecated
return $oArticle;
} | [
"protected",
"function",
"_getArticleById",
"(",
"$",
"sArticleId",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Application\\Model\\Article $oArticle */",
"$",
"oArticle",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Arti... | Returns prepared article by id.
@param string $sArticleId Article id
@return \OxidEsales\Eshop\Application\Model\Article | [
"Returns",
"prepared",
"article",
"by",
"id",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Widget/ArticleBox.php#L274-L294 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/VoucherSerieMain.php | VoucherSerieMain.save | public function save()
{
parent::save();
// Parameter Processing
$soxId = $this->getEditObjectId();
$aSerieParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
// Voucher Serie Processing
$oVoucherSerie = oxNew(\OxidEsales\Eshop\Application\Model\VoucherSerie::class);
// if serie already exist use it
if ($soxId != "-1") {
$oVoucherSerie->load($soxId);
} else {
$aSerieParams["oxvoucherseries__oxid"] = null;
}
//Disable editing for derived items
if ($oVoucherSerie->isDerived()) {
return;
}
$aSerieParams["oxvoucherseries__oxdiscount"] = abs($aSerieParams["oxvoucherseries__oxdiscount"]);
$oVoucherSerie->assign($aSerieParams);
$oVoucherSerie->save();
// set oxid if inserted
$this->setEditObjectId($oVoucherSerie->getId());
} | php | public function save()
{
parent::save();
// Parameter Processing
$soxId = $this->getEditObjectId();
$aSerieParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
// Voucher Serie Processing
$oVoucherSerie = oxNew(\OxidEsales\Eshop\Application\Model\VoucherSerie::class);
// if serie already exist use it
if ($soxId != "-1") {
$oVoucherSerie->load($soxId);
} else {
$aSerieParams["oxvoucherseries__oxid"] = null;
}
//Disable editing for derived items
if ($oVoucherSerie->isDerived()) {
return;
}
$aSerieParams["oxvoucherseries__oxdiscount"] = abs($aSerieParams["oxvoucherseries__oxdiscount"]);
$oVoucherSerie->assign($aSerieParams);
$oVoucherSerie->save();
// set oxid if inserted
$this->setEditObjectId($oVoucherSerie->getId());
} | [
"public",
"function",
"save",
"(",
")",
"{",
"parent",
"::",
"save",
"(",
")",
";",
"// Parameter Processing",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"aSerieParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Cor... | Saves main Voucherserie parameters changes.
@return mixed | [
"Saves",
"main",
"Voucherserie",
"parameters",
"changes",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/VoucherSerieMain.php#L80-L109 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/VoucherSerieMain.php | VoucherSerieMain._getVoucherSerie | protected function _getVoucherSerie()
{
if ($this->_oVoucherSerie == null) {
$oVoucherSerie = oxNew(\OxidEsales\Eshop\Application\Model\VoucherSerie::class);
$sId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("voucherid");
if ($oVoucherSerie->load($sId ? $sId : \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("voucherid"))) {
$this->_oVoucherSerie = $oVoucherSerie;
}
}
return $this->_oVoucherSerie;
} | php | protected function _getVoucherSerie()
{
if ($this->_oVoucherSerie == null) {
$oVoucherSerie = oxNew(\OxidEsales\Eshop\Application\Model\VoucherSerie::class);
$sId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("voucherid");
if ($oVoucherSerie->load($sId ? $sId : \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("voucherid"))) {
$this->_oVoucherSerie = $oVoucherSerie;
}
}
return $this->_oVoucherSerie;
} | [
"protected",
"function",
"_getVoucherSerie",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oVoucherSerie",
"==",
"null",
")",
"{",
"$",
"oVoucherSerie",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Vouch... | Returns voucher serie object
@return oxvoucherserie | [
"Returns",
"voucher",
"serie",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/VoucherSerieMain.php#L136-L147 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.systemReq | public function systemReq()
{
$systemRequirementsInfo = $this->getSystemRequirementsInfo();
$moduleStateMapGenerator = $this->getModuleStateMapGenerator($systemRequirementsInfo);
$moduleStateMap = $moduleStateMapGenerator->getModuleStateMap();
$isSafeForSetupToContinue = SystemRequirements::canSetupContinue($systemRequirementsInfo);
$this->setViewOptions(
'systemreq.php',
'STEP_0_TITLE',
[
"blContinue" => $isSafeForSetupToContinue,
"aGroupModuleInfo" => $moduleStateMap,
"aLanguages" => getLanguages(),
"sLanguage" => $this->getSessionInstance()->getSessionParam('setup_lang'),
]
);
} | php | public function systemReq()
{
$systemRequirementsInfo = $this->getSystemRequirementsInfo();
$moduleStateMapGenerator = $this->getModuleStateMapGenerator($systemRequirementsInfo);
$moduleStateMap = $moduleStateMapGenerator->getModuleStateMap();
$isSafeForSetupToContinue = SystemRequirements::canSetupContinue($systemRequirementsInfo);
$this->setViewOptions(
'systemreq.php',
'STEP_0_TITLE',
[
"blContinue" => $isSafeForSetupToContinue,
"aGroupModuleInfo" => $moduleStateMap,
"aLanguages" => getLanguages(),
"sLanguage" => $this->getSessionInstance()->getSessionParam('setup_lang'),
]
);
} | [
"public",
"function",
"systemReq",
"(",
")",
"{",
"$",
"systemRequirementsInfo",
"=",
"$",
"this",
"->",
"getSystemRequirementsInfo",
"(",
")",
";",
"$",
"moduleStateMapGenerator",
"=",
"$",
"this",
"->",
"getModuleStateMapGenerator",
"(",
"$",
"systemRequirementsIn... | First page with system requirements check
Functionality is tested via:
`Acceptance/Frontend/ShopSetUpTest.php::testSystemRequirementsPageCanContinueWithSetup`
`Acceptance/Frontend/ShopSetUpTest.php::testSystemRequirementsPageShowsTranslatedModuleNames`
`Acceptance/Frontend/ShopSetUpTest.php::testSystemRequirementsPageShowsTranslatedModuleGroupNames`
`Acceptance/Frontend/ShopSetUpTest.php::testSystemRequirementsContainsProperModuleStateHtmlClassNames`
`Acceptance/Frontend/ShopSetUpTest.php::testInstallShopCantContinueDueToHtaccessProblem` | [
"First",
"page",
"with",
"system",
"requirements",
"check"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L42-L60 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.license | public function license()
{
$languageId = $this->getLanguageInstance()->getLanguage();
$utils = $this->getUtilitiesInstance();
$this->setViewOptions(
'license.php',
'STEP_2_TITLE',
[
"aLicenseText" => $utils->getLicenseContent($languageId)
]
);
} | php | public function license()
{
$languageId = $this->getLanguageInstance()->getLanguage();
$utils = $this->getUtilitiesInstance();
$this->setViewOptions(
'license.php',
'STEP_2_TITLE',
[
"aLicenseText" => $utils->getLicenseContent($languageId)
]
);
} | [
"public",
"function",
"license",
"(",
")",
"{",
"$",
"languageId",
"=",
"$",
"this",
"->",
"getLanguageInstance",
"(",
")",
"->",
"getLanguage",
"(",
")",
";",
"$",
"utils",
"=",
"$",
"this",
"->",
"getUtilitiesInstance",
"(",
")",
";",
"$",
"this",
"-... | License confirmation page | [
"License",
"confirmation",
"page"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L90-L102 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.dbInfo | public function dbInfo()
{
$view = $this->getView();
$session = $this->getSessionInstance();
$systemRequirements = getSystemReqCheck();
$utilities = $this->getUtilitiesInstance();
$eulaOptionValue = $utilities->getRequestVar("iEula", "post");
$eulaOptionValue = (int)($eulaOptionValue ? $eulaOptionValue : $session->getSessionParam("eula"));
if (!$eulaOptionValue) {
$setup = $this->getSetupInstance();
$setup->setNextStep($setup->getStep("STEP_WELCOME"));
$view->setMessage($this->getLanguageInstance()->getText("ERROR_SETUP_CANCELLED"));
throw new SetupControllerExitException("licenseerror.php");
}
$databaseConfigValues = $session->getSessionParam('aDB');
$demodataPackageExists = $utilities->isDemodataPrepared();
if (!isset($databaseConfigValues)) {
// default values
$databaseConfigValues['dbHost'] = "localhost";
$databaseConfigValues['dbPort'] = "3306";
$databaseConfigValues['dbUser'] = "";
$databaseConfigValues['dbPwd'] = "";
$databaseConfigValues['dbName'] = "";
$databaseConfigValues['dbiDemoData'] = $demodataPackageExists ? 1 : 0;
}
$this->setViewOptions(
'dbinfo.php',
'STEP_3_TITLE',
[
"aDB" => $databaseConfigValues,
"blMbStringOn" => $systemRequirements->getModuleInfo('mb_string'),
"blUnicodeSupport" => $systemRequirements->getModuleInfo('unicode_support'),
"demodataPackageExists" => $demodataPackageExists
]
);
} | php | public function dbInfo()
{
$view = $this->getView();
$session = $this->getSessionInstance();
$systemRequirements = getSystemReqCheck();
$utilities = $this->getUtilitiesInstance();
$eulaOptionValue = $utilities->getRequestVar("iEula", "post");
$eulaOptionValue = (int)($eulaOptionValue ? $eulaOptionValue : $session->getSessionParam("eula"));
if (!$eulaOptionValue) {
$setup = $this->getSetupInstance();
$setup->setNextStep($setup->getStep("STEP_WELCOME"));
$view->setMessage($this->getLanguageInstance()->getText("ERROR_SETUP_CANCELLED"));
throw new SetupControllerExitException("licenseerror.php");
}
$databaseConfigValues = $session->getSessionParam('aDB');
$demodataPackageExists = $utilities->isDemodataPrepared();
if (!isset($databaseConfigValues)) {
// default values
$databaseConfigValues['dbHost'] = "localhost";
$databaseConfigValues['dbPort'] = "3306";
$databaseConfigValues['dbUser'] = "";
$databaseConfigValues['dbPwd'] = "";
$databaseConfigValues['dbName'] = "";
$databaseConfigValues['dbiDemoData'] = $demodataPackageExists ? 1 : 0;
}
$this->setViewOptions(
'dbinfo.php',
'STEP_3_TITLE',
[
"aDB" => $databaseConfigValues,
"blMbStringOn" => $systemRequirements->getModuleInfo('mb_string'),
"blUnicodeSupport" => $systemRequirements->getModuleInfo('unicode_support'),
"demodataPackageExists" => $demodataPackageExists
]
);
} | [
"public",
"function",
"dbInfo",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"$",
"session",
"=",
"$",
"this",
"->",
"getSessionInstance",
"(",
")",
";",
"$",
"systemRequirements",
"=",
"getSystemReqCheck",
"(",
")",
";... | DB info entry page
Functionality is tested via:
`Acceptance/Frontend/ShopSetUpTest.php::testSetupRedirectsToWelcomeScreenInCaseLicenseIsNotCheckedAsAgreed` | [
"DB",
"info",
"entry",
"page"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L110-L150 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.dirsInfo | public function dirsInfo()
{
$session = $this->getSessionInstance();
$setup = $this->getSetupInstance();
if ($this->userDecidedOverwriteDB()) {
$session->setSessionParam('blOverwrite', true);
}
if ($this->userDecidedIgnoreDBWarning()) {
$session->setSessionParam('blIgnoreDbRecommendations', true);
}
$this->setViewOptions(
'dirsinfo.php',
'STEP_4_TITLE',
[
"aAdminData" => $session->getSessionParam('aAdminData'),
"aPath" => $this->getUtilitiesInstance()->getDefaultPathParams(),
"aSetupConfig" => ["blDelSetupDir" => $setup->deleteSetupDirectory()],
]
);
} | php | public function dirsInfo()
{
$session = $this->getSessionInstance();
$setup = $this->getSetupInstance();
if ($this->userDecidedOverwriteDB()) {
$session->setSessionParam('blOverwrite', true);
}
if ($this->userDecidedIgnoreDBWarning()) {
$session->setSessionParam('blIgnoreDbRecommendations', true);
}
$this->setViewOptions(
'dirsinfo.php',
'STEP_4_TITLE',
[
"aAdminData" => $session->getSessionParam('aAdminData'),
"aPath" => $this->getUtilitiesInstance()->getDefaultPathParams(),
"aSetupConfig" => ["blDelSetupDir" => $setup->deleteSetupDirectory()],
]
);
} | [
"public",
"function",
"dirsInfo",
"(",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"getSessionInstance",
"(",
")",
";",
"$",
"setup",
"=",
"$",
"this",
"->",
"getSetupInstance",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"userDecidedOverwriteDB",... | Setup paths info entry page | [
"Setup",
"paths",
"info",
"entry",
"page"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L155-L176 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.dbConnect | public function dbConnect()
{
$setup = $this->getSetupInstance();
$session = $this->getSessionInstance();
$language = $this->getLanguageInstance();
$view = $this->getView();
$view->setTitle('STEP_3_1_TITLE');
$databaseConfigValues = $this->getUtilitiesInstance()->getRequestVar("aDB", "post");
$session->setSessionParam('aDB', $databaseConfigValues);
// check if important parameters are set
if (!$databaseConfigValues['dbHost'] || !$databaseConfigValues['dbName']) {
$setup->setNextStep($setup->getStep('STEP_DB_INFO'));
$view->setMessage($language->getText('ERROR_FILL_ALL_FIELDS'));
throw new SetupControllerExitException();
}
try {
// ok check DB Connection
$database = $this->getDatabaseInstance();
$database->openDatabase($databaseConfigValues);
} catch (Exception $exception) {
if ($exception->getCode() === Database::ERROR_DB_CONNECT) {
$setup->setNextStep($setup->getStep('STEP_DB_INFO'));
$view->setMessage($language->getText('ERROR_DB_CONNECT') . " - " . $exception->getMessage());
throw new SetupControllerExitException();
} elseif ($exception->getCode() === Database::ERROR_MYSQL_VERSION_DOES_NOT_FIT_REQUIREMENTS) {
$setup->setNextStep($setup->getStep('STEP_DB_INFO'));
$view->setMessage($exception->getMessage());
throw new SetupControllerExitException();
} elseif (($exception->getCode() === Database::ERROR_MYSQL_VERSION_DOES_NOT_FIT_RECOMMENDATIONS)) {
$setup->setNextStep(null);
$this->formMessageIfMySqyVersionIsNotRecommended($view, $language);
$databaseExists = false;
// check if DB is already UP and running
if (!$this->databaseCanBeOverwritten($database)) {
$this->formMessageIfDBCanBeOverwritten($databaseConfigValues['dbName'], $view, $language);
$databaseExists = true;
}
$this->formMessageIgnoreDbVersionNotRecommended($view, $language, $session->getSid(), $setup->getStep('STEP_DIRS_INFO'), $databaseExists);
throw new SetupControllerExitException();
} else {
$this->ensureDatabasePresent($database, $databaseConfigValues['dbName']);
}
}
$view->setViewParam("aDB", $databaseConfigValues);
// check if DB is already UP and running
if (!$this->databaseCanBeOverwritten($database)) {
$this->formMessageIfDBCanBeOverwritten($databaseConfigValues['dbName'], $view, $language);
$this->formMessageInstallAnyway($view, $language, $session->getSid(), $setup->getStep('STEP_DIRS_INFO'));
throw new SetupControllerExitException();
}
$setup->setNextStep($setup->getStep('STEP_DIRS_INFO'));
$this->view->setTemplateFileName("dbconnect.php");
} | php | public function dbConnect()
{
$setup = $this->getSetupInstance();
$session = $this->getSessionInstance();
$language = $this->getLanguageInstance();
$view = $this->getView();
$view->setTitle('STEP_3_1_TITLE');
$databaseConfigValues = $this->getUtilitiesInstance()->getRequestVar("aDB", "post");
$session->setSessionParam('aDB', $databaseConfigValues);
// check if important parameters are set
if (!$databaseConfigValues['dbHost'] || !$databaseConfigValues['dbName']) {
$setup->setNextStep($setup->getStep('STEP_DB_INFO'));
$view->setMessage($language->getText('ERROR_FILL_ALL_FIELDS'));
throw new SetupControllerExitException();
}
try {
// ok check DB Connection
$database = $this->getDatabaseInstance();
$database->openDatabase($databaseConfigValues);
} catch (Exception $exception) {
if ($exception->getCode() === Database::ERROR_DB_CONNECT) {
$setup->setNextStep($setup->getStep('STEP_DB_INFO'));
$view->setMessage($language->getText('ERROR_DB_CONNECT') . " - " . $exception->getMessage());
throw new SetupControllerExitException();
} elseif ($exception->getCode() === Database::ERROR_MYSQL_VERSION_DOES_NOT_FIT_REQUIREMENTS) {
$setup->setNextStep($setup->getStep('STEP_DB_INFO'));
$view->setMessage($exception->getMessage());
throw new SetupControllerExitException();
} elseif (($exception->getCode() === Database::ERROR_MYSQL_VERSION_DOES_NOT_FIT_RECOMMENDATIONS)) {
$setup->setNextStep(null);
$this->formMessageIfMySqyVersionIsNotRecommended($view, $language);
$databaseExists = false;
// check if DB is already UP and running
if (!$this->databaseCanBeOverwritten($database)) {
$this->formMessageIfDBCanBeOverwritten($databaseConfigValues['dbName'], $view, $language);
$databaseExists = true;
}
$this->formMessageIgnoreDbVersionNotRecommended($view, $language, $session->getSid(), $setup->getStep('STEP_DIRS_INFO'), $databaseExists);
throw new SetupControllerExitException();
} else {
$this->ensureDatabasePresent($database, $databaseConfigValues['dbName']);
}
}
$view->setViewParam("aDB", $databaseConfigValues);
// check if DB is already UP and running
if (!$this->databaseCanBeOverwritten($database)) {
$this->formMessageIfDBCanBeOverwritten($databaseConfigValues['dbName'], $view, $language);
$this->formMessageInstallAnyway($view, $language, $session->getSid(), $setup->getStep('STEP_DIRS_INFO'));
throw new SetupControllerExitException();
}
$setup->setNextStep($setup->getStep('STEP_DIRS_INFO'));
$this->view->setTemplateFileName("dbconnect.php");
} | [
"public",
"function",
"dbConnect",
"(",
")",
"{",
"$",
"setup",
"=",
"$",
"this",
"->",
"getSetupInstance",
"(",
")",
";",
"$",
"session",
"=",
"$",
"this",
"->",
"getSessionInstance",
"(",
")",
";",
"$",
"language",
"=",
"$",
"this",
"->",
"getLanguag... | Testing database connection
Functionality is tested via:
`Acceptance/Frontend/ShopSetUpTest.php::testSetupRedirectsToDatabaseEntryPageWhenNotAllFieldsAreFilled`
`Acceptance/Frontend/ShopSetUpTest.php::testSetupRedirectsToDatabaseEntryPageWhenDatabaseUserDoesNotHaveAccess`
`Acceptance/Frontend/ShopSetUpTest.php::testSetupRedirectsToDatabaseEntryPageWhenDatabaseUserIsValidButCantCreateDatabase`
`Acceptance/Frontend/ShopSetUpTest.php::testUserIsNotifiedIfAValidDatabaseAlreadyExistsBeforeTryingToOverwriteIt` | [
"Testing",
"database",
"connection"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L187-L252 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.finish | public function finish()
{
$session = $this->getSessionInstance();
$pathCollection = $session->getSessionParam("aPath");
$aSetupConfig = $session->getSessionParam("aSetupConfig");
$aDB = $session->getSessionParam("aDB");
try {
$this->getUtilitiesInstance()->executeExternalRegenerateViewsCommand(); // move to last step possible?
} catch (CommandExecutionFailedException $exception) {
$this->handleCommandExecutionFailedException($exception);
throw new SetupControllerExitException();
} catch (Exception $exception) {
$view = $this->getView();
$view->setMessage($exception->getMessage());
throw new SetupControllerExitException();
}
$this->setViewOptions(
'finish.php',
'STEP_6_TITLE',
[
"aPath" => $pathCollection,
"aSetupConfig" => $aSetupConfig,
"aDB" => $aDB,
"blWritableConfig" => is_writable($pathCollection['sShopDir'] . "/config.inc.php")
]
);
} | php | public function finish()
{
$session = $this->getSessionInstance();
$pathCollection = $session->getSessionParam("aPath");
$aSetupConfig = $session->getSessionParam("aSetupConfig");
$aDB = $session->getSessionParam("aDB");
try {
$this->getUtilitiesInstance()->executeExternalRegenerateViewsCommand(); // move to last step possible?
} catch (CommandExecutionFailedException $exception) {
$this->handleCommandExecutionFailedException($exception);
throw new SetupControllerExitException();
} catch (Exception $exception) {
$view = $this->getView();
$view->setMessage($exception->getMessage());
throw new SetupControllerExitException();
}
$this->setViewOptions(
'finish.php',
'STEP_6_TITLE',
[
"aPath" => $pathCollection,
"aSetupConfig" => $aSetupConfig,
"aDB" => $aDB,
"blWritableConfig" => is_writable($pathCollection['sShopDir'] . "/config.inc.php")
]
);
} | [
"public",
"function",
"finish",
"(",
")",
"{",
"$",
"session",
"=",
"$",
"this",
"->",
"getSessionInstance",
"(",
")",
";",
"$",
"pathCollection",
"=",
"$",
"session",
"->",
"getSessionParam",
"(",
"\"aPath\"",
")",
";",
"$",
"aSetupConfig",
"=",
"$",
"s... | Final setup step | [
"Final",
"setup",
"step"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L479-L509 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.databaseCanBeOverwritten | private function databaseCanBeOverwritten($database)
{
$canBeOverwritten = true;
if (!$this->userDecidedOverwriteDB()) {
$canBeOverwritten = !$this->getUtilitiesInstance()->checkDbExists($database);
}
return $canBeOverwritten;
} | php | private function databaseCanBeOverwritten($database)
{
$canBeOverwritten = true;
if (!$this->userDecidedOverwriteDB()) {
$canBeOverwritten = !$this->getUtilitiesInstance()->checkDbExists($database);
}
return $canBeOverwritten;
} | [
"private",
"function",
"databaseCanBeOverwritten",
"(",
"$",
"database",
")",
"{",
"$",
"canBeOverwritten",
"=",
"true",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"userDecidedOverwriteDB",
"(",
")",
")",
"{",
"$",
"canBeOverwritten",
"=",
"!",
"$",
"this",
"... | Check if database can be safely overwritten.
@param \OxidEsales\EshopCommunity\Setup\Database $database database instance used to connect to DB
@return bool | [
"Check",
"if",
"database",
"can",
"be",
"safely",
"overwritten",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L536-L545 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.formMessageIfDBCanBeOverwritten | private function formMessageIfDBCanBeOverwritten($databaseName, $view, $language)
{
$view->setMessage(sprintf($language->getText('ERROR_DB_ALREADY_EXISTS'), $databaseName));
} | php | private function formMessageIfDBCanBeOverwritten($databaseName, $view, $language)
{
$view->setMessage(sprintf($language->getText('ERROR_DB_ALREADY_EXISTS'), $databaseName));
} | [
"private",
"function",
"formMessageIfDBCanBeOverwritten",
"(",
"$",
"databaseName",
",",
"$",
"view",
",",
"$",
"language",
")",
"{",
"$",
"view",
"->",
"setMessage",
"(",
"sprintf",
"(",
"$",
"language",
"->",
"getText",
"(",
"'ERROR_DB_ALREADY_EXISTS'",
")",
... | Show warning-question if database with same name already exists.
@param string $databaseName name of database to check if exist
@param \OxidEsales\EshopCommunity\Setup\View $view to set parameters for template
@param \OxidEsales\EshopCommunity\Setup\Language $language to translate text | [
"Show",
"warning",
"-",
"question",
"if",
"database",
"with",
"same",
"name",
"already",
"exists",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L554-L557 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.installShopData | private function installShopData($database, $demoDataRequired = 0)
{
$baseSqlDir = $this->getUtilitiesInstance()->getSqlDirectory(EditionSelector::COMMUNITY);
try {
// If demo data files are provided.
if ($demoDataRequired && $this->getUtilitiesInstance()->isDemodataPrepared()) {
$this->getUtilitiesInstance()->executeExternalDatabaseMigrationCommand();
// Install demo data.
$database->queryFile($this->getUtilitiesInstance()->getActiveEditionDemodataPackageSqlFilePath());
// Copy demo data files.
$this->getUtilitiesInstance()->executeExternalDemodataAssetsInstallCommand();
} else {
$database->queryFile("$baseSqlDir/initial_data.sql");
$this->getUtilitiesInstance()->executeExternalDatabaseMigrationCommand();
}
} catch (Exception $exception) {
$commandException = new CommandExecutionFailedException('Migration', $exception->getCode(), $exception);
$commandException->setCommandOutput([$exception->getMessage()]);
$this->handleCommandExecutionFailedException($commandException);
throw new SetupControllerExitException();
}
} | php | private function installShopData($database, $demoDataRequired = 0)
{
$baseSqlDir = $this->getUtilitiesInstance()->getSqlDirectory(EditionSelector::COMMUNITY);
try {
// If demo data files are provided.
if ($demoDataRequired && $this->getUtilitiesInstance()->isDemodataPrepared()) {
$this->getUtilitiesInstance()->executeExternalDatabaseMigrationCommand();
// Install demo data.
$database->queryFile($this->getUtilitiesInstance()->getActiveEditionDemodataPackageSqlFilePath());
// Copy demo data files.
$this->getUtilitiesInstance()->executeExternalDemodataAssetsInstallCommand();
} else {
$database->queryFile("$baseSqlDir/initial_data.sql");
$this->getUtilitiesInstance()->executeExternalDatabaseMigrationCommand();
}
} catch (Exception $exception) {
$commandException = new CommandExecutionFailedException('Migration', $exception->getCode(), $exception);
$commandException->setCommandOutput([$exception->getMessage()]);
$this->handleCommandExecutionFailedException($commandException);
throw new SetupControllerExitException();
}
} | [
"private",
"function",
"installShopData",
"(",
"$",
"database",
",",
"$",
"demoDataRequired",
"=",
"0",
")",
"{",
"$",
"baseSqlDir",
"=",
"$",
"this",
"->",
"getUtilitiesInstance",
"(",
")",
"->",
"getSqlDirectory",
"(",
"EditionSelector",
"::",
"COMMUNITY",
"... | Installs demo data or initial, dependent on parameter
@param \OxidEsales\EshopCommunity\Setup\Database $database
@param int $demoDataRequired
@throws SetupControllerExitException | [
"Installs",
"demo",
"data",
"or",
"initial",
"dependent",
"on",
"parameter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L607-L633 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.setViewOptions | protected function setViewOptions($templateFileName, $titleId, $viewOptions)
{
$view = $this->getView();
$view->setTemplateFileName($templateFileName);
$view->setTitle($titleId);
foreach ($viewOptions as $optionKey => $optionValue) {
$view->setViewParam($optionKey, $optionValue);
}
} | php | protected function setViewOptions($templateFileName, $titleId, $viewOptions)
{
$view = $this->getView();
$view->setTemplateFileName($templateFileName);
$view->setTitle($titleId);
foreach ($viewOptions as $optionKey => $optionValue) {
$view->setViewParam($optionKey, $optionValue);
}
} | [
"protected",
"function",
"setViewOptions",
"(",
"$",
"templateFileName",
",",
"$",
"titleId",
",",
"$",
"viewOptions",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"$",
"view",
"->",
"setTemplateFileName",
"(",
"$",
"templateFil... | Allows to set all necessary view information with single method call.
@param string $templateFileName File name of template which will be used to pass in the context data.
@param string $titleId Title Id which will be used in the template.
@param array $viewOptions An array containing all view elements to be used inside a template. | [
"Allows",
"to",
"set",
"all",
"necessary",
"view",
"information",
"with",
"single",
"method",
"call",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L642-L651 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.getModuleStateMapGenerator | private function getModuleStateMapGenerator($systemRequirementsInfo)
{
$setup = $this->getSetupInstance();
$language = $this->getLanguageInstance();
$moduleStateMapGenerator = new Controller\ModuleStateMapGenerator($systemRequirementsInfo);
$moduleStateMapGenerator->setModuleStateHtmlClassConvertFunction(function ($moduleState) use ($setup) {
return $setup->getModuleClass($moduleState);
});
$moduleStateMapGenerator->setModuleNameTranslateFunction(function ($moduleId) use ($language) {
return $language->getModuleName($moduleId);
});
$moduleStateMapGenerator->setModuleGroupNameTranslateFunction(function ($moduleGroupId) use ($language) {
return $language->getModuleName($moduleGroupId);
});
return $moduleStateMapGenerator;
} | php | private function getModuleStateMapGenerator($systemRequirementsInfo)
{
$setup = $this->getSetupInstance();
$language = $this->getLanguageInstance();
$moduleStateMapGenerator = new Controller\ModuleStateMapGenerator($systemRequirementsInfo);
$moduleStateMapGenerator->setModuleStateHtmlClassConvertFunction(function ($moduleState) use ($setup) {
return $setup->getModuleClass($moduleState);
});
$moduleStateMapGenerator->setModuleNameTranslateFunction(function ($moduleId) use ($language) {
return $language->getModuleName($moduleId);
});
$moduleStateMapGenerator->setModuleGroupNameTranslateFunction(function ($moduleGroupId) use ($language) {
return $language->getModuleName($moduleGroupId);
});
return $moduleStateMapGenerator;
} | [
"private",
"function",
"getModuleStateMapGenerator",
"(",
"$",
"systemRequirementsInfo",
")",
"{",
"$",
"setup",
"=",
"$",
"this",
"->",
"getSetupInstance",
"(",
")",
";",
"$",
"language",
"=",
"$",
"this",
"->",
"getLanguageInstance",
"(",
")",
";",
"$",
"m... | Getter for ModuleStateMapGenerator.
Returns an instance of ModuleStateMapGenerator which has all necessary functions predefined:
- StateHtmlClassConverterFunction to convert module state to HTML class attribute for setup page;
- ModuleNameTranslateFunction to translate requirement module id to it's full name;
- ModuleGroupNameTranslateFunction to translate requirement module group id to it's full name.
@param array $systemRequirementsInfo
@return ModuleStateMapGenerator | [
"Getter",
"for",
"ModuleStateMapGenerator",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L666-L684 | train |
OXID-eSales/oxideshop_ce | source/Setup/Controller.php | Controller.ensureDatabasePresent | private function ensureDatabasePresent($database, $dbName)
{
try {
// if database is not there, try to create it
$database->createDb($dbName);
} catch (Exception $exception) {
$setup = $this->getSetupInstance();
$setup->setNextStep($setup->getStep('STEP_DB_INFO'));
$this->getView()->setMessage($exception->getMessage());
throw new SetupControllerExitException();
}
$this->getView()->setViewParam("blCreated", 1);
} | php | private function ensureDatabasePresent($database, $dbName)
{
try {
// if database is not there, try to create it
$database->createDb($dbName);
} catch (Exception $exception) {
$setup = $this->getSetupInstance();
$setup->setNextStep($setup->getStep('STEP_DB_INFO'));
$this->getView()->setMessage($exception->getMessage());
throw new SetupControllerExitException();
}
$this->getView()->setViewParam("blCreated", 1);
} | [
"private",
"function",
"ensureDatabasePresent",
"(",
"$",
"database",
",",
"$",
"dbName",
")",
"{",
"try",
"{",
"// if database is not there, try to create it",
"$",
"database",
"->",
"createDb",
"(",
"$",
"dbName",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",... | Ensure the database is available
@throws \OxidEsales\EshopCommunity\Setup\Exception\SetupControllerExitException
@param \OxidEsales\EshopCommunity\Setup\Database $database
@param string $dbName
@throws SetupControllerExitException | [
"Ensure",
"the",
"database",
"is",
"available"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Controller.php#L795-L808 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleOverview.php | ArticleOverview.render | public function render()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
parent::render();
$this->_aViewData['edit'] = $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$soxId = $this->getEditObjectId();
if (isset($soxId) && $soxId != "-1") {
$oDB = $this->getDatabase();
// load object
$this->updateArticle($oArticle, $soxId);
$sShopID = $myConfig->getShopID();
$sSelect = $this->formOrderAmountQuery($soxId);
$this->_aViewData["totalordercnt"] = $iTotalOrderCnt = (float) $oDB->getOne($sSelect);
$sSelect = $this->formSoldOutAmountQuery($soxId);
$this->_aViewData["soldcnt"] = $iSoldCnt = (float) $oDB->getOne($sSelect);
$sSelect = $this->formCanceledAmountQuery($soxId);
$this->_aViewData["canceledcnt"] = $iCanceledCnt = (float) $oDB->getOne($sSelect);
// not yet processed
$this->_aViewData["leftordercnt"] = $iTotalOrderCnt - $iSoldCnt - $iCanceledCnt;
// position in top ten
$sSelect = "select oxartid,sum(oxamount) as cnt from oxorderarticles " .
"where oxordershopid = '{$sShopID}' group by oxartid order by cnt desc";
$rs = $oDB->select($sSelect);
$iTopPos = 0;
$iPos = 0;
if ($rs != false && $rs->count() > 0) {
while (!$rs->EOF) {
$iPos++;
if ($rs->fields[0] == $soxId) {
$iTopPos = $iPos;
}
$rs->fetchRow();
}
}
$this->_aViewData["postopten"] = $iTopPos;
$this->_aViewData["toptentotal"] = $iPos;
}
$this->_aViewData["afolder"] = $myConfig->getConfigParam('aProductfolder');
$this->_aViewData["aSubclass"] = $myConfig->getConfigParam('aArticleClasses');
return "article_overview.tpl";
} | php | public function render()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
parent::render();
$this->_aViewData['edit'] = $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$soxId = $this->getEditObjectId();
if (isset($soxId) && $soxId != "-1") {
$oDB = $this->getDatabase();
// load object
$this->updateArticle($oArticle, $soxId);
$sShopID = $myConfig->getShopID();
$sSelect = $this->formOrderAmountQuery($soxId);
$this->_aViewData["totalordercnt"] = $iTotalOrderCnt = (float) $oDB->getOne($sSelect);
$sSelect = $this->formSoldOutAmountQuery($soxId);
$this->_aViewData["soldcnt"] = $iSoldCnt = (float) $oDB->getOne($sSelect);
$sSelect = $this->formCanceledAmountQuery($soxId);
$this->_aViewData["canceledcnt"] = $iCanceledCnt = (float) $oDB->getOne($sSelect);
// not yet processed
$this->_aViewData["leftordercnt"] = $iTotalOrderCnt - $iSoldCnt - $iCanceledCnt;
// position in top ten
$sSelect = "select oxartid,sum(oxamount) as cnt from oxorderarticles " .
"where oxordershopid = '{$sShopID}' group by oxartid order by cnt desc";
$rs = $oDB->select($sSelect);
$iTopPos = 0;
$iPos = 0;
if ($rs != false && $rs->count() > 0) {
while (!$rs->EOF) {
$iPos++;
if ($rs->fields[0] == $soxId) {
$iTopPos = $iPos;
}
$rs->fetchRow();
}
}
$this->_aViewData["postopten"] = $iTopPos;
$this->_aViewData["toptentotal"] = $iPos;
}
$this->_aViewData["afolder"] = $myConfig->getConfigParam('aProductfolder');
$this->_aViewData["aSubclass"] = $myConfig->getConfigParam('aArticleClasses');
return "article_overview.tpl";
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"this",
"->",
"_aViewData",
"[",
"... | Loads article overview data, passes to Smarty engine and returns name
of template file "article_overview.tpl".
@return string | [
"Loads",
"article",
"overview",
"data",
"passes",
"to",
"Smarty",
"engine",
"and",
"returns",
"name",
"of",
"template",
"file",
"article_overview",
".",
"tpl",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleOverview.php#L26-L80 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleOverview.php | ArticleOverview.updateArticle | protected function updateArticle($article, $oxId)
{
$article->loadInLang(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editlanguage"), $oxId);
return $article;
} | php | protected function updateArticle($article, $oxId)
{
$article->loadInLang(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editlanguage"), $oxId);
return $article;
} | [
"protected",
"function",
"updateArticle",
"(",
"$",
"article",
",",
"$",
"oxId",
")",
"{",
"$",
"article",
"->",
"loadInLang",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
... | Loads language for article object.
@param \OxidEsales\Eshop\Application\Model\Article $article
@param string $oxId
@return \OxidEsales\Eshop\Application\Model\Article | [
"Loads",
"language",
"for",
"article",
"object",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleOverview.php#L141-L146 | train |
OXID-eSales/oxideshop_ce | source/Core/NamespaceInformationProvider.php | NamespaceInformationProvider.classBelongsToShopUnifiedNamespace | public static function classBelongsToShopUnifiedNamespace($className)
{
$lcClassName = strtolower(ltrim($className, '\\'));
$unifiedNamespace = static::getUnifiedNamespace();
$belongsToUnifiedNamespace = (false !== strpos($lcClassName, strtolower($unifiedNamespace)));
return $belongsToUnifiedNamespace;
} | php | public static function classBelongsToShopUnifiedNamespace($className)
{
$lcClassName = strtolower(ltrim($className, '\\'));
$unifiedNamespace = static::getUnifiedNamespace();
$belongsToUnifiedNamespace = (false !== strpos($lcClassName, strtolower($unifiedNamespace)));
return $belongsToUnifiedNamespace;
} | [
"public",
"static",
"function",
"classBelongsToShopUnifiedNamespace",
"(",
"$",
"className",
")",
"{",
"$",
"lcClassName",
"=",
"strtolower",
"(",
"ltrim",
"(",
"$",
"className",
",",
"'\\\\'",
")",
")",
";",
"$",
"unifiedNamespace",
"=",
"static",
"::",
"getU... | Check if given class belongs to a shop edition namespace.
@param string $className
@return bool | [
"Check",
"if",
"given",
"class",
"belongs",
"to",
"a",
"shop",
"edition",
"namespace",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/NamespaceInformationProvider.php#L98-L105 | train |
OXID-eSales/oxideshop_ce | source/Core/NamespaceInformationProvider.php | NamespaceInformationProvider.classBelongsToNamespace | private static function classBelongsToNamespace($className, $namespaces)
{
$belongsToNamespace = false;
$check = array_values($namespaces);
$lcClassName = strtolower(ltrim($className, '\\'));
foreach ($check as $namespace) {
if (false !== strpos($lcClassName, strtolower($namespace))) {
$belongsToNamespace = true;
continue;
}
}
return $belongsToNamespace;
} | php | private static function classBelongsToNamespace($className, $namespaces)
{
$belongsToNamespace = false;
$check = array_values($namespaces);
$lcClassName = strtolower(ltrim($className, '\\'));
foreach ($check as $namespace) {
if (false !== strpos($lcClassName, strtolower($namespace))) {
$belongsToNamespace = true;
continue;
}
}
return $belongsToNamespace;
} | [
"private",
"static",
"function",
"classBelongsToNamespace",
"(",
"$",
"className",
",",
"$",
"namespaces",
")",
"{",
"$",
"belongsToNamespace",
"=",
"false",
";",
"$",
"check",
"=",
"array_values",
"(",
"$",
"namespaces",
")",
";",
"$",
"lcClassName",
"=",
"... | Check if given class belongs to one of the supplied namespaces.
@param string $className
@param array $namespaces
@return bool | [
"Check",
"if",
"given",
"class",
"belongs",
"to",
"one",
"of",
"the",
"supplied",
"namespaces",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/NamespaceInformationProvider.php#L115-L128 | train |
OXID-eSales/oxideshop_ce | source/Core/PictureHandler.php | PictureHandler.deleteArticleMasterPicture | public function deleteArticleMasterPicture($oObject, $iIndex, $blDeleteMasterPicture = true)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$myUtilsPic = \OxidEsales\Eshop\Core\Registry::getUtilsPic();
$oUtilsFile = \OxidEsales\Eshop\Core\Registry::getUtilsFile();
$blGeneratedImagesOnly = !$blDeleteMasterPicture;
$sAbsDynImageDir = $myConfig->getPictureDir(false);
$sMasterImage = basename($oObject->{"oxarticles__oxpic" . $iIndex}->value);
if (!$sMasterImage || $sMasterImage == "nopic.jpg") {
return;
}
$aPic = ["sField" => "oxpic" . $iIndex,
"sDir" => $oUtilsFile->getImageDirByType("M" . $iIndex, $blGeneratedImagesOnly),
"sFileName" => $sMasterImage];
$blDeleted = $myUtilsPic->safePictureDelete($aPic["sFileName"], $sAbsDynImageDir . $aPic["sDir"], "oxarticles", $aPic["sField"]);
if ($blDeleted) {
$this->deleteZoomPicture($oObject, $iIndex);
$aDelPics = [];
if ($iIndex == 1) {
// deleting generated main icon picture if custom main icon
// file name not equal with generated from master picture
if ($this->getMainIconName($sMasterImage) != basename($oObject->oxarticles__oxicon->value)) {
$aDelPics[] = ["sField" => "oxpic1",
"sDir" => $oUtilsFile->getImageDirByType("ICO", $blGeneratedImagesOnly),
"sFileName" => $this->getMainIconName($sMasterImage)];
}
// deleting generated thumbnail picture if custom thumbnail
// file name not equal with generated from master picture
if ($this->getThumbName($sMasterImage) != basename($oObject->oxarticles__oxthumb->value)) {
$aDelPics[] = ["sField" => "oxpic1",
"sDir" => $oUtilsFile->getImageDirByType("TH", $blGeneratedImagesOnly),
"sFileName" => $this->getThumbName($sMasterImage)];
}
}
foreach ($aDelPics as $aPic) {
$myUtilsPic->safePictureDelete($aPic["sFileName"], $sAbsDynImageDir . $aPic["sDir"], "oxarticles", $aPic["sField"]);
}
}
//deleting custom zoom pic (compatibility mode)
if ($oObject->{"oxarticles__oxzoom" . $iIndex}->value) {
if (basename($oObject->{"oxarticles__oxzoom" . $iIndex}->value) !== "nopic.jpg") {
// deleting old zoom picture
$this->deleteZoomPicture($oObject, $iIndex);
}
}
} | php | public function deleteArticleMasterPicture($oObject, $iIndex, $blDeleteMasterPicture = true)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$myUtilsPic = \OxidEsales\Eshop\Core\Registry::getUtilsPic();
$oUtilsFile = \OxidEsales\Eshop\Core\Registry::getUtilsFile();
$blGeneratedImagesOnly = !$blDeleteMasterPicture;
$sAbsDynImageDir = $myConfig->getPictureDir(false);
$sMasterImage = basename($oObject->{"oxarticles__oxpic" . $iIndex}->value);
if (!$sMasterImage || $sMasterImage == "nopic.jpg") {
return;
}
$aPic = ["sField" => "oxpic" . $iIndex,
"sDir" => $oUtilsFile->getImageDirByType("M" . $iIndex, $blGeneratedImagesOnly),
"sFileName" => $sMasterImage];
$blDeleted = $myUtilsPic->safePictureDelete($aPic["sFileName"], $sAbsDynImageDir . $aPic["sDir"], "oxarticles", $aPic["sField"]);
if ($blDeleted) {
$this->deleteZoomPicture($oObject, $iIndex);
$aDelPics = [];
if ($iIndex == 1) {
// deleting generated main icon picture if custom main icon
// file name not equal with generated from master picture
if ($this->getMainIconName($sMasterImage) != basename($oObject->oxarticles__oxicon->value)) {
$aDelPics[] = ["sField" => "oxpic1",
"sDir" => $oUtilsFile->getImageDirByType("ICO", $blGeneratedImagesOnly),
"sFileName" => $this->getMainIconName($sMasterImage)];
}
// deleting generated thumbnail picture if custom thumbnail
// file name not equal with generated from master picture
if ($this->getThumbName($sMasterImage) != basename($oObject->oxarticles__oxthumb->value)) {
$aDelPics[] = ["sField" => "oxpic1",
"sDir" => $oUtilsFile->getImageDirByType("TH", $blGeneratedImagesOnly),
"sFileName" => $this->getThumbName($sMasterImage)];
}
}
foreach ($aDelPics as $aPic) {
$myUtilsPic->safePictureDelete($aPic["sFileName"], $sAbsDynImageDir . $aPic["sDir"], "oxarticles", $aPic["sField"]);
}
}
//deleting custom zoom pic (compatibility mode)
if ($oObject->{"oxarticles__oxzoom" . $iIndex}->value) {
if (basename($oObject->{"oxarticles__oxzoom" . $iIndex}->value) !== "nopic.jpg") {
// deleting old zoom picture
$this->deleteZoomPicture($oObject, $iIndex);
}
}
} | [
"public",
"function",
"deleteArticleMasterPicture",
"(",
"$",
"oObject",
",",
"$",
"iIndex",
",",
"$",
"blDeleteMasterPicture",
"=",
"true",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
... | Deletes master picture and all images generated from it.
If third parameter is false, skips master image delete, only
all generated images will be deleted.
@param \OxidEsales\Eshop\Application\Model\Article $oObject article object
@param int $iIndex master picture index
@param bool $blDeleteMasterPicture delete master picture, default is true
@return null | [
"Deletes",
"master",
"picture",
"and",
"all",
"images",
"generated",
"from",
"it",
".",
"If",
"third",
"parameter",
"is",
"false",
"skips",
"master",
"image",
"delete",
"only",
"all",
"generated",
"images",
"will",
"be",
"deleted",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PictureHandler.php#L25-L77 | train |
OXID-eSales/oxideshop_ce | source/Core/PictureHandler.php | PictureHandler.deleteMainIcon | public function deleteMainIcon($oObject)
{
if (($sMainIcon = $oObject->oxarticles__oxicon->value)) {
$sPath = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureDir(false) . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType("ICO");
\OxidEsales\Eshop\Core\Registry::getUtilsPic()->safePictureDelete($sMainIcon, $sPath, "oxarticles", "oxicon");
}
} | php | public function deleteMainIcon($oObject)
{
if (($sMainIcon = $oObject->oxarticles__oxicon->value)) {
$sPath = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureDir(false) . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType("ICO");
\OxidEsales\Eshop\Core\Registry::getUtilsPic()->safePictureDelete($sMainIcon, $sPath, "oxarticles", "oxicon");
}
} | [
"public",
"function",
"deleteMainIcon",
"(",
"$",
"oObject",
")",
"{",
"if",
"(",
"(",
"$",
"sMainIcon",
"=",
"$",
"oObject",
"->",
"oxarticles__oxicon",
"->",
"value",
")",
")",
"{",
"$",
"sPath",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
... | Deletes custom main icon, which name is specified in oxicon field.
@param \OxidEsales\Eshop\Application\Model\Article $oObject article object | [
"Deletes",
"custom",
"main",
"icon",
"which",
"name",
"is",
"specified",
"in",
"oxicon",
"field",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PictureHandler.php#L84-L90 | train |
OXID-eSales/oxideshop_ce | source/Core/PictureHandler.php | PictureHandler.deleteThumbnail | public function deleteThumbnail($oObject)
{
if (($sThumb = $oObject->oxarticles__oxthumb->value)) {
// deleting article main icon and thumb picture
$sPath = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureDir(false) . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType("TH");
\OxidEsales\Eshop\Core\Registry::getUtilsPic()->safePictureDelete($sThumb, $sPath, "oxarticles", "oxthumb");
}
} | php | public function deleteThumbnail($oObject)
{
if (($sThumb = $oObject->oxarticles__oxthumb->value)) {
// deleting article main icon and thumb picture
$sPath = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureDir(false) . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType("TH");
\OxidEsales\Eshop\Core\Registry::getUtilsPic()->safePictureDelete($sThumb, $sPath, "oxarticles", "oxthumb");
}
} | [
"public",
"function",
"deleteThumbnail",
"(",
"$",
"oObject",
")",
"{",
"if",
"(",
"(",
"$",
"sThumb",
"=",
"$",
"oObject",
"->",
"oxarticles__oxthumb",
"->",
"value",
")",
")",
"{",
"// deleting article main icon and thumb picture",
"$",
"sPath",
"=",
"\\",
"... | Deletes custom thumbnail, which name is specified in oxthumb field.
@param \OxidEsales\Eshop\Application\Model\Article $oObject article object | [
"Deletes",
"custom",
"thumbnail",
"which",
"name",
"is",
"specified",
"in",
"oxthumb",
"field",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PictureHandler.php#L97-L104 | train |
OXID-eSales/oxideshop_ce | source/Core/PictureHandler.php | PictureHandler.deleteZoomPicture | public function deleteZoomPicture($oObject, $iIndex)
{
// checking if oxzoom field exists
$oDbHandler = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
$iZoomPicCount = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iZoomPicCount');
if ($iIndex > $iZoomPicCount || !$oDbHandler->fieldExists("oxzoom" . $iIndex, "oxarticles")) {
if ($sZoomPicName = $this->getZoomName($oObject->{"oxarticles__oxpic" . $iIndex}->value, $iIndex)) {
$sFieldToCheck = "oxpic" . $iIndex;
} else {
return;
}
} else {
$sZoomPicName = basename($oObject->{"oxarticles__oxzoom" . $iIndex}->value);
$sFieldToCheck = "oxzoom" . $iIndex;
}
if ($sZoomPicName && $sZoomPicName != "nopic.jpg") {
// deleting zoom picture
$sPath = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureDir(false) . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType("Z" . $iIndex);
\OxidEsales\Eshop\Core\Registry::getUtilsPic()->safePictureDelete($sZoomPicName, $sPath, "oxarticles", $sFieldToCheck);
}
} | php | public function deleteZoomPicture($oObject, $iIndex)
{
// checking if oxzoom field exists
$oDbHandler = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);
$iZoomPicCount = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iZoomPicCount');
if ($iIndex > $iZoomPicCount || !$oDbHandler->fieldExists("oxzoom" . $iIndex, "oxarticles")) {
if ($sZoomPicName = $this->getZoomName($oObject->{"oxarticles__oxpic" . $iIndex}->value, $iIndex)) {
$sFieldToCheck = "oxpic" . $iIndex;
} else {
return;
}
} else {
$sZoomPicName = basename($oObject->{"oxarticles__oxzoom" . $iIndex}->value);
$sFieldToCheck = "oxzoom" . $iIndex;
}
if ($sZoomPicName && $sZoomPicName != "nopic.jpg") {
// deleting zoom picture
$sPath = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureDir(false) . \OxidEsales\Eshop\Core\Registry::getUtilsFile()->getImageDirByType("Z" . $iIndex);
\OxidEsales\Eshop\Core\Registry::getUtilsPic()->safePictureDelete($sZoomPicName, $sPath, "oxarticles", $sFieldToCheck);
}
} | [
"public",
"function",
"deleteZoomPicture",
"(",
"$",
"oObject",
",",
"$",
"iIndex",
")",
"{",
"// checking if oxzoom field exists",
"$",
"oDbHandler",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DbMetaDataHandler",
"::",
"class",
"... | Deletes custom zoom picture, which name is specified in oxzoom field.
@param \OxidEsales\Eshop\Application\Model\Article $oObject article object
@param int $iIndex zoom picture index
@return null | [
"Deletes",
"custom",
"zoom",
"picture",
"which",
"name",
"is",
"specified",
"in",
"oxzoom",
"field",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PictureHandler.php#L114-L136 | train |
OXID-eSales/oxideshop_ce | source/Core/PictureHandler.php | PictureHandler.getImageSize | public function getImageSize($aImgSizes, $sIndex = null)
{
$aSize = [];
if (isset($sIndex) && is_array($aImgSizes) && isset($aImgSizes[$sIndex])) {
$aSize = explode('*', $aImgSizes[$sIndex]);
} elseif (is_string($aImgSizes)) {
$aSize = explode('*', $aImgSizes);
}
if (is_array($aSize) && 2 == count($aSize)) {
$x = (int) $aSize[0];
$y = (int) $aSize[1];
if ($x && $y) {
return $aSize;
}
}
return null;
} | php | public function getImageSize($aImgSizes, $sIndex = null)
{
$aSize = [];
if (isset($sIndex) && is_array($aImgSizes) && isset($aImgSizes[$sIndex])) {
$aSize = explode('*', $aImgSizes[$sIndex]);
} elseif (is_string($aImgSizes)) {
$aSize = explode('*', $aImgSizes);
}
if (is_array($aSize) && 2 == count($aSize)) {
$x = (int) $aSize[0];
$y = (int) $aSize[1];
if ($x && $y) {
return $aSize;
}
}
return null;
} | [
"public",
"function",
"getImageSize",
"(",
"$",
"aImgSizes",
",",
"$",
"sIndex",
"=",
"null",
")",
"{",
"$",
"aSize",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"sIndex",
")",
"&&",
"is_array",
"(",
"$",
"aImgSizes",
")",
"&&",
"isset",
"(",... | Returns image sizes from provided config array
@param mixed $aImgSizes array or string of sizes in format x*y
@param string $sIndex index in array
@return array | [
"Returns",
"image",
"sizes",
"from",
"provided",
"config",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PictureHandler.php#L207-L224 | train |
OXID-eSales/oxideshop_ce | source/Core/PictureHandler.php | PictureHandler.getAltImageUrl | public function getAltImageUrl($sFilePath, $sFile, $blSSL = null)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sAltUrl = $oConfig->getConfigParam('sAltImageUrl');
if (!$sAltUrl) {
$sAltUrl = $oConfig->getConfigParam('sAltImageDir');
}
if ($sAltUrl) {
if ((is_null($blSSL) && $oConfig->isSsl()) || $blSSL) {
$sSslAltUrl = $oConfig->getConfigParam('sSSLAltImageUrl');
if (!$sSslAltUrl) {
$sSslAltUrl = $oConfig->getConfigParam('sSSLAltImageDir');
}
if ($sSslAltUrl) {
$sAltUrl = $sSslAltUrl;
}
}
if (!is_null($sFile)) {
$sAltUrl = Registry::getUtils()->checkUrlEndingSlash($sAltUrl) . $sFilePath . $sFile;
}
}
return $sAltUrl;
} | php | public function getAltImageUrl($sFilePath, $sFile, $blSSL = null)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sAltUrl = $oConfig->getConfigParam('sAltImageUrl');
if (!$sAltUrl) {
$sAltUrl = $oConfig->getConfigParam('sAltImageDir');
}
if ($sAltUrl) {
if ((is_null($blSSL) && $oConfig->isSsl()) || $blSSL) {
$sSslAltUrl = $oConfig->getConfigParam('sSSLAltImageUrl');
if (!$sSslAltUrl) {
$sSslAltUrl = $oConfig->getConfigParam('sSSLAltImageDir');
}
if ($sSslAltUrl) {
$sAltUrl = $sSslAltUrl;
}
}
if (!is_null($sFile)) {
$sAltUrl = Registry::getUtils()->checkUrlEndingSlash($sAltUrl) . $sFilePath . $sFile;
}
}
return $sAltUrl;
} | [
"public",
"function",
"getAltImageUrl",
"(",
"$",
"sFilePath",
",",
"$",
"sFile",
",",
"$",
"blSSL",
"=",
"null",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
... | Returns alternative image url
@param string $sFilePath path to file
@param string $sFile filename in pictures dir
@param bool $blSSL is ssl ?
@return string | [
"Returns",
"alternative",
"image",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PictureHandler.php#L266-L293 | train |
OXID-eSales/oxideshop_ce | source/Core/PictureHandler.php | PictureHandler.getPicUrl | public function getPicUrl($sPath, $sFile, $sSize, $sIndex = null, $sAltPath = false, $bSsl = null)
{
$sUrl = null;
if ($sPath && $sFile && ($aSize = $this->getImageSize($sSize, $sIndex))) {
$aPicInfo = $this->_getPictureInfo("master/" . ($sAltPath ? $sAltPath : $sPath), $sFile, $this->isAdmin(), $bSsl);
if ($aPicInfo['url'] && $aSize[0] && $aSize[1]) {
$sDirName = "{$aSize[0]}_{$aSize[1]}_" . \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sDefaultImageQuality');
$sUrl = str_replace("/master/" . ($sAltPath ? $sAltPath : $sPath), "/generated/{$sPath}{$sDirName}/", $aPicInfo['url']);
}
}
return $sUrl;
} | php | public function getPicUrl($sPath, $sFile, $sSize, $sIndex = null, $sAltPath = false, $bSsl = null)
{
$sUrl = null;
if ($sPath && $sFile && ($aSize = $this->getImageSize($sSize, $sIndex))) {
$aPicInfo = $this->_getPictureInfo("master/" . ($sAltPath ? $sAltPath : $sPath), $sFile, $this->isAdmin(), $bSsl);
if ($aPicInfo['url'] && $aSize[0] && $aSize[1]) {
$sDirName = "{$aSize[0]}_{$aSize[1]}_" . \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sDefaultImageQuality');
$sUrl = str_replace("/master/" . ($sAltPath ? $sAltPath : $sPath), "/generated/{$sPath}{$sDirName}/", $aPicInfo['url']);
}
}
return $sUrl;
} | [
"public",
"function",
"getPicUrl",
"(",
"$",
"sPath",
",",
"$",
"sFile",
",",
"$",
"sSize",
",",
"$",
"sIndex",
"=",
"null",
",",
"$",
"sAltPath",
"=",
"false",
",",
"$",
"bSsl",
"=",
"null",
")",
"{",
"$",
"sUrl",
"=",
"null",
";",
"if",
"(",
... | Returns requested picture url. If image is not available - returns false
@param string $sPath path from pictures/master/
@param string $sFile picture file name
@param string $sSize picture sizes (x, y)
@param string $sIndex picture index [optional]
@param string $sAltPath alternative picture path [optional]
@param bool $bSsl Whether to force SSL
@return string | bool | [
"Returns",
"requested",
"picture",
"url",
".",
"If",
"image",
"is",
"not",
"available",
"-",
"returns",
"false"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PictureHandler.php#L307-L319 | train |
OXID-eSales/oxideshop_ce | source/Core/PictureHandler.php | PictureHandler.getProductPicUrl | public function getProductPicUrl($sPath, $sFile, $sSize, $sIndex = null, $bSsl = null)
{
$sUrl = null;
if (!$sFile || !($sUrl = $this->getPicUrl($sPath, $sFile, $sSize, $sIndex, false, $bSsl))) {
$sUrl = $this->getPicUrl($sPath, "nopic.jpg", $sSize, $sIndex, "/", $bSsl);
}
return $sUrl;
} | php | public function getProductPicUrl($sPath, $sFile, $sSize, $sIndex = null, $bSsl = null)
{
$sUrl = null;
if (!$sFile || !($sUrl = $this->getPicUrl($sPath, $sFile, $sSize, $sIndex, false, $bSsl))) {
$sUrl = $this->getPicUrl($sPath, "nopic.jpg", $sSize, $sIndex, "/", $bSsl);
}
return $sUrl;
} | [
"public",
"function",
"getProductPicUrl",
"(",
"$",
"sPath",
",",
"$",
"sFile",
",",
"$",
"sSize",
",",
"$",
"sIndex",
"=",
"null",
",",
"$",
"bSsl",
"=",
"null",
")",
"{",
"$",
"sUrl",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"sFile",
"||",
"!",
... | Returns requested product picture url. If image is not available - returns url to nopic.jpg
@param string $sPath path from pictures/master/
@param string $sFile picture file name
@param string $sSize picture sizes (x, y)
@param string $sIndex picture index [optional]
@param bool $bSsl Whether to force SSL
@return string | bool | [
"Returns",
"requested",
"product",
"picture",
"url",
".",
"If",
"image",
"is",
"not",
"available",
"-",
"returns",
"url",
"to",
"nopic",
".",
"jpg"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PictureHandler.php#L332-L340 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.