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/Core/ViewConfig.php | ViewConfig.getNrOfCatArticles | public function getNrOfCatArticles()
{
$sListType = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('ldtype');
if (is_null($sListType)) {
$sListType = $this->getConfig()->getConfigParam('sDefaultListDisplayType');
}
if ('grid' === $sListType) {
$aNrOfCatArticles = $this->getConfig()->getConfigParam('aNrofCatArticlesInGrid');
} else {
$aNrOfCatArticles = $this->getConfig()->getConfigParam('aNrofCatArticles');
}
return $aNrOfCatArticles;
} | php | public function getNrOfCatArticles()
{
$sListType = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('ldtype');
if (is_null($sListType)) {
$sListType = $this->getConfig()->getConfigParam('sDefaultListDisplayType');
}
if ('grid' === $sListType) {
$aNrOfCatArticles = $this->getConfig()->getConfigParam('aNrofCatArticlesInGrid');
} else {
$aNrOfCatArticles = $this->getConfig()->getConfigParam('aNrofCatArticles');
}
return $aNrOfCatArticles;
} | [
"public",
"function",
"getNrOfCatArticles",
"(",
")",
"{",
"$",
"sListType",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
"'ldtype'",
")",
";",
"if",
"(",
"is_null",
"(",
... | Returns config param "aNrofCatArticles" value
@return array | [
"Returns",
"config",
"param",
"aNrofCatArticles",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L799-L814 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getShowCompareList | public function getShowCompareList()
{
$myConfig = $this->getConfig();
$blShowCompareList = true;
if (!$myConfig->getConfigParam('bl_showCompareList') ||
($myConfig->getConfigParam('blDisableNavBars') && $myConfig->getActiveView()->getIsOrderStep())
) {
$blShowCompareList = false;
}
return $blShowCompareList;
} | php | public function getShowCompareList()
{
$myConfig = $this->getConfig();
$blShowCompareList = true;
if (!$myConfig->getConfigParam('bl_showCompareList') ||
($myConfig->getConfigParam('blDisableNavBars') && $myConfig->getActiveView()->getIsOrderStep())
) {
$blShowCompareList = false;
}
return $blShowCompareList;
} | [
"public",
"function",
"getShowCompareList",
"(",
")",
"{",
"$",
"myConfig",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"$",
"blShowCompareList",
"=",
"true",
";",
"if",
"(",
"!",
"$",
"myConfig",
"->",
"getConfigParam",
"(",
"'bl_showCompareList'",
... | Returns config param "bl_showCompareList" value
@return bool | [
"Returns",
"config",
"param",
"bl_showCompareList",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L831-L843 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getActLanguageId | public function getActLanguageId()
{
if (($sValue = $this->getViewConfigParam('lang')) === null) {
$iLang = $this->getConfig()->getRequestParameter('lang');
$sValue = ($iLang !== null) ? $iLang : \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
$this->setViewConfigParam('lang', $sValue);
}
return $sValue;
} | php | public function getActLanguageId()
{
if (($sValue = $this->getViewConfigParam('lang')) === null) {
$iLang = $this->getConfig()->getRequestParameter('lang');
$sValue = ($iLang !== null) ? $iLang : \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
$this->setViewConfigParam('lang', $sValue);
}
return $sValue;
} | [
"public",
"function",
"getActLanguageId",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"sValue",
"=",
"$",
"this",
"->",
"getViewConfigParam",
"(",
"'lang'",
")",
")",
"===",
"null",
")",
"{",
"$",
"iLang",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",... | Returns session language id
@return string | [
"Returns",
"session",
"language",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L894-L903 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getNavUrlParams | public function getNavUrlParams()
{
if (($sParams = $this->getViewConfigParam('navurlparams')) === null) {
$sParams = '';
$aNavParams = $this->getConfig()->getActiveView()->getNavigationParams();
foreach ($aNavParams as $sName => $sValue) {
if (isset($sValue)) {
if ($sParams) {
$sParams .= '&';
}
$sParams .= "{$sName}=" . rawurlencode($sValue);
}
}
if ($sParams) {
$sParams = '&' . $sParams;
}
$this->setViewConfigParam('navurlparams', $sParams);
}
return $sParams;
} | php | public function getNavUrlParams()
{
if (($sParams = $this->getViewConfigParam('navurlparams')) === null) {
$sParams = '';
$aNavParams = $this->getConfig()->getActiveView()->getNavigationParams();
foreach ($aNavParams as $sName => $sValue) {
if (isset($sValue)) {
if ($sParams) {
$sParams .= '&';
}
$sParams .= "{$sName}=" . rawurlencode($sValue);
}
}
if ($sParams) {
$sParams = '&' . $sParams;
}
$this->setViewConfigParam('navurlparams', $sParams);
}
return $sParams;
} | [
"public",
"function",
"getNavUrlParams",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"sParams",
"=",
"$",
"this",
"->",
"getViewConfigParam",
"(",
"'navurlparams'",
")",
")",
"===",
"null",
")",
"{",
"$",
"sParams",
"=",
"''",
";",
"$",
"aNavParams",
"=",
"$",... | Returns navigation url parameters
@return string | [
"Returns",
"navigation",
"url",
"parameters"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L951-L971 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getNavFormParams | public function getNavFormParams()
{
if (($sParams = $this->getViewConfigParam('navformparams')) === null) {
$oStr = getStr();
$sParams = '';
$aNavParams = $this->getConfig()->getTopActiveView()->getNavigationParams();
foreach ($aNavParams as $sName => $sValue) {
if (isset($sValue)) {
$sParams .= "<input type=\"hidden\" name=\"{$sName}\" value=\"";
$sParams .= $oStr->htmlentities($sValue) . "\" />\n";
}
}
$this->setViewConfigParam('navformparams', $sParams);
}
return $sParams;
} | php | public function getNavFormParams()
{
if (($sParams = $this->getViewConfigParam('navformparams')) === null) {
$oStr = getStr();
$sParams = '';
$aNavParams = $this->getConfig()->getTopActiveView()->getNavigationParams();
foreach ($aNavParams as $sName => $sValue) {
if (isset($sValue)) {
$sParams .= "<input type=\"hidden\" name=\"{$sName}\" value=\"";
$sParams .= $oStr->htmlentities($sValue) . "\" />\n";
}
}
$this->setViewConfigParam('navformparams', $sParams);
}
return $sParams;
} | [
"public",
"function",
"getNavFormParams",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"sParams",
"=",
"$",
"this",
"->",
"getViewConfigParam",
"(",
"'navformparams'",
")",
")",
"===",
"null",
")",
"{",
"$",
"oStr",
"=",
"getStr",
"(",
")",
";",
"$",
"sParams",... | Returns navigation forms parameters
@return string | [
"Returns",
"navigation",
"forms",
"parameters"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L978-L995 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.isMultiShop | public function isMultiShop()
{
$oShop = $this->getConfig()->getActiveShop();
return isset($oShop->oxshops__oxismultishop) ? ((bool) $oShop->oxshops__oxismultishop->value) : false;
} | php | public function isMultiShop()
{
$oShop = $this->getConfig()->getActiveShop();
return isset($oShop->oxshops__oxismultishop) ? ((bool) $oShop->oxshops__oxismultishop->value) : false;
} | [
"public",
"function",
"isMultiShop",
"(",
")",
"{",
"$",
"oShop",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"getActiveShop",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"oShop",
"->",
"oxshops__oxismultishop",
")",
"?",
"(",
"(",
"bool",
")"... | Returns multishop status
@return bool | [
"Returns",
"multishop",
"status"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1042-L1047 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getBasketTimeLeft | public function getBasketTimeLeft()
{
if (!isset($this->_dBasketTimeLeft)) {
$this->_dBasketTimeLeft = $this->getSession()->getBasketReservations()->getTimeLeft();
}
return $this->_dBasketTimeLeft;
} | php | public function getBasketTimeLeft()
{
if (!isset($this->_dBasketTimeLeft)) {
$this->_dBasketTimeLeft = $this->getSession()->getBasketReservations()->getTimeLeft();
}
return $this->_dBasketTimeLeft;
} | [
"public",
"function",
"getBasketTimeLeft",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_dBasketTimeLeft",
")",
")",
"{",
"$",
"this",
"->",
"_dBasketTimeLeft",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getBasketReservation... | return the seconds left until basket expiration
@return int | [
"return",
"the",
"seconds",
"left",
"until",
"basket",
"expiration"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1108-L1115 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getCountryList | public function getCountryList()
{
if ($this->_oCountryList === null) {
// passing country list
$this->_oCountryList = oxNew(\OxidEsales\Eshop\Application\Model\CountryList::class);
$this->_oCountryList->loadActiveCountries();
}
return $this->_oCountryList;
} | php | public function getCountryList()
{
if ($this->_oCountryList === null) {
// passing country list
$this->_oCountryList = oxNew(\OxidEsales\Eshop\Application\Model\CountryList::class);
$this->_oCountryList->loadActiveCountries();
}
return $this->_oCountryList;
} | [
"public",
"function",
"getCountryList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oCountryList",
"===",
"null",
")",
"{",
"// passing country list",
"$",
"this",
"->",
"_oCountryList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Applica... | Return country list
@return oxcountrylist | [
"Return",
"country",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1142-L1151 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getModulePath | public function getModulePath($sModule, $sFile = '')
{
if (!$sFile || ($sFile[0] != '/')) {
$sFile = '/' . $sFile;
}
$oModule = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
$sModulePath = $oModule->getModulePath($sModule);
$sFile = $this->getConfig()->getModulesDir() . $sModulePath . $sFile;
if (file_exists($sFile) || is_dir($sFile)) {
return $sFile;
} else {
/**
* Do not call oxNew in the exception handling of the module subsystem system, as the same module system will be
* involved when calling oxNew
*/
$exception = new \OxidEsales\Eshop\Core\Exception\FileException("Requested file not found for module $sModule ($sFile)");
if ($this->getConfig()->getConfigParam('iDebug')) {
throw $exception;
} else {
/**
* This error should be reported, as it will be the cause of an unexpected behavior of the shop an the
* operator should be given a chance to analyse the issue.
*/
\OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
return '';
}
}
} | php | public function getModulePath($sModule, $sFile = '')
{
if (!$sFile || ($sFile[0] != '/')) {
$sFile = '/' . $sFile;
}
$oModule = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
$sModulePath = $oModule->getModulePath($sModule);
$sFile = $this->getConfig()->getModulesDir() . $sModulePath . $sFile;
if (file_exists($sFile) || is_dir($sFile)) {
return $sFile;
} else {
/**
* Do not call oxNew in the exception handling of the module subsystem system, as the same module system will be
* involved when calling oxNew
*/
$exception = new \OxidEsales\Eshop\Core\Exception\FileException("Requested file not found for module $sModule ($sFile)");
if ($this->getConfig()->getConfigParam('iDebug')) {
throw $exception;
} else {
/**
* This error should be reported, as it will be the cause of an unexpected behavior of the shop an the
* operator should be given a chance to analyse the issue.
*/
\OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
return '';
}
}
} | [
"public",
"function",
"getModulePath",
"(",
"$",
"sModule",
",",
"$",
"sFile",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"sFile",
"||",
"(",
"$",
"sFile",
"[",
"0",
"]",
"!=",
"'/'",
")",
")",
"{",
"$",
"sFile",
"=",
"'/'",
".",
"$",
"sFile",
... | return path to the requested module file
@param string $sModule module name (directory name in modules dir)
@param string $sFile file name to lookup
@throws \OxidEsales\EshopCommunity\Core\Exception\FileException
@return string | [
"return",
"path",
"to",
"the",
"requested",
"module",
"file"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1164-L1191 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getModuleUrl | public function getModuleUrl($sModule, $sFile = '')
{
$c = $this->getConfig();
$shopUrl = null;
if ($this->isAdmin()) {
if ($c->isSsl()) {
// From admin and with SSL we try to use sAdminSSLURL config directive
$shopUrl = $c->getConfigParam('sAdminSSLURL');
if ($shopUrl) {
// but we don't need the admin directory
$adminDir = '/'.$c->getConfigParam('sAdminDir');
$shopUrl = substr($shopUrl, 0, -strlen($adminDir));
} else {
// if no sAdminSSLURL directive were defined we use sSSLShopURL config directive instead
$shopUrl = $c->getConfigParam('sSSLShopURL');
}
}
// From admin and with no config usefull directive, we use the sShopURL directive
if (!$shopUrl) {
$shopUrl = $c->getConfigParam('sShopURL');
}
}
// We are either in front, or in admin with no $sShopURL defined
if (!$shopUrl) {
$shopUrl = $c->getCurrentShopUrl();
}
$shopUrl = rtrim($shopUrl, '/');
$sUrl = str_replace(
rtrim($c->getConfigParam('sShopDir'), '/'),
$shopUrl,
$this->getModulePath($sModule, $sFile)
);
return $sUrl;
} | php | public function getModuleUrl($sModule, $sFile = '')
{
$c = $this->getConfig();
$shopUrl = null;
if ($this->isAdmin()) {
if ($c->isSsl()) {
// From admin and with SSL we try to use sAdminSSLURL config directive
$shopUrl = $c->getConfigParam('sAdminSSLURL');
if ($shopUrl) {
// but we don't need the admin directory
$adminDir = '/'.$c->getConfigParam('sAdminDir');
$shopUrl = substr($shopUrl, 0, -strlen($adminDir));
} else {
// if no sAdminSSLURL directive were defined we use sSSLShopURL config directive instead
$shopUrl = $c->getConfigParam('sSSLShopURL');
}
}
// From admin and with no config usefull directive, we use the sShopURL directive
if (!$shopUrl) {
$shopUrl = $c->getConfigParam('sShopURL');
}
}
// We are either in front, or in admin with no $sShopURL defined
if (!$shopUrl) {
$shopUrl = $c->getCurrentShopUrl();
}
$shopUrl = rtrim($shopUrl, '/');
$sUrl = str_replace(
rtrim($c->getConfigParam('sShopDir'), '/'),
$shopUrl,
$this->getModulePath($sModule, $sFile)
);
return $sUrl;
} | [
"public",
"function",
"getModuleUrl",
"(",
"$",
"sModule",
",",
"$",
"sFile",
"=",
"''",
")",
"{",
"$",
"c",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"$",
"shopUrl",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"isAdmin",
"(",
")",
... | return url to the requested module file
@param string $sModule module name (directory name in modules dir)
@param string $sFile file name to lookup
@throws \oxFileException
@return string | [
"return",
"url",
"to",
"the",
"requested",
"module",
"file"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1203-L1238 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.isModuleActive | public function isModuleActive($sModuleId, $sVersionFrom = null, $sVersionTo = null)
{
$blModuleIsActive = false;
// use aModuleVersions instead of aModules, because aModules gives only modules which extend oxid classes
$aModuleVersions = $this->getConfig()->getConfigParam('aModuleVersions');
if (is_array($aModuleVersions)) {
$blModuleIsActive = $this->_moduleExists($sModuleId, $aModuleVersions);
if ($blModuleIsActive) {
$blModuleIsActive = $this->_isModuleEnabled($sModuleId) && $this->_isModuleVersionCorrect($sModuleId, $sVersionFrom, $sVersionTo);
}
}
return $blModuleIsActive;
} | php | public function isModuleActive($sModuleId, $sVersionFrom = null, $sVersionTo = null)
{
$blModuleIsActive = false;
// use aModuleVersions instead of aModules, because aModules gives only modules which extend oxid classes
$aModuleVersions = $this->getConfig()->getConfigParam('aModuleVersions');
if (is_array($aModuleVersions)) {
$blModuleIsActive = $this->_moduleExists($sModuleId, $aModuleVersions);
if ($blModuleIsActive) {
$blModuleIsActive = $this->_isModuleEnabled($sModuleId) && $this->_isModuleVersionCorrect($sModuleId, $sVersionFrom, $sVersionTo);
}
}
return $blModuleIsActive;
} | [
"public",
"function",
"isModuleActive",
"(",
"$",
"sModuleId",
",",
"$",
"sVersionFrom",
"=",
"null",
",",
"$",
"sVersionTo",
"=",
"null",
")",
"{",
"$",
"blModuleIsActive",
"=",
"false",
";",
"// use aModuleVersions instead of aModules, because aModules gives only modu... | Check if module is active.
If versionFrom or|and versionTo is defined - also checks module versions.
@param string $sModuleId module id.
@param string $sVersionFrom module from version.
@param string $sVersionTo module to version.
@return bool | [
"Check",
"if",
"module",
"is",
"active",
".",
"If",
"versionFrom",
"or|and",
"versionTo",
"is",
"defined",
"-",
"also",
"checks",
"module",
"versions",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1250-L1266 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getViewThemeParam | public function getViewThemeParam($sName)
{
$sValue = false;
if ($this->getConfig()->isThemeOption($sName)) {
$sValue = $this->getConfig()->getConfigParam($sName);
}
return $sValue;
} | php | public function getViewThemeParam($sName)
{
$sValue = false;
if ($this->getConfig()->isThemeOption($sName)) {
$sValue = $this->getConfig()->getConfigParam($sName);
}
return $sValue;
} | [
"public",
"function",
"getViewThemeParam",
"(",
"$",
"sName",
")",
"{",
"$",
"sValue",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"isThemeOption",
"(",
"$",
"sName",
")",
")",
"{",
"$",
"sValue",
"=",
"$",
"this",
... | return param value
@param string $sName param name
@return mixed | [
"return",
"param",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1275-L1283 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.isAltImageServerConfigured | public function isAltImageServerConfigured()
{
$oConfig = $this->getConfig();
return $oConfig->getConfigParam('sAltImageUrl') || $oConfig->getConfigParam('sSSLAltImageUrl') ||
$oConfig->getConfigParam('sAltImageDir') || $oConfig->getConfigParam('sSSLAltImageDir');
} | php | public function isAltImageServerConfigured()
{
$oConfig = $this->getConfig();
return $oConfig->getConfigParam('sAltImageUrl') || $oConfig->getConfigParam('sSSLAltImageUrl') ||
$oConfig->getConfigParam('sAltImageDir') || $oConfig->getConfigParam('sSSLAltImageDir');
} | [
"public",
"function",
"isAltImageServerConfigured",
"(",
")",
"{",
"$",
"oConfig",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"return",
"$",
"oConfig",
"->",
"getConfigParam",
"(",
"'sAltImageUrl'",
")",
"||",
"$",
"oConfig",
"->",
"getConfigParam",
... | Checks if alternative image server is configured.
@return bool | [
"Checks",
"if",
"alternative",
"image",
"server",
"is",
"configured",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1311-L1317 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getActiveTheme | public function getActiveTheme()
{
if ($this->_sActiveTheme === null) {
$oTheme = oxNew(\OxidEsales\Eshop\Core\Theme::class);
$this->_sActiveTheme = $oTheme->getActiveThemeId();
}
return $this->_sActiveTheme;
} | php | public function getActiveTheme()
{
if ($this->_sActiveTheme === null) {
$oTheme = oxNew(\OxidEsales\Eshop\Core\Theme::class);
$this->_sActiveTheme = $oTheme->getActiveThemeId();
}
return $this->_sActiveTheme;
} | [
"public",
"function",
"getActiveTheme",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sActiveTheme",
"===",
"null",
")",
"{",
"$",
"oTheme",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Theme",
"::",
"class",
")",
";",
... | Returns active theme name
@return string | [
"Returns",
"active",
"theme",
"name"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1336-L1344 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig.getShopLogo | public function getShopLogo()
{
if (is_null($this->_sShopLogo)) {
$sLogoImage = $this->getConfig()->getConfigParam('sShopLogo');
if (empty($sLogoImage)) {
$editionSelector = new EditionSelector();
$sLogoImage = "logo_" . strtolower($editionSelector->getEdition()) . ".png";
}
$this->setShopLogo($sLogoImage);
}
return $this->_sShopLogo;
} | php | public function getShopLogo()
{
if (is_null($this->_sShopLogo)) {
$sLogoImage = $this->getConfig()->getConfigParam('sShopLogo');
if (empty($sLogoImage)) {
$editionSelector = new EditionSelector();
$sLogoImage = "logo_" . strtolower($editionSelector->getEdition()) . ".png";
}
$this->setShopLogo($sLogoImage);
}
return $this->_sShopLogo;
} | [
"public",
"function",
"getShopLogo",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_sShopLogo",
")",
")",
"{",
"$",
"sLogoImage",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'sShopLogo'",
")",
";",
"if",... | Returns shop logo image file name from config option
@return string | [
"Returns",
"shop",
"logo",
"image",
"file",
"name",
"from",
"config",
"option"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1351-L1364 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewConfig.php | ViewConfig._isModuleVersionCorrect | private function _isModuleVersionCorrect($sModuleId, $sVersionFrom, $sVersionTo)
{
$blModuleIsActive = true;
$aModuleVersions = $this->getConfig()->getConfigParam('aModuleVersions');
if ($sVersionFrom && !version_compare($aModuleVersions[$sModuleId], $sVersionFrom, '>=')) {
$blModuleIsActive = false;
}
if ($blModuleIsActive && $sVersionTo && !version_compare($aModuleVersions[$sModuleId], $sVersionTo, '<')) {
$blModuleIsActive = false;
}
return $blModuleIsActive;
} | php | private function _isModuleVersionCorrect($sModuleId, $sVersionFrom, $sVersionTo)
{
$blModuleIsActive = true;
$aModuleVersions = $this->getConfig()->getConfigParam('aModuleVersions');
if ($sVersionFrom && !version_compare($aModuleVersions[$sModuleId], $sVersionFrom, '>=')) {
$blModuleIsActive = false;
}
if ($blModuleIsActive && $sVersionTo && !version_compare($aModuleVersions[$sModuleId], $sVersionTo, '<')) {
$blModuleIsActive = false;
}
return $blModuleIsActive;
} | [
"private",
"function",
"_isModuleVersionCorrect",
"(",
"$",
"sModuleId",
",",
"$",
"sVersionFrom",
",",
"$",
"sVersionTo",
")",
"{",
"$",
"blModuleIsActive",
"=",
"true",
";",
"$",
"aModuleVersions",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"getC... | Checks whether module version is between given range.
@param string $sModuleId Module id
@param string $sVersionFrom Version from
@param string $sVersionTo Version to
@return bool | [
"Checks",
"whether",
"module",
"version",
"is",
"between",
"given",
"range",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewConfig.php#L1428-L1443 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getViewParameter | public function getViewParameter($sKey)
{
return (isset($this->_aViewParams[$sKey])) ? $this->_aViewParams[$sKey] : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sKey);
} | php | public function getViewParameter($sKey)
{
return (isset($this->_aViewParams[$sKey])) ? $this->_aViewParams[$sKey] : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sKey);
} | [
"public",
"function",
"getViewParameter",
"(",
"$",
"sKey",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"_aViewParams",
"[",
"$",
"sKey",
"]",
")",
")",
"?",
"$",
"this",
"->",
"_aViewParams",
"[",
"$",
"sKey",
"]",
":",
"\\",
"OxidEsal... | Get parameters to controllers
@param string $sKey parameter key
@return string | [
"Get",
"parameters",
"to",
"controllers"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L204-L207 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getBelboonParam | public function getBelboonParam()
{
if ($sBelboon = $this->getSession()->getVariable('belboon')) {
return $sBelboon;
}
if (($sBelboon = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('belboon'))) {
$this->getSession()->setVariable('belboon', $sBelboon);
}
return $sBelboon;
} | php | public function getBelboonParam()
{
if ($sBelboon = $this->getSession()->getVariable('belboon')) {
return $sBelboon;
}
if (($sBelboon = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('belboon'))) {
$this->getSession()->setVariable('belboon', $sBelboon);
}
return $sBelboon;
} | [
"public",
"function",
"getBelboonParam",
"(",
")",
"{",
"if",
"(",
"$",
"sBelboon",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
"'belboon'",
")",
")",
"{",
"return",
"$",
"sBelboon",
";",
"}",
"if",
"(",
"(",
"$",
"sBelb... | Returns belboon parameter
@return string $sBelboon | [
"Returns",
"belboon",
"parameter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L292-L302 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getViewConfig | public function getViewConfig()
{
if ($this->_oViewConf === null) {
$this->_oViewConf = oxNew(\OxidEsales\Eshop\Core\ViewConfig::class);
}
return $this->_oViewConf;
} | php | public function getViewConfig()
{
if ($this->_oViewConf === null) {
$this->_oViewConf = oxNew(\OxidEsales\Eshop\Core\ViewConfig::class);
}
return $this->_oViewConf;
} | [
"public",
"function",
"getViewConfig",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oViewConf",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oViewConf",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"ViewConfig",
"::",
"c... | Returns view config object
@return \OxidEsales\Eshop\Core\ViewConfig | [
"Returns",
"view",
"config",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L309-L316 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getViewDataElement | public function getViewDataElement($sParamId = null)
{
$return = null;
if ($sParamId && isset($this->_aViewData[$sParamId])) {
$return = $this->_aViewData[$sParamId];
}
return $return;
} | php | public function getViewDataElement($sParamId = null)
{
$return = null;
if ($sParamId && isset($this->_aViewData[$sParamId])) {
$return = $this->_aViewData[$sParamId];
}
return $return;
} | [
"public",
"function",
"getViewDataElement",
"(",
"$",
"sParamId",
"=",
"null",
")",
"{",
"$",
"return",
"=",
"null",
";",
"if",
"(",
"$",
"sParamId",
"&&",
"isset",
"(",
"$",
"this",
"->",
"_aViewData",
"[",
"$",
"sParamId",
"]",
")",
")",
"{",
"$",
... | Get view data single array element
@param string $sParamId view data array key
@return mixed | [
"Get",
"view",
"data",
"single",
"array",
"element"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L432-L440 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController._executeNewAction | protected function _executeNewAction($sNewAction)
{
if ($sNewAction) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// page parameters is the part which goes after '?'
$params = explode('?', $sNewAction);
// action parameters is the part before '?'
$pageParams = isset($params[1]) ? $params[1] : null;
// looking for function name
$params = explode('/', $params[0]);
$className = $params[0];
$resolvedClassName = \OxidEsales\Eshop\Core\Registry::getControllerClassNameResolver()->getClassNameById($className);
$realClassName = $resolvedClassName ? \OxidEsales\Eshop\Core\Registry::getUtilsObject()->getClassName($resolvedClassName) : \OxidEsales\Eshop\Core\Registry::getUtilsObject()->getClassName($className);
if (false === class_exists($realClassName)) {
//If redirect tries to use a not existing class throw an exception.
//we'll be redirected to start page directly.
$exception = new \OxidEsales\Eshop\Core\Exception\SystemComponentException();
/** Use setMessage here instead of passing it in constructor in order to test exception message */
$exception->setMessage('ERROR_MESSAGE_SYSTEMCOMPONENT_CLASSNOTFOUND' . ' ' . $className);
$exception->setComponent($className);
throw $exception;
}
// building redirect path ...
$header = ($className) ? "cl=$className&" : ''; // adding view name
$header .= ($pageParams) ? "$pageParams&" : ''; // adding page params
$header .= $this->getSession()->sid(); // adding session Id
$url = $myConfig->getCurrentShopUrl($this->isAdmin());
$url = "{$url}index.php?{$header}";
$url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($url);
if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive() && $seoUrl = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->getStaticUrl($url)) {
$url = $seoUrl;
}
$this->onExecuteNewAction();
$this->dispatchEvent(new AfterRequestProcessedEvent);
//#M341 do not add redirect parameter
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect($url, (bool) $myConfig->getRequestParameter('redirected'), 302);
}
} | php | protected function _executeNewAction($sNewAction)
{
if ($sNewAction) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// page parameters is the part which goes after '?'
$params = explode('?', $sNewAction);
// action parameters is the part before '?'
$pageParams = isset($params[1]) ? $params[1] : null;
// looking for function name
$params = explode('/', $params[0]);
$className = $params[0];
$resolvedClassName = \OxidEsales\Eshop\Core\Registry::getControllerClassNameResolver()->getClassNameById($className);
$realClassName = $resolvedClassName ? \OxidEsales\Eshop\Core\Registry::getUtilsObject()->getClassName($resolvedClassName) : \OxidEsales\Eshop\Core\Registry::getUtilsObject()->getClassName($className);
if (false === class_exists($realClassName)) {
//If redirect tries to use a not existing class throw an exception.
//we'll be redirected to start page directly.
$exception = new \OxidEsales\Eshop\Core\Exception\SystemComponentException();
/** Use setMessage here instead of passing it in constructor in order to test exception message */
$exception->setMessage('ERROR_MESSAGE_SYSTEMCOMPONENT_CLASSNOTFOUND' . ' ' . $className);
$exception->setComponent($className);
throw $exception;
}
// building redirect path ...
$header = ($className) ? "cl=$className&" : ''; // adding view name
$header .= ($pageParams) ? "$pageParams&" : ''; // adding page params
$header .= $this->getSession()->sid(); // adding session Id
$url = $myConfig->getCurrentShopUrl($this->isAdmin());
$url = "{$url}index.php?{$header}";
$url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($url);
if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive() && $seoUrl = \OxidEsales\Eshop\Core\Registry::getSeoEncoder()->getStaticUrl($url)) {
$url = $seoUrl;
}
$this->onExecuteNewAction();
$this->dispatchEvent(new AfterRequestProcessedEvent);
//#M341 do not add redirect parameter
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect($url, (bool) $myConfig->getRequestParameter('redirected'), 302);
}
} | [
"protected",
"function",
"_executeNewAction",
"(",
"$",
"sNewAction",
")",
"{",
"if",
"(",
"$",
"sNewAction",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"// page para... | Formats header for new controller action
Input example: "view_name?param1=val1¶m2=val2" => "cl=view_name¶m1=val1¶m2=val2"
@param string $sNewAction new action params
@throws \OxidEsales\Eshop\Core\Exception\SystemComponentException system component exception | [
"Formats",
"header",
"for",
"new",
"controller",
"action"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L563-L612 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getCharSet | public function getCharSet()
{
if ($this->_sCharSet == null) {
$this->_sCharSet = \OxidEsales\Eshop\Core\Registry::getLang()->translateString('charset');
}
return $this->_sCharSet;
} | php | public function getCharSet()
{
if ($this->_sCharSet == null) {
$this->_sCharSet = \OxidEsales\Eshop\Core\Registry::getLang()->translateString('charset');
}
return $this->_sCharSet;
} | [
"public",
"function",
"getCharSet",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sCharSet",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"_sCharSet",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
"... | Returns active charset
@return string | [
"Returns",
"active",
"charset"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L636-L643 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getShopFullEdition | public function getShopFullEdition()
{
$sEdition = $this->getShopEdition();
$sFullEdition = "Community Edition";
if ($sEdition == "PE") {
$sFullEdition = "Professional Edition";
}
if ($sEdition == "EE") {
$sFullEdition = "Enterprise Edition";
}
return $sFullEdition;
} | php | public function getShopFullEdition()
{
$sEdition = $this->getShopEdition();
$sFullEdition = "Community Edition";
if ($sEdition == "PE") {
$sFullEdition = "Professional Edition";
}
if ($sEdition == "EE") {
$sFullEdition = "Enterprise Edition";
}
return $sFullEdition;
} | [
"public",
"function",
"getShopFullEdition",
"(",
")",
"{",
"$",
"sEdition",
"=",
"$",
"this",
"->",
"getShopEdition",
"(",
")",
";",
"$",
"sFullEdition",
"=",
"\"Community Edition\"",
";",
"if",
"(",
"$",
"sEdition",
"==",
"\"PE\"",
")",
"{",
"$",
"sFullEd... | Returns shop full edition
@return string | [
"Returns",
"shop",
"full",
"edition"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L680-L693 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.isDemoVersion | public function isDemoVersion()
{
if ($this->_blDemoVersion == null) {
$this->_blDemoVersion = \OxidEsales\Eshop\Core\Registry::getConfig()->detectVersion() == 1;
}
return $this->_blDemoVersion;
} | php | public function isDemoVersion()
{
if ($this->_blDemoVersion == null) {
$this->_blDemoVersion = \OxidEsales\Eshop\Core\Registry::getConfig()->detectVersion() == 1;
}
return $this->_blDemoVersion;
} | [
"public",
"function",
"isDemoVersion",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_blDemoVersion",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"_blDemoVersion",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
... | Returns if current shop is demo version
@return string | [
"Returns",
"if",
"current",
"shop",
"is",
"demo",
"version"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L701-L708 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.isDemoShop | public function isDemoShop()
{
if ($this->_blDemoShop == null) {
$this->_blDemoShop = \OxidEsales\Eshop\Core\Registry::getConfig()->isDemoShop();
}
return $this->_blDemoShop;
} | php | public function isDemoShop()
{
if ($this->_blDemoShop == null) {
$this->_blDemoShop = \OxidEsales\Eshop\Core\Registry::getConfig()->isDemoShop();
}
return $this->_blDemoShop;
} | [
"public",
"function",
"isDemoShop",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_blDemoShop",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"_blDemoShop",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")... | Returns if current shop is demo shop
@return string | [
"Returns",
"if",
"current",
"shop",
"is",
"demo",
"shop"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L745-L752 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getActCategory | public function getActCategory()
{
// if active category is not set yet - trying to load it from request params
// this may be usefull when category component was unable to load active category
// and we still need some object to mount navigation info
if ($this->_oClickCat === null) {
$this->_oClickCat = false;
$oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($oCategory->load($this->getCategoryId())) {
$this->_oClickCat = $oCategory;
}
}
return $this->_oClickCat;
} | php | public function getActCategory()
{
// if active category is not set yet - trying to load it from request params
// this may be usefull when category component was unable to load active category
// and we still need some object to mount navigation info
if ($this->_oClickCat === null) {
$this->_oClickCat = false;
$oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($oCategory->load($this->getCategoryId())) {
$this->_oClickCat = $oCategory;
}
}
return $this->_oClickCat;
} | [
"public",
"function",
"getActCategory",
"(",
")",
"{",
"// if active category is not set yet - trying to load it from request params",
"// this may be usefull when category component was unable to load active category",
"// and we still need some object to mount navigation info",
"if",
"(",
"$... | Returns active category set by categories component; if category is
not set by component - will create category object and will try to
load by id passed by request
@return \OxidEsales\Eshop\Application\Model\Category | [
"Returns",
"active",
"category",
"set",
"by",
"categories",
"component",
";",
"if",
"category",
"is",
"not",
"set",
"by",
"component",
"-",
"will",
"create",
"category",
"object",
"and",
"will",
"try",
"to",
"load",
"by",
"id",
"passed",
"by",
"request"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L781-L795 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getCategoryId | public function getCategoryId()
{
if ($this->_sCategoryId == null && ($sCatId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid'))) {
$this->_sCategoryId = $sCatId;
}
return $this->_sCategoryId;
} | php | public function getCategoryId()
{
if ($this->_sCategoryId == null && ($sCatId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid'))) {
$this->_sCategoryId = $sCatId;
}
return $this->_sCategoryId;
} | [
"public",
"function",
"getCategoryId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sCategoryId",
"==",
"null",
"&&",
"(",
"$",
"sCatId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getR... | Get category ID
@return string | [
"Get",
"category",
"ID"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L812-L819 | train |
OXID-eSales/oxideshop_ce | source/Core/Controller/BaseController.php | BaseController.getSidForWidget | public function getSidForWidget()
{
$oSession = $this->getSession();
$sid = null;
if (!$oSession->isActualSidInCookie()) {
$sid = $oSession->getId();
}
return $sid;
} | php | public function getSidForWidget()
{
$oSession = $this->getSession();
$sid = null;
if (!$oSession->isActualSidInCookie()) {
$sid = $oSession->getId();
}
return $sid;
} | [
"public",
"function",
"getSidForWidget",
"(",
")",
"{",
"$",
"oSession",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
";",
"$",
"sid",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"oSession",
"->",
"isActualSidInCookie",
"(",
")",
")",
"{",
"$",
"sid",
... | Returns session ID, but only in case it is needed to be included for widget calls.
This basically happens on session change,
when session cookie is not equals to the actual session ID.
@return string|null | [
"Returns",
"session",
"ID",
"but",
"only",
"in",
"case",
"it",
"is",
"needed",
"to",
"be",
"included",
"for",
"widget",
"calls",
".",
"This",
"basically",
"happens",
"on",
"session",
"change",
"when",
"session",
"cookie",
"is",
"not",
"equals",
"to",
"the"... | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Controller/BaseController.php#L876-L885 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Remark.php | Remark.load | public function load($oxID)
{
if ($blRet = parent::load($oxID)) {
// convert date's to international format
$this->oxremark__oxcreate = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxremark__oxcreate->value), \OxidEsales\Eshop\Core\Field::T_RAW);
}
return $blRet;
} | php | public function load($oxID)
{
if ($blRet = parent::load($oxID)) {
// convert date's to international format
$this->oxremark__oxcreate = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxremark__oxcreate->value), \OxidEsales\Eshop\Core\Field::T_RAW);
}
return $blRet;
} | [
"public",
"function",
"load",
"(",
"$",
"oxID",
")",
"{",
"if",
"(",
"$",
"blRet",
"=",
"parent",
"::",
"load",
"(",
"$",
"oxID",
")",
")",
"{",
"// convert date's to international format",
"$",
"this",
"->",
"oxremark__oxcreate",
"=",
"new",
"\\",
"OxidEs... | Loads object information from DB. Returns true on success.
@param string $oxID ID of object to load
@return bool | [
"Loads",
"object",
"information",
"from",
"DB",
".",
"Returns",
"true",
"on",
"success",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Remark.php#L48-L56 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Remark.php | Remark._insert | protected function _insert()
{
// set oxcreate
$sNow = date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime());
$this->oxremark__oxcreate = new \OxidEsales\Eshop\Core\Field($sNow, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->oxremark__oxheader = new \OxidEsales\Eshop\Core\Field($sNow, \OxidEsales\Eshop\Core\Field::T_RAW);
return parent::_insert();
} | php | protected function _insert()
{
// set oxcreate
$sNow = date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime());
$this->oxremark__oxcreate = new \OxidEsales\Eshop\Core\Field($sNow, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->oxremark__oxheader = new \OxidEsales\Eshop\Core\Field($sNow, \OxidEsales\Eshop\Core\Field::T_RAW);
return parent::_insert();
} | [
"protected",
"function",
"_insert",
"(",
")",
"{",
"// set oxcreate",
"$",
"sNow",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
",",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsDate",
"(",
")",
"->",
"getTime",
"(",
")",
")",
... | Inserts object data fields in DB. Returns true on success.
@return bool | [
"Inserts",
"object",
"data",
"fields",
"in",
"DB",
".",
"Returns",
"true",
"on",
"success",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Remark.php#L63-L71 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountDownloadsController.php | AccountDownloadsController.getOrderFilesList | public function getOrderFilesList()
{
if ($this->_oOrderFilesList !== null) {
return $this->_oOrderFilesList;
}
$oOrderFileList = oxNew(\OxidEsales\Eshop\Application\Model\OrderFileList::class);
$oOrderFileList->loadUserFiles($this->getUser()->getId());
$this->_oOrderFilesList = $this->_prepareForTemplate($oOrderFileList);
return $this->_oOrderFilesList;
} | php | public function getOrderFilesList()
{
if ($this->_oOrderFilesList !== null) {
return $this->_oOrderFilesList;
}
$oOrderFileList = oxNew(\OxidEsales\Eshop\Application\Model\OrderFileList::class);
$oOrderFileList->loadUserFiles($this->getUser()->getId());
$this->_oOrderFilesList = $this->_prepareForTemplate($oOrderFileList);
return $this->_oOrderFilesList;
} | [
"public",
"function",
"getOrderFilesList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oOrderFilesList",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_oOrderFilesList",
";",
"}",
"$",
"oOrderFileList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\... | Returns article list which was ordered and has downloadable files
@return null|oxArticleList | [
"Returns",
"article",
"list",
"which",
"was",
"ordered",
"and",
"has",
"downloadable",
"files"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountDownloadsController.php#L66-L78 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountDownloadsController.php | AccountDownloadsController._prepareForTemplate | protected function _prepareForTemplate($oOrderFileList)
{
$oOrderArticles = [];
foreach ($oOrderFileList as $oOrderFile) {
$sOrderArticleIdField = 'oxorderfiles__oxorderarticleid';
$sOrderNumberField = 'oxorderfiles__oxordernr';
$sOrderDateField = 'oxorderfiles__oxorderdate';
$sOrderTitleField = 'oxorderfiles__oxarticletitle';
$sOrderArticleId = $oOrderFile->$sOrderArticleIdField->value;
$oOrderArticles[$sOrderArticleId]['oxordernr'] = $oOrderFile->$sOrderNumberField->value;
$oOrderArticles[$sOrderArticleId]['oxorderdate'] = substr($oOrderFile->$sOrderDateField->value, 0, 16);
$oOrderArticles[$sOrderArticleId]['oxarticletitle'] = $oOrderFile->$sOrderTitleField->value;
$oOrderArticles[$sOrderArticleId]['oxorderfiles'][] = $oOrderFile;
}
return $oOrderArticles;
} | php | protected function _prepareForTemplate($oOrderFileList)
{
$oOrderArticles = [];
foreach ($oOrderFileList as $oOrderFile) {
$sOrderArticleIdField = 'oxorderfiles__oxorderarticleid';
$sOrderNumberField = 'oxorderfiles__oxordernr';
$sOrderDateField = 'oxorderfiles__oxorderdate';
$sOrderTitleField = 'oxorderfiles__oxarticletitle';
$sOrderArticleId = $oOrderFile->$sOrderArticleIdField->value;
$oOrderArticles[$sOrderArticleId]['oxordernr'] = $oOrderFile->$sOrderNumberField->value;
$oOrderArticles[$sOrderArticleId]['oxorderdate'] = substr($oOrderFile->$sOrderDateField->value, 0, 16);
$oOrderArticles[$sOrderArticleId]['oxarticletitle'] = $oOrderFile->$sOrderTitleField->value;
$oOrderArticles[$sOrderArticleId]['oxorderfiles'][] = $oOrderFile;
}
return $oOrderArticles;
} | [
"protected",
"function",
"_prepareForTemplate",
"(",
"$",
"oOrderFileList",
")",
"{",
"$",
"oOrderArticles",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"oOrderFileList",
"as",
"$",
"oOrderFile",
")",
"{",
"$",
"sOrderArticleIdField",
"=",
"'oxorderfiles__oxorderarti... | Returns prepared orders files list
@param \OxidEsales\Eshop\Application\Model\OrderFileList $oOrderFileList - list or orderfiles
@return array | [
"Returns",
"prepared",
"orders",
"files",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountDownloadsController.php#L87-L104 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getStateObject | protected function _getStateObject()
{
if (is_null($this->_oStateObject)) {
$this->_oStateObject = oxNew(\OxidEsales\Eshop\Application\Model\State::class);
}
return $this->_oStateObject;
} | php | protected function _getStateObject()
{
if (is_null($this->_oStateObject)) {
$this->_oStateObject = oxNew(\OxidEsales\Eshop\Application\Model\State::class);
}
return $this->_oStateObject;
} | [
"protected",
"function",
"_getStateObject",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_oStateObject",
")",
")",
"{",
"$",
"this",
"->",
"_oStateObject",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
... | Gets state object.
@return oxState | [
"Gets",
"state",
"object",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L183-L190 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getNewsSubscription | public function getNewsSubscription()
{
if ($this->_oNewsSubscription !== null) {
return $this->_oNewsSubscription;
}
$this->_oNewsSubscription = oxNew(\OxidEsales\Eshop\Application\Model\NewsSubscribed::class);
// if subscription object is not set yet - we should create one
if (!$this->_oNewsSubscription->loadFromUserId($this->getId())) {
if (!$this->_oNewsSubscription->loadFromEmail($this->oxuser__oxusername->value)) {
// no subscription defined yet - creating one
$this->_oNewsSubscription->oxnewssubscribed__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_oNewsSubscription->oxnewssubscribed__oxemail = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxusername->value, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_oNewsSubscription->oxnewssubscribed__oxsal = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxsal->value, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_oNewsSubscription->oxnewssubscribed__oxfname = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxfname->value, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_oNewsSubscription->oxnewssubscribed__oxlname = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxlname->value, \OxidEsales\Eshop\Core\Field::T_RAW);
}
}
return $this->_oNewsSubscription;
} | php | public function getNewsSubscription()
{
if ($this->_oNewsSubscription !== null) {
return $this->_oNewsSubscription;
}
$this->_oNewsSubscription = oxNew(\OxidEsales\Eshop\Application\Model\NewsSubscribed::class);
// if subscription object is not set yet - we should create one
if (!$this->_oNewsSubscription->loadFromUserId($this->getId())) {
if (!$this->_oNewsSubscription->loadFromEmail($this->oxuser__oxusername->value)) {
// no subscription defined yet - creating one
$this->_oNewsSubscription->oxnewssubscribed__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_oNewsSubscription->oxnewssubscribed__oxemail = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxusername->value, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_oNewsSubscription->oxnewssubscribed__oxsal = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxsal->value, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_oNewsSubscription->oxnewssubscribed__oxfname = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxfname->value, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_oNewsSubscription->oxnewssubscribed__oxlname = new \OxidEsales\Eshop\Core\Field($this->oxuser__oxlname->value, \OxidEsales\Eshop\Core\Field::T_RAW);
}
}
return $this->_oNewsSubscription;
} | [
"public",
"function",
"getNewsSubscription",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oNewsSubscription",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_oNewsSubscription",
";",
"}",
"$",
"this",
"->",
"_oNewsSubscription",
"=",
"oxNew",
"(",
... | Returns user newsletter subscription controller object
@return object oxnewssubscribed | [
"Returns",
"user",
"newsletter",
"subscription",
"controller",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L261-L282 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getUserCountryId | public function getUserCountryId($sCountry = null)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select oxid from " . getviewName("oxcountry") . " where oxactive = '1' and oxisoalpha2 = " . $oDb->quote($sCountry) . " ";
$sCountryId = $oDb->getOne($sQ);
return $sCountryId;
} | php | public function getUserCountryId($sCountry = null)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select oxid from " . getviewName("oxcountry") . " where oxactive = '1' and oxisoalpha2 = " . $oDb->quote($sCountry) . " ";
$sCountryId = $oDb->getOne($sQ);
return $sCountryId;
} | [
"public",
"function",
"getUserCountryId",
"(",
"$",
"sCountry",
"=",
"null",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sQ",
"=",
"\"select oxid from \"",
".",
... | Returns user countryid according to passed name
@param string $sCountry country
@return string | [
"Returns",
"user",
"countryid",
"according",
"to",
"passed",
"name"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L318-L325 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getUserAddresses | public function getUserAddresses($sUserId = null)
{
$sUserId = isset($sUserId) ? $sUserId : $this->getId();
if (!isset($this->_aAddresses[$sUserId])) {
$oUserAddressList = oxNew(\OxidEsales\Eshop\Application\Model\UserAddressList::class);
$oUserAddressList->load($sUserId);
$this->_aAddresses[$sUserId] = $oUserAddressList;
// marking selected
if ($sAddressId = $this->getSelectedAddressId()) {
foreach ($this->_aAddresses[$sUserId] as $oAddress) {
if ($oAddress->getId() === $sAddressId) {
$oAddress->setSelected();
break;
}
}
}
}
return $this->_aAddresses[$sUserId];
} | php | public function getUserAddresses($sUserId = null)
{
$sUserId = isset($sUserId) ? $sUserId : $this->getId();
if (!isset($this->_aAddresses[$sUserId])) {
$oUserAddressList = oxNew(\OxidEsales\Eshop\Application\Model\UserAddressList::class);
$oUserAddressList->load($sUserId);
$this->_aAddresses[$sUserId] = $oUserAddressList;
// marking selected
if ($sAddressId = $this->getSelectedAddressId()) {
foreach ($this->_aAddresses[$sUserId] as $oAddress) {
if ($oAddress->getId() === $sAddressId) {
$oAddress->setSelected();
break;
}
}
}
}
return $this->_aAddresses[$sUserId];
} | [
"public",
"function",
"getUserAddresses",
"(",
"$",
"sUserId",
"=",
"null",
")",
"{",
"$",
"sUserId",
"=",
"isset",
"(",
"$",
"sUserId",
")",
"?",
"$",
"sUserId",
":",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
... | Returns user defined Address list object
@param string $sUserId object ID (default is null)
@return array | [
"Returns",
"user",
"defined",
"Address",
"list",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L361-L381 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getWishListId | protected function _getWishListId()
{
$this->_sWishId = null;
// check if we have to set it here
$oBasket = $this->getSession()->getBasket();
foreach ($oBasket->getContents() as $oBasketItem) {
if ($this->_sWishId = $oBasketItem->getWishId()) {
// stop on first found
break;
}
}
return $this->_sWishId;
} | php | protected function _getWishListId()
{
$this->_sWishId = null;
// check if we have to set it here
$oBasket = $this->getSession()->getBasket();
foreach ($oBasket->getContents() as $oBasketItem) {
if ($this->_sWishId = $oBasketItem->getWishId()) {
// stop on first found
break;
}
}
return $this->_sWishId;
} | [
"protected",
"function",
"_getWishListId",
"(",
")",
"{",
"$",
"this",
"->",
"_sWishId",
"=",
"null",
";",
"// check if we have to set it here",
"$",
"oBasket",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getBasket",
"(",
")",
";",
"foreach",
"(",... | Checks if product from wishlist is added
@return $sWishId | [
"Checks",
"if",
"product",
"from",
"wishlist",
"is",
"added"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L417-L430 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getUserPayments | public function getUserPayments($sOXID = null)
{
if ($this->_oPayments === null) {
if (!$sOXID) {
$sOXID = $this->getId();
}
$sSelect = 'select * from oxuserpayments where oxuserid = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOXID) . ' ';
$this->_oPayments = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$this->_oPayments->init('oxUserPayment');
$this->_oPayments->selectString($sSelect);
}
return $this->_oPayments;
} | php | public function getUserPayments($sOXID = null)
{
if ($this->_oPayments === null) {
if (!$sOXID) {
$sOXID = $this->getId();
}
$sSelect = 'select * from oxuserpayments where oxuserid = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOXID) . ' ';
$this->_oPayments = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$this->_oPayments->init('oxUserPayment');
$this->_oPayments->selectString($sSelect);
}
return $this->_oPayments;
} | [
"public",
"function",
"getUserPayments",
"(",
"$",
"sOXID",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oPayments",
"===",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"sOXID",
")",
"{",
"$",
"sOXID",
"=",
"$",
"this",
"->",
"getId",
"(",
")... | Returns user payment history list object
@param string $sOXID object ID (default is null)
@return object oxList with oxuserpayments objects | [
"Returns",
"user",
"payment",
"history",
"list",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L484-L499 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.exists | public function exists($sOXID = null)
{
if (!$sOXID) {
$sOXID = $this->getId();
}
//#5901 if physical record exists return true unconditionally
if (parent::exists($sOXID)) {
$this->setId($sOXID);
return true;
}
//additional username check
//This part is used by not yet saved user object, to detect the case when such username exists in db.
//Basically it is called when anonymous visitor enters existing username for newsletter subscription
//see Newsletter::send()
//TODO: transfer this validation to newsletter part
$sShopSelect = '';
if (!$this->_blMallUsers && $this->oxuser__oxrights->value != 'malladmin') {
$sShopSelect = ' AND oxshopid = "' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" ';
}
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$sSelect = 'SELECT oxid FROM ' . $this->getViewName() . '
WHERE ( oxusername = ' . $masterDb->quote($this->oxuser__oxusername->value) . ' ) ';
$sSelect .= $sShopSelect;
if (($sOxid = $masterDb->getOne($sSelect))) {
// update - set oxid
$this->setId($sOxid);
return true;
}
return false;
} | php | public function exists($sOXID = null)
{
if (!$sOXID) {
$sOXID = $this->getId();
}
//#5901 if physical record exists return true unconditionally
if (parent::exists($sOXID)) {
$this->setId($sOXID);
return true;
}
//additional username check
//This part is used by not yet saved user object, to detect the case when such username exists in db.
//Basically it is called when anonymous visitor enters existing username for newsletter subscription
//see Newsletter::send()
//TODO: transfer this validation to newsletter part
$sShopSelect = '';
if (!$this->_blMallUsers && $this->oxuser__oxrights->value != 'malladmin') {
$sShopSelect = ' AND oxshopid = "' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" ';
}
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$sSelect = 'SELECT oxid FROM ' . $this->getViewName() . '
WHERE ( oxusername = ' . $masterDb->quote($this->oxuser__oxusername->value) . ' ) ';
$sSelect .= $sShopSelect;
if (($sOxid = $masterDb->getOne($sSelect))) {
// update - set oxid
$this->setId($sOxid);
return true;
}
return false;
} | [
"public",
"function",
"exists",
"(",
"$",
"sOXID",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"sOXID",
")",
"{",
"$",
"sOXID",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"}",
"//#5901 if physical record exists return true unconditionally",
"if",
"(",... | Checks if user exists in database.
@param string $sOXID object ID (default null)
@return bool | [
"Checks",
"if",
"user",
"exists",
"in",
"database",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L657-L692 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getOrderCount | public function getOrderCount()
{
$iCnt = 0;
if ($this->getId() && $this->oxuser__oxregister->value > 1) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = 'select count(*) from oxorder where oxuserid = ' . $oDb->quote($this->getId()) . ' AND oxorderdate >= ' . $oDb->quote($this->oxuser__oxregister->value) . ' and oxshopid = "' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" ';
$iCnt = (int) $oDb->getOne($sQ);
}
return $iCnt;
} | php | public function getOrderCount()
{
$iCnt = 0;
if ($this->getId() && $this->oxuser__oxregister->value > 1) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = 'select count(*) from oxorder where oxuserid = ' . $oDb->quote($this->getId()) . ' AND oxorderdate >= ' . $oDb->quote($this->oxuser__oxregister->value) . ' and oxshopid = "' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" ';
$iCnt = (int) $oDb->getOne($sQ);
}
return $iCnt;
} | [
"public",
"function",
"getOrderCount",
"(",
")",
"{",
"$",
"iCnt",
"=",
"0",
";",
"if",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
"&&",
"$",
"this",
"->",
"oxuser__oxregister",
"->",
"value",
">",
"1",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales"... | Caclulates amount of orders made by user
@return int | [
"Caclulates",
"amount",
"of",
"orders",
"made",
"by",
"user"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L735-L745 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getNoticeListArtCnt | public function getNoticeListArtCnt()
{
if ($this->_iCntNoticeListArticles === null) {
$this->_iCntNoticeListArticles = 0;
if ($this->getId()) {
$this->_iCntNoticeListArticles = $this->getBasket('noticelist')->getItemCount();
}
}
return $this->_iCntNoticeListArticles;
} | php | public function getNoticeListArtCnt()
{
if ($this->_iCntNoticeListArticles === null) {
$this->_iCntNoticeListArticles = 0;
if ($this->getId()) {
$this->_iCntNoticeListArticles = $this->getBasket('noticelist')->getItemCount();
}
}
return $this->_iCntNoticeListArticles;
} | [
"public",
"function",
"getNoticeListArtCnt",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_iCntNoticeListArticles",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_iCntNoticeListArticles",
"=",
"0",
";",
"if",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
")... | Returns amount of articles in noticelist
@return int | [
"Returns",
"amount",
"of",
"articles",
"in",
"noticelist"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L752-L762 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getWishListArtCnt | public function getWishListArtCnt()
{
if ($this->_iCntWishListArticles === null) {
$this->_iCntWishListArticles = false;
if ($this->getId()) {
$this->_iCntWishListArticles = $this->getBasket('wishlist')->getItemCount();
}
}
return $this->_iCntWishListArticles;
} | php | public function getWishListArtCnt()
{
if ($this->_iCntWishListArticles === null) {
$this->_iCntWishListArticles = false;
if ($this->getId()) {
$this->_iCntWishListArticles = $this->getBasket('wishlist')->getItemCount();
}
}
return $this->_iCntWishListArticles;
} | [
"public",
"function",
"getWishListArtCnt",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_iCntWishListArticles",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_iCntWishListArticles",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
")",... | Calculating user wishlist item count
@return int | [
"Calculating",
"user",
"wishlist",
"item",
"count"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L769-L779 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getActiveCountry | public function getActiveCountry()
{
$sDeliveryCountry = '';
$soxAddressId = Registry::getSession()->getVariable('deladrid');
if ($soxAddressId) {
$oDelAddress = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
$oDelAddress->load($soxAddressId);
$sDeliveryCountry = $oDelAddress->oxaddress__oxcountryid->value;
} elseif ($this->getId()) {
$sDeliveryCountry = $this->oxuser__oxcountryid->value;
} else {
$oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
if ($oUser->loadActiveUser()) {
$sDeliveryCountry = $oUser->oxuser__oxcountryid->value;
}
}
return $sDeliveryCountry;
} | php | public function getActiveCountry()
{
$sDeliveryCountry = '';
$soxAddressId = Registry::getSession()->getVariable('deladrid');
if ($soxAddressId) {
$oDelAddress = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
$oDelAddress->load($soxAddressId);
$sDeliveryCountry = $oDelAddress->oxaddress__oxcountryid->value;
} elseif ($this->getId()) {
$sDeliveryCountry = $this->oxuser__oxcountryid->value;
} else {
$oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
if ($oUser->loadActiveUser()) {
$sDeliveryCountry = $oUser->oxuser__oxcountryid->value;
}
}
return $sDeliveryCountry;
} | [
"public",
"function",
"getActiveCountry",
"(",
")",
"{",
"$",
"sDeliveryCountry",
"=",
"''",
";",
"$",
"soxAddressId",
"=",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
"'deladrid'",
")",
";",
"if",
"(",
"$",
"soxAddressId",
")",
"{"... | Returns user country ID, but If delivery address is given - returns
delivery country.
@return string | [
"Returns",
"user",
"country",
"ID",
"but",
"If",
"delivery",
"address",
"is",
"given",
"-",
"returns",
"delivery",
"country",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L797-L815 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.createUser | public function createUser()
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sShopID = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
// check if user exists AND there is no password - in this case we update otherwise we try to insert
$sSelect = "select oxid from oxuser where oxusername = " . $oDb->quote($this->oxuser__oxusername->value) . " and oxpassword = '' ";
if (!$this->_blMallUsers) {
$sSelect .= " and oxshopid = '{$sShopID}' ";
}
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$oldUserId = $masterDb->getOne($sSelect);
if ($oldUserId) {
$this->delete($oldUserId);
} elseif ($this->_blMallUsers) {
// must be sure if there is no duplicate user
$sQ = "select oxid from oxuser where oxusername = " . $oDb->quote($this->oxuser__oxusername->value) . " and oxusername != '' ";
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
if ($masterDb->getOne($sQ)) {
/** @var UserException $oEx */
$oEx = oxNew(UserException::class);
$oLang = Registry::getLang();
$oEx->setMessage(sprintf($oLang->translateString('ERROR_MESSAGE_USER_USEREXISTS', $oLang->getTplLanguage()), $this->oxuser__oxusername->value));
throw $oEx;
}
}
$this->oxuser__oxshopid = new Field($sShopID, Field::T_RAW);
$newUserId = $this->save();
if ($newUserId === false) {
throw oxNew(UserException::class, 'ERROR_MESSAGE_USER_USERCREATIONFAILED');
} else {
// @TODO the following statements make no sense and should be removed: oxuser__oxid is freshly created and the conditions will never match
// dropping/cleaning old delivery address/payment info
$oDb->execute("delete from oxaddress where oxaddress.oxuserid = " . $oDb->quote($this->oxuser__oxid->value));
$oDb->execute("update oxuserpayments set oxuserpayments.oxuserid = " . $oDb->quote($this->oxuser__oxusername->value) . " where oxuserpayments.oxuserid = " . $oDb->quote($this->oxuser__oxid->value));
}
return $newUserId;
} | php | public function createUser()
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sShopID = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
// check if user exists AND there is no password - in this case we update otherwise we try to insert
$sSelect = "select oxid from oxuser where oxusername = " . $oDb->quote($this->oxuser__oxusername->value) . " and oxpassword = '' ";
if (!$this->_blMallUsers) {
$sSelect .= " and oxshopid = '{$sShopID}' ";
}
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$oldUserId = $masterDb->getOne($sSelect);
if ($oldUserId) {
$this->delete($oldUserId);
} elseif ($this->_blMallUsers) {
// must be sure if there is no duplicate user
$sQ = "select oxid from oxuser where oxusername = " . $oDb->quote($this->oxuser__oxusername->value) . " and oxusername != '' ";
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
if ($masterDb->getOne($sQ)) {
/** @var UserException $oEx */
$oEx = oxNew(UserException::class);
$oLang = Registry::getLang();
$oEx->setMessage(sprintf($oLang->translateString('ERROR_MESSAGE_USER_USEREXISTS', $oLang->getTplLanguage()), $this->oxuser__oxusername->value));
throw $oEx;
}
}
$this->oxuser__oxshopid = new Field($sShopID, Field::T_RAW);
$newUserId = $this->save();
if ($newUserId === false) {
throw oxNew(UserException::class, 'ERROR_MESSAGE_USER_USERCREATIONFAILED');
} else {
// @TODO the following statements make no sense and should be removed: oxuser__oxid is freshly created and the conditions will never match
// dropping/cleaning old delivery address/payment info
$oDb->execute("delete from oxaddress where oxaddress.oxuserid = " . $oDb->quote($this->oxuser__oxid->value));
$oDb->execute("update oxuserpayments set oxuserpayments.oxuserid = " . $oDb->quote($this->oxuser__oxusername->value) . " where oxuserpayments.oxuserid = " . $oDb->quote($this->oxuser__oxid->value));
}
return $newUserId;
} | [
"public",
"function",
"createUser",
"(",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sShopID",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Re... | Inserts new or updates existing user
@throws UserException exception
@return bool | [
"Inserts",
"new",
"or",
"updates",
"existing",
"user"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L824-L866 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.addToGroup | public function addToGroup($sGroupID)
{
if (!$this->inGroup($sGroupID)) {
// create oxgroup object
$oGroup = oxNew(\OxidEsales\Eshop\Application\Model\Groups::class);
if ($oGroup->load($sGroupID)) {
$oNewGroup = oxNew(\OxidEsales\Eshop\Application\Model\Object2Group::class);
$oNewGroup->oxobject2group__oxobjectid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
$oNewGroup->oxobject2group__oxgroupsid = new \OxidEsales\Eshop\Core\Field($sGroupID, \OxidEsales\Eshop\Core\Field::T_RAW);
if ($oNewGroup->save()) {
$this->_oGroups[$sGroupID] = $oGroup;
return true;
}
}
}
return false;
} | php | public function addToGroup($sGroupID)
{
if (!$this->inGroup($sGroupID)) {
// create oxgroup object
$oGroup = oxNew(\OxidEsales\Eshop\Application\Model\Groups::class);
if ($oGroup->load($sGroupID)) {
$oNewGroup = oxNew(\OxidEsales\Eshop\Application\Model\Object2Group::class);
$oNewGroup->oxobject2group__oxobjectid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
$oNewGroup->oxobject2group__oxgroupsid = new \OxidEsales\Eshop\Core\Field($sGroupID, \OxidEsales\Eshop\Core\Field::T_RAW);
if ($oNewGroup->save()) {
$this->_oGroups[$sGroupID] = $oGroup;
return true;
}
}
}
return false;
} | [
"public",
"function",
"addToGroup",
"(",
"$",
"sGroupID",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"inGroup",
"(",
"$",
"sGroupID",
")",
")",
"{",
"// create oxgroup object",
"$",
"oGroup",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
... | Adds user to the group
@param string $sGroupID group id
@return bool | [
"Adds",
"user",
"to",
"the",
"group"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L875-L893 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.removeFromGroup | public function removeFromGroup($sGroupID = null)
{
if ($sGroupID != null && $this->inGroup($sGroupID)) {
$oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oGroups->init('oxobject2group');
$sSelect = 'select * from oxobject2group where oxobject2group.oxobjectid = "' . $this->getId() . '" and oxobject2group.oxgroupsid = "' . $sGroupID . '" ';
$oGroups->selectString($sSelect);
foreach ($oGroups as $oRemgroup) {
if ($oRemgroup->delete()) {
unset($this->_oGroups[$oRemgroup->oxobject2group__oxgroupsid->value]);
}
}
}
} | php | public function removeFromGroup($sGroupID = null)
{
if ($sGroupID != null && $this->inGroup($sGroupID)) {
$oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oGroups->init('oxobject2group');
$sSelect = 'select * from oxobject2group where oxobject2group.oxobjectid = "' . $this->getId() . '" and oxobject2group.oxgroupsid = "' . $sGroupID . '" ';
$oGroups->selectString($sSelect);
foreach ($oGroups as $oRemgroup) {
if ($oRemgroup->delete()) {
unset($this->_oGroups[$oRemgroup->oxobject2group__oxgroupsid->value]);
}
}
}
} | [
"public",
"function",
"removeFromGroup",
"(",
"$",
"sGroupID",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"sGroupID",
"!=",
"null",
"&&",
"$",
"this",
"->",
"inGroup",
"(",
"$",
"sGroupID",
")",
")",
"{",
"$",
"oGroups",
"=",
"oxNew",
"(",
"\\",
"OxidEsa... | Removes user from passed user group.
@param string $sGroupID group id | [
"Removes",
"user",
"from",
"passed",
"user",
"group",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L900-L913 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.onOrderExecute | public function onOrderExecute($oBasket, $iSuccess)
{
if (is_numeric($iSuccess) && $iSuccess != 2 && $iSuccess <= 3) {
//adding user to particular customer groups
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$dMidlleCustPrice = (float) $myConfig->getConfigParam('sMidlleCustPrice');
$dLargeCustPrice = (float) $myConfig->getConfigParam('sLargeCustPrice');
$this->addToGroup('oxidcustomer');
$dBasketPrice = $oBasket->getPrice()->getBruttoPrice();
if ($dBasketPrice < $dMidlleCustPrice) {
$this->addToGroup('oxidsmallcust');
}
if ($dBasketPrice >= $dMidlleCustPrice && $dBasketPrice < $dLargeCustPrice) {
$this->addToGroup('oxidmiddlecust');
}
if ($dBasketPrice >= $dLargeCustPrice) {
$this->addToGroup('oxidgoodcust');
}
if ($this->inGroup('oxidnotyetordered')) {
$this->removeFromGroup('oxidnotyetordered');
}
}
} | php | public function onOrderExecute($oBasket, $iSuccess)
{
if (is_numeric($iSuccess) && $iSuccess != 2 && $iSuccess <= 3) {
//adding user to particular customer groups
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$dMidlleCustPrice = (float) $myConfig->getConfigParam('sMidlleCustPrice');
$dLargeCustPrice = (float) $myConfig->getConfigParam('sLargeCustPrice');
$this->addToGroup('oxidcustomer');
$dBasketPrice = $oBasket->getPrice()->getBruttoPrice();
if ($dBasketPrice < $dMidlleCustPrice) {
$this->addToGroup('oxidsmallcust');
}
if ($dBasketPrice >= $dMidlleCustPrice && $dBasketPrice < $dLargeCustPrice) {
$this->addToGroup('oxidmiddlecust');
}
if ($dBasketPrice >= $dLargeCustPrice) {
$this->addToGroup('oxidgoodcust');
}
if ($this->inGroup('oxidnotyetordered')) {
$this->removeFromGroup('oxidnotyetordered');
}
}
} | [
"public",
"function",
"onOrderExecute",
"(",
"$",
"oBasket",
",",
"$",
"iSuccess",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"iSuccess",
")",
"&&",
"$",
"iSuccess",
"!=",
"2",
"&&",
"$",
"iSuccess",
"<=",
"3",
")",
"{",
"//adding user to particular cust... | Called after saving an order.
@param object $oBasket Shopping basket object
@param int $iSuccess order success status | [
"Called",
"after",
"saving",
"an",
"order",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L921-L946 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getBasket | public function getBasket($sName)
{
if (!isset($this->_aBaskets[$sName])) {
/** @var \OxidEsales\Eshop\Application\Model\UserBasket $oBasket */
$oBasket = oxNew(\OxidEsales\Eshop\Application\Model\UserBasket::class);
$aWhere = ['oxuserbaskets.oxuserid' => $this->getId(), 'oxuserbaskets.oxtitle' => $sName];
// creating if it does not exist
if (!$oBasket->assignRecord($oBasket->buildSelectString($aWhere))) {
$oBasket->oxuserbaskets__oxtitle = new \OxidEsales\Eshop\Core\Field($sName);
$oBasket->oxuserbaskets__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId());
// marking basket as new (it will not be saved in DB yet)
$oBasket->setIsNewBasket();
}
$this->_aBaskets[$sName] = $oBasket;
}
return $this->_aBaskets[$sName];
} | php | public function getBasket($sName)
{
if (!isset($this->_aBaskets[$sName])) {
/** @var \OxidEsales\Eshop\Application\Model\UserBasket $oBasket */
$oBasket = oxNew(\OxidEsales\Eshop\Application\Model\UserBasket::class);
$aWhere = ['oxuserbaskets.oxuserid' => $this->getId(), 'oxuserbaskets.oxtitle' => $sName];
// creating if it does not exist
if (!$oBasket->assignRecord($oBasket->buildSelectString($aWhere))) {
$oBasket->oxuserbaskets__oxtitle = new \OxidEsales\Eshop\Core\Field($sName);
$oBasket->oxuserbaskets__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId());
// marking basket as new (it will not be saved in DB yet)
$oBasket->setIsNewBasket();
}
$this->_aBaskets[$sName] = $oBasket;
}
return $this->_aBaskets[$sName];
} | [
"public",
"function",
"getBasket",
"(",
"$",
"sName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_aBaskets",
"[",
"$",
"sName",
"]",
")",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Application\\Model\\UserBasket $oBasket */",
"$",
"oBasket",
"=",
... | Returns notice, wishlist or saved basket object
@param string $sName name/type of basket
@return \OxidEsales\Eshop\Application\Model\UserBasket | [
"Returns",
"notice",
"wishlist",
"or",
"saved",
"basket",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L955-L975 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.convertBirthday | public function convertBirthday($aData)
{
// preparing data to process
$iYear = isset($aData['year']) ? ((int) $aData['year']) : false;
$iMonth = isset($aData['month']) ? ((int) $aData['month']) : false;
$iDay = isset($aData['day']) ? ((int) $aData['day']) : false;
// leaving empty if not set
if (!$iYear && !$iMonth && !$iDay) {
return "";
}
// year
if (!$iYear || $iYear < 1000 || $iYear > 9999) {
$iYear = date('Y');
}
// month
if (!$iMonth || $iMonth < 1 || $iMonth > 12) {
$iMonth = 1;
}
// maximum number of days in month
$iMaxDays = 31;
switch ($iMonth) {
case 2:
if ($iMaxDays > 28) {
$iMaxDays = ($iYear % 4 == 0 && ($iYear % 100 != 0 || $iYear % 400 == 0)) ? 29 : 28;
}
break;
case 4:
case 6:
case 9:
case 11:
$iMaxDays = min(30, $iMaxDays);
break;
}
// day
if (!$iDay || $iDay < 1 || $iDay > $iMaxDays) {
$iDay = 1;
}
// whole date
return sprintf("%04d-%02d-%02d", $iYear, $iMonth, $iDay);
} | php | public function convertBirthday($aData)
{
// preparing data to process
$iYear = isset($aData['year']) ? ((int) $aData['year']) : false;
$iMonth = isset($aData['month']) ? ((int) $aData['month']) : false;
$iDay = isset($aData['day']) ? ((int) $aData['day']) : false;
// leaving empty if not set
if (!$iYear && !$iMonth && !$iDay) {
return "";
}
// year
if (!$iYear || $iYear < 1000 || $iYear > 9999) {
$iYear = date('Y');
}
// month
if (!$iMonth || $iMonth < 1 || $iMonth > 12) {
$iMonth = 1;
}
// maximum number of days in month
$iMaxDays = 31;
switch ($iMonth) {
case 2:
if ($iMaxDays > 28) {
$iMaxDays = ($iYear % 4 == 0 && ($iYear % 100 != 0 || $iYear % 400 == 0)) ? 29 : 28;
}
break;
case 4:
case 6:
case 9:
case 11:
$iMaxDays = min(30, $iMaxDays);
break;
}
// day
if (!$iDay || $iDay < 1 || $iDay > $iMaxDays) {
$iDay = 1;
}
// whole date
return sprintf("%04d-%02d-%02d", $iYear, $iMonth, $iDay);
} | [
"public",
"function",
"convertBirthday",
"(",
"$",
"aData",
")",
"{",
"// preparing data to process",
"$",
"iYear",
"=",
"isset",
"(",
"$",
"aData",
"[",
"'year'",
"]",
")",
"?",
"(",
"(",
"int",
")",
"$",
"aData",
"[",
"'year'",
"]",
")",
":",
"false"... | User birthday converter. Usually this data comes in array form, so before
writing into DB it must be converted into string
@param array $aData birthday data
@return string | [
"User",
"birthday",
"converter",
".",
"Usually",
"this",
"data",
"comes",
"in",
"array",
"form",
"so",
"before",
"writing",
"into",
"DB",
"it",
"must",
"be",
"converted",
"into",
"string"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L985-L1031 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getBoni | public function getBoni()
{
if (!$iBoni = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iCreditRating')) {
$iBoni = 1000;
}
return $iBoni;
} | php | public function getBoni()
{
if (!$iBoni = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iCreditRating')) {
$iBoni = 1000;
}
return $iBoni;
} | [
"public",
"function",
"getBoni",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"iBoni",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'iCreditRating'",
")",
")",
"{",
"$",
"iBon... | Return standard credit rating, can be set in config option iCreditRating;
@return integer | [
"Return",
"standard",
"credit",
"rating",
"can",
"be",
"set",
"in",
"config",
"option",
"iCreditRating",
";"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1038-L1045 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.checkValues | public function checkValues($sLogin, $sPassword, $sPassword2, $aInvAddress, $aDelAddress)
{
/** @var \OxidEsales\Eshop\Core\InputValidator $oInputValidator */
$oInputValidator = Registry::getInputValidator();
// 1. checking user name
$sLogin = $oInputValidator->checkLogin($this, $sLogin, $aInvAddress);
// 2. checking email
$oInputValidator->checkEmail($this, $sLogin);
// 3. password
$oInputValidator->checkPassword($this, $sPassword, $sPassword2, ((int) Registry::getConfig()->getRequestParameter('option') == 3));
// 4. required fields
$oInputValidator->checkRequiredFields($this, $aInvAddress, $aDelAddress);
// 5. country check
$oInputValidator->checkCountries($this, $aInvAddress, $aDelAddress);
// 6. vat id check.
try {
$oInputValidator->checkVatId($this, $aInvAddress);
} catch (\OxidEsales\Eshop\Core\Exception\ConnectionException $e) {
// R080730 just oxInputException is passed here
// if it oxConnectionException, it means it could not check vat id
// and will set 'not checked' status to it later
}
// throwing first validation error
if ($oError = Registry::getInputValidator()->getFirstValidationError()) {
throw $oError;
}
} | php | public function checkValues($sLogin, $sPassword, $sPassword2, $aInvAddress, $aDelAddress)
{
/** @var \OxidEsales\Eshop\Core\InputValidator $oInputValidator */
$oInputValidator = Registry::getInputValidator();
// 1. checking user name
$sLogin = $oInputValidator->checkLogin($this, $sLogin, $aInvAddress);
// 2. checking email
$oInputValidator->checkEmail($this, $sLogin);
// 3. password
$oInputValidator->checkPassword($this, $sPassword, $sPassword2, ((int) Registry::getConfig()->getRequestParameter('option') == 3));
// 4. required fields
$oInputValidator->checkRequiredFields($this, $aInvAddress, $aDelAddress);
// 5. country check
$oInputValidator->checkCountries($this, $aInvAddress, $aDelAddress);
// 6. vat id check.
try {
$oInputValidator->checkVatId($this, $aInvAddress);
} catch (\OxidEsales\Eshop\Core\Exception\ConnectionException $e) {
// R080730 just oxInputException is passed here
// if it oxConnectionException, it means it could not check vat id
// and will set 'not checked' status to it later
}
// throwing first validation error
if ($oError = Registry::getInputValidator()->getFirstValidationError()) {
throw $oError;
}
} | [
"public",
"function",
"checkValues",
"(",
"$",
"sLogin",
",",
"$",
"sPassword",
",",
"$",
"sPassword2",
",",
"$",
"aInvAddress",
",",
"$",
"aDelAddress",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Core\\InputValidator $oInputValidator */",
"$",
"oInputValidator",
"=",
"... | Performs bunch of checks if user profile data is correct; on any
error exception is thrown
@param string $sLogin user login name
@param string $sPassword user password
@param string $sPassword2 user password to compare
@param array $aInvAddress array of user profile data
@param array $aDelAddress array of user profile data
@throws UserException, oxInputException | [
"Performs",
"bunch",
"of",
"checks",
"if",
"user",
"profile",
"data",
"is",
"correct",
";",
"on",
"any",
"error",
"exception",
"is",
"thrown"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1059-L1092 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.setNewsSubscription | public function setNewsSubscription($blSubscribe, $blSendOptIn, $blForceCheckOptIn = false)
{
// assigning to newsletter
$blSuccess = false;
// user wants to get newsletter messages or no ?
$oNewsSubscription = $this->getNewsSubscription();
if ($oNewsSubscription) {
if ($blSubscribe && ($blForceCheckOptIn || ($iOptInStatus = $oNewsSubscription->getOptInStatus()) != 1)) {
if (!$blSendOptIn) {
// double-opt-in check is disabled - assigning automatically
$this->addToGroup('oxidnewsletter');
// and setting subscribed status
$oNewsSubscription->setOptInStatus(1);
$blSuccess = true;
} else {
// double-opt-in check enabled - sending confirmation email and setting waiting status
if ($iOptInStatus != 2) {
// sending double-opt-in mail
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
$blSuccess = $oEmail->sendNewsletterDbOptInMail($this);
} else {
// mail already was sent, so just confirming that
$blSuccess = true;
}
$oNewsSubscription->setOptInStatus(2);
}
} elseif (!$blSubscribe) {
// removing user from newsletter subscribers
$this->removeFromGroup('oxidnewsletter');
$oNewsSubscription->setOptInStatus(0);
$blSuccess = true;
}
}
return $blSuccess;
} | php | public function setNewsSubscription($blSubscribe, $blSendOptIn, $blForceCheckOptIn = false)
{
// assigning to newsletter
$blSuccess = false;
// user wants to get newsletter messages or no ?
$oNewsSubscription = $this->getNewsSubscription();
if ($oNewsSubscription) {
if ($blSubscribe && ($blForceCheckOptIn || ($iOptInStatus = $oNewsSubscription->getOptInStatus()) != 1)) {
if (!$blSendOptIn) {
// double-opt-in check is disabled - assigning automatically
$this->addToGroup('oxidnewsletter');
// and setting subscribed status
$oNewsSubscription->setOptInStatus(1);
$blSuccess = true;
} else {
// double-opt-in check enabled - sending confirmation email and setting waiting status
if ($iOptInStatus != 2) {
// sending double-opt-in mail
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
$blSuccess = $oEmail->sendNewsletterDbOptInMail($this);
} else {
// mail already was sent, so just confirming that
$blSuccess = true;
}
$oNewsSubscription->setOptInStatus(2);
}
} elseif (!$blSubscribe) {
// removing user from newsletter subscribers
$this->removeFromGroup('oxidnewsletter');
$oNewsSubscription->setOptInStatus(0);
$blSuccess = true;
}
}
return $blSuccess;
} | [
"public",
"function",
"setNewsSubscription",
"(",
"$",
"blSubscribe",
",",
"$",
"blSendOptIn",
",",
"$",
"blForceCheckOptIn",
"=",
"false",
")",
"{",
"// assigning to newsletter",
"$",
"blSuccess",
"=",
"false",
";",
"// user wants to get newsletter messages or no ?",
"... | Sets newsletter subscription status to user
@param bool $blSubscribe subscribes/unsubscribes user from newsletter
@param bool $blSendOptIn if to send confirmation email
@param bool $blForceCheckOptIn forces to check subscription even when it is set to 1
@return bool | [
"Sets",
"newsletter",
"subscription",
"status",
"to",
"user"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1103-L1140 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getMergedAddressFields | protected function _getMergedAddressFields()
{
$sDelAddress = '';
$sDelAddress .= $this->oxuser__oxcompany;
$sDelAddress .= $this->oxuser__oxusername;
$sDelAddress .= $this->oxuser__oxfname;
$sDelAddress .= $this->oxuser__oxlname;
$sDelAddress .= $this->oxuser__oxstreet;
$sDelAddress .= $this->oxuser__oxstreetnr;
$sDelAddress .= $this->oxuser__oxaddinfo;
$sDelAddress .= $this->oxuser__oxustid;
$sDelAddress .= $this->oxuser__oxcity;
$sDelAddress .= $this->oxuser__oxcountryid;
$sDelAddress .= $this->oxuser__oxstateid;
$sDelAddress .= $this->oxuser__oxzip;
$sDelAddress .= $this->oxuser__oxfon;
$sDelAddress .= $this->oxuser__oxfax;
$sDelAddress .= $this->oxuser__oxsal;
return $sDelAddress;
} | php | protected function _getMergedAddressFields()
{
$sDelAddress = '';
$sDelAddress .= $this->oxuser__oxcompany;
$sDelAddress .= $this->oxuser__oxusername;
$sDelAddress .= $this->oxuser__oxfname;
$sDelAddress .= $this->oxuser__oxlname;
$sDelAddress .= $this->oxuser__oxstreet;
$sDelAddress .= $this->oxuser__oxstreetnr;
$sDelAddress .= $this->oxuser__oxaddinfo;
$sDelAddress .= $this->oxuser__oxustid;
$sDelAddress .= $this->oxuser__oxcity;
$sDelAddress .= $this->oxuser__oxcountryid;
$sDelAddress .= $this->oxuser__oxstateid;
$sDelAddress .= $this->oxuser__oxzip;
$sDelAddress .= $this->oxuser__oxfon;
$sDelAddress .= $this->oxuser__oxfax;
$sDelAddress .= $this->oxuser__oxsal;
return $sDelAddress;
} | [
"protected",
"function",
"_getMergedAddressFields",
"(",
")",
"{",
"$",
"sDelAddress",
"=",
"''",
";",
"$",
"sDelAddress",
".=",
"$",
"this",
"->",
"oxuser__oxcompany",
";",
"$",
"sDelAddress",
".=",
"$",
"this",
"->",
"oxuser__oxusername",
";",
"$",
"sDelAddr... | Returns merged delivery address fields.
@return string | [
"Returns",
"merged",
"delivery",
"address",
"fields",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1183-L1203 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._assignAddress | protected function _assignAddress($aDelAddress)
{
if (is_array($aDelAddress) && count($aDelAddress)) {
$sAddressId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxaddressid');
$sAddressId = ($sAddressId === null || $sAddressId == -1 || $sAddressId == -2) ? null : $sAddressId;
$oAddress = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
$oAddress->setId($sAddressId);
$oAddress->load($sAddressId);
$oAddress->assign($aDelAddress);
$oAddress->oxaddress__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
$oAddress->oxaddress__oxcountry = $this->getUserCountry($oAddress->oxaddress__oxcountryid->value);
$oAddress->save();
// resetting addresses
$this->_aAddresses = null;
// saving delivery Address for later use
Registry::getSession()->setVariable('deladrid', $oAddress->getId());
} else {
// resetting
Registry::getSession()->setVariable('deladrid', null);
}
} | php | protected function _assignAddress($aDelAddress)
{
if (is_array($aDelAddress) && count($aDelAddress)) {
$sAddressId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxaddressid');
$sAddressId = ($sAddressId === null || $sAddressId == -1 || $sAddressId == -2) ? null : $sAddressId;
$oAddress = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
$oAddress->setId($sAddressId);
$oAddress->load($sAddressId);
$oAddress->assign($aDelAddress);
$oAddress->oxaddress__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
$oAddress->oxaddress__oxcountry = $this->getUserCountry($oAddress->oxaddress__oxcountryid->value);
$oAddress->save();
// resetting addresses
$this->_aAddresses = null;
// saving delivery Address for later use
Registry::getSession()->setVariable('deladrid', $oAddress->getId());
} else {
// resetting
Registry::getSession()->setVariable('deladrid', null);
}
} | [
"protected",
"function",
"_assignAddress",
"(",
"$",
"aDelAddress",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"aDelAddress",
")",
"&&",
"count",
"(",
"$",
"aDelAddress",
")",
")",
"{",
"$",
"sAddressId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Co... | creates new address entry or updates existing
@param array $aDelAddress address data array | [
"creates",
"new",
"address",
"entry",
"or",
"updates",
"existing"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1210-L1233 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getLoginQueryHashedWithMD5 | protected function _getLoginQueryHashedWithMD5($userName, $password, $shopId, $isAdmin)
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$userNameCondition = $this->formQueryPartForUserName($userName, $database);
$passwordCondition = $this->formQueryPartForMD5Password($password, $database);
$shopOrRightsCondition = $this->formQueryPartForAdminView($shopId, $isAdmin);
$userActiveCondition = $this->formQueryPartForActiveUser();
$query = "SELECT `oxid`
FROM oxuser
WHERE 1
AND $userActiveCondition
AND $passwordCondition
AND $userNameCondition
$shopOrRightsCondition
";
return $query;
} | php | protected function _getLoginQueryHashedWithMD5($userName, $password, $shopId, $isAdmin)
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$userNameCondition = $this->formQueryPartForUserName($userName, $database);
$passwordCondition = $this->formQueryPartForMD5Password($password, $database);
$shopOrRightsCondition = $this->formQueryPartForAdminView($shopId, $isAdmin);
$userActiveCondition = $this->formQueryPartForActiveUser();
$query = "SELECT `oxid`
FROM oxuser
WHERE 1
AND $userActiveCondition
AND $passwordCondition
AND $userNameCondition
$shopOrRightsCondition
";
return $query;
} | [
"protected",
"function",
"_getLoginQueryHashedWithMD5",
"(",
"$",
"userName",
",",
"$",
"password",
",",
"$",
"shopId",
",",
"$",
"isAdmin",
")",
"{",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"get... | Builds and returns user login query.
MD5 encoding is used in legacy eShop versions.
We still allow to perform the login for users registered in the previous eshop versions.
@param string $userName login name
@param string $password login password
@param string $shopId shopid
@param bool $isAdmin admin/non admin mode
@deprecated since v6.4.0 (2019-03-15); This method will be removed completely.
@return string | [
"Builds",
"and",
"returns",
"user",
"login",
"query",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1250-L1269 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getLoginQuery | protected function _getLoginQuery($userName, $password, $shopId, $isAdmin)
{
$database = DatabaseProvider::getDb();
$userNameCondition = $this->formQueryPartForUserName($userName, $database);
$shopOrRightsCondition = $this->formQueryPartForAdminView($shopId, $isAdmin);
$passwordCondition = $this->formQueryPartForSha512Password($password, $database, $userNameCondition, $shopOrRightsCondition);
$userActiveCondition = $this->formQueryPartForActiveUser();
$query = "SELECT `oxid`
FROM oxuser
WHERE 1
AND $userActiveCondition
AND $passwordCondition
AND $userNameCondition
$shopOrRightsCondition
";
return $query;
} | php | protected function _getLoginQuery($userName, $password, $shopId, $isAdmin)
{
$database = DatabaseProvider::getDb();
$userNameCondition = $this->formQueryPartForUserName($userName, $database);
$shopOrRightsCondition = $this->formQueryPartForAdminView($shopId, $isAdmin);
$passwordCondition = $this->formQueryPartForSha512Password($password, $database, $userNameCondition, $shopOrRightsCondition);
$userActiveCondition = $this->formQueryPartForActiveUser();
$query = "SELECT `oxid`
FROM oxuser
WHERE 1
AND $userActiveCondition
AND $passwordCondition
AND $userNameCondition
$shopOrRightsCondition
";
return $query;
} | [
"protected",
"function",
"_getLoginQuery",
"(",
"$",
"userName",
",",
"$",
"password",
",",
"$",
"shopId",
",",
"$",
"isAdmin",
")",
"{",
"$",
"database",
"=",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"userNameCondition",
"=",
"$",
"this",
... | Builds and returns user login query
@param string $userName
@param string $password
@param int $shopId
@param bool $isAdmin
@deprecated since v6.4.0 (2019-03-15); This method will be removed completely.
@return string | [
"Builds",
"and",
"returns",
"user",
"login",
"query"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1283-L1302 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getShopSelect | protected function _getShopSelect($myConfig, $sShopID, $blAdmin)
{
$sShopSelect = $this->formQueryPartForAdminView($sShopID, $blAdmin);
return $sShopSelect;
} | php | protected function _getShopSelect($myConfig, $sShopID, $blAdmin)
{
$sShopSelect = $this->formQueryPartForAdminView($sShopID, $blAdmin);
return $sShopSelect;
} | [
"protected",
"function",
"_getShopSelect",
"(",
"$",
"myConfig",
",",
"$",
"sShopID",
",",
"$",
"blAdmin",
")",
"{",
"$",
"sShopSelect",
"=",
"$",
"this",
"->",
"formQueryPartForAdminView",
"(",
"$",
"sShopID",
",",
"$",
"blAdmin",
")",
";",
"return",
"$",... | Returns shopselect part of login query sql
@param object $myConfig shop config
@param string $sShopID shopid
@param bool $blAdmin admin/non admin mode
@return string | [
"Returns",
"shopselect",
"part",
"of",
"login",
"query",
"sql"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1313-L1318 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.login | public function login($userName, $password, $setSessionCookie = false)
{
$isLoginAttemptToAdminBackend = $this->isAdmin();
$cookie = Registry::getUtilsServer()->getOxCookie();
if ($cookie === null && $isLoginAttemptToAdminBackend) {
throw oxNew(CookieException::class, 'ERROR_MESSAGE_COOKIE_NOCOOKIE');
}
$config = Registry::getConfig();
$shopId = $config->getShopId();
/** New authentication mechanism */
$passwordHashFromDatabase = $this->getPasswordHashFromDatabase($userName, $shopId, $isLoginAttemptToAdminBackend);
$passwordServiceBridge = $this->getContainer()->get(PasswordServiceBridgeInterface::class);
if ($password && !$this->isLoaded()) {
$userIsAuthenticated = $passwordServiceBridge->verifyPassword($password, $passwordHashFromDatabase);
if ($userIsAuthenticated) {
$this->loadAuthenticatedUser($userName, $shopId);
}
}
/** Old authentication + authorization */
if ($password && !$this->isLoaded()) {
$this->_dbLogin($userName, $password, $shopId);
}
/** If needed, store a rehashed password with the authenticated user */
if ($password && $this->isLoaded()) {
$algorithm = Registry::getConfig()->getConfigParam('passwordHashingAlgorithm', 'PASSWORD_BCRYPT');
$passwordNeedsRehash = $this->isOutdatedPasswordHashAlgorithmUsed ||
$passwordServiceBridge->passwordNeedsRehash($passwordHashFromDatabase, $algorithm);
if ($passwordNeedsRehash) {
$generatedPasswordHash = $this->hashPassword($password);
$this->oxuser__oxpassword = new Field($generatedPasswordHash, Field::T_RAW);
/** The use of a salt is deprecated and an empty salt will be stored */
$this->oxuser__oxpasssalt = new Field('');
$this->save();
}
}
/** Event for alternative authentication and authorization mechanisms, or whatsoever */
$this->onLogin($userName, $password);
/**
* If the user has not been loaded until this point, authentication & authorization is considered as failed.
*/
if (!$this->isLoaded()) {
throw oxNew(UserException::class, 'ERROR_MESSAGE_USER_NOVALIDLOGIN');
}
//resetting active user
$this->setUser(null);
if ($isLoginAttemptToAdminBackend) {
Registry::getSession()->setVariable('auth', $this->oxuser__oxid->value);
} else {
Registry::getSession()->setVariable('usr', $this->oxuser__oxid->value);
}
// cookie must be set ?
if ($setSessionCookie && $config->getConfigParam('blShowRememberMe')) {
Registry::getUtilsServer()->setUserCookie(
$this->oxuser__oxusername->value,
$this->oxuser__oxpassword->value,
$config->getShopId(),
31536000,
static::USER_COOKIE_SALT
);
}
return true;
} | php | public function login($userName, $password, $setSessionCookie = false)
{
$isLoginAttemptToAdminBackend = $this->isAdmin();
$cookie = Registry::getUtilsServer()->getOxCookie();
if ($cookie === null && $isLoginAttemptToAdminBackend) {
throw oxNew(CookieException::class, 'ERROR_MESSAGE_COOKIE_NOCOOKIE');
}
$config = Registry::getConfig();
$shopId = $config->getShopId();
/** New authentication mechanism */
$passwordHashFromDatabase = $this->getPasswordHashFromDatabase($userName, $shopId, $isLoginAttemptToAdminBackend);
$passwordServiceBridge = $this->getContainer()->get(PasswordServiceBridgeInterface::class);
if ($password && !$this->isLoaded()) {
$userIsAuthenticated = $passwordServiceBridge->verifyPassword($password, $passwordHashFromDatabase);
if ($userIsAuthenticated) {
$this->loadAuthenticatedUser($userName, $shopId);
}
}
/** Old authentication + authorization */
if ($password && !$this->isLoaded()) {
$this->_dbLogin($userName, $password, $shopId);
}
/** If needed, store a rehashed password with the authenticated user */
if ($password && $this->isLoaded()) {
$algorithm = Registry::getConfig()->getConfigParam('passwordHashingAlgorithm', 'PASSWORD_BCRYPT');
$passwordNeedsRehash = $this->isOutdatedPasswordHashAlgorithmUsed ||
$passwordServiceBridge->passwordNeedsRehash($passwordHashFromDatabase, $algorithm);
if ($passwordNeedsRehash) {
$generatedPasswordHash = $this->hashPassword($password);
$this->oxuser__oxpassword = new Field($generatedPasswordHash, Field::T_RAW);
/** The use of a salt is deprecated and an empty salt will be stored */
$this->oxuser__oxpasssalt = new Field('');
$this->save();
}
}
/** Event for alternative authentication and authorization mechanisms, or whatsoever */
$this->onLogin($userName, $password);
/**
* If the user has not been loaded until this point, authentication & authorization is considered as failed.
*/
if (!$this->isLoaded()) {
throw oxNew(UserException::class, 'ERROR_MESSAGE_USER_NOVALIDLOGIN');
}
//resetting active user
$this->setUser(null);
if ($isLoginAttemptToAdminBackend) {
Registry::getSession()->setVariable('auth', $this->oxuser__oxid->value);
} else {
Registry::getSession()->setVariable('usr', $this->oxuser__oxid->value);
}
// cookie must be set ?
if ($setSessionCookie && $config->getConfigParam('blShowRememberMe')) {
Registry::getUtilsServer()->setUserCookie(
$this->oxuser__oxusername->value,
$this->oxuser__oxpassword->value,
$config->getShopId(),
31536000,
static::USER_COOKIE_SALT
);
}
return true;
} | [
"public",
"function",
"login",
"(",
"$",
"userName",
",",
"$",
"password",
",",
"$",
"setSessionCookie",
"=",
"false",
")",
"{",
"$",
"isLoginAttemptToAdminBackend",
"=",
"$",
"this",
"->",
"isAdmin",
"(",
")",
";",
"$",
"cookie",
"=",
"Registry",
"::",
... | Performs user login by username and password. Fetches user data from DB.
Registers in session. Returns true on success, FALSE otherwise.
NOTE: It the user has already been loaded prior calling \OxidEsales\Eshop\Application\Model\User::login,
NO valid password is necessary for login.
@param string $userName User username
@param string $password User password
@param bool $setSessionCookie (default false)
@throws object
@throws oxCookieException
@throws UserException
@return bool | [
"Performs",
"user",
"login",
"by",
"username",
"and",
"password",
".",
"Fetches",
"user",
"data",
"from",
"DB",
".",
"Registers",
"in",
"session",
".",
"Returns",
"true",
"on",
"success",
"FALSE",
"otherwise",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1337-L1409 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.logout | public function logout()
{
// deleting session info
Registry::getSession()->deleteVariable('usr'); // for front end
Registry::getSession()->deleteVariable('auth'); // for back end
Registry::getSession()->deleteVariable('dynvalue');
Registry::getSession()->deleteVariable('paymentid');
// Registry::getSession()->deleteVariable( 'deladrid' );
// delete cookie
Registry::getUtilsServer()->deleteUserCookie(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopID());
// unsetting global user
$this->setUser(null);
return true;
} | php | public function logout()
{
// deleting session info
Registry::getSession()->deleteVariable('usr'); // for front end
Registry::getSession()->deleteVariable('auth'); // for back end
Registry::getSession()->deleteVariable('dynvalue');
Registry::getSession()->deleteVariable('paymentid');
// Registry::getSession()->deleteVariable( 'deladrid' );
// delete cookie
Registry::getUtilsServer()->deleteUserCookie(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopID());
// unsetting global user
$this->setUser(null);
return true;
} | [
"public",
"function",
"logout",
"(",
")",
"{",
"// deleting session info",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"deleteVariable",
"(",
"'usr'",
")",
";",
"// for front end",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"deleteVariable",
"(",
"'auth... | Logs out session user. Returns true on success
@return bool | [
"Logs",
"out",
"session",
"user",
".",
"Returns",
"true",
"on",
"success"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1456-L1472 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.loadActiveUser | public function loadActiveUser($blForceAdmin = false)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$blAdmin = $this->isAdmin() || $blForceAdmin;
// first - checking session info
$sUserID = $blAdmin ? Registry::getSession()->getVariable('auth') : Registry::getSession()->getVariable('usr');
// trying automatic login (by 'remember me' cookie)
$blFoundInCookie = false;
if (!$sUserID && !$blAdmin && $oConfig->getConfigParam('blShowRememberMe')) {
$sUserID = $this->_getCookieUserId();
$blFoundInCookie = $sUserID ? true : false;
}
// checking user results
if ($sUserID) {
if ($this->load($sUserID)) {
// storing into session
if ($blAdmin) {
Registry::getSession()->setVariable('auth', $sUserID);
} else {
Registry::getSession()->setVariable('usr', $sUserID);
}
// marking the way user was loaded
$this->_blLoadedFromCookie = $blFoundInCookie;
return true;
}
} else {
// no user
if ($blAdmin) {
Registry::getSession()->deleteVariable('auth');
} else {
Registry::getSession()->deleteVariable('usr');
}
return false;
}
} | php | public function loadActiveUser($blForceAdmin = false)
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$blAdmin = $this->isAdmin() || $blForceAdmin;
// first - checking session info
$sUserID = $blAdmin ? Registry::getSession()->getVariable('auth') : Registry::getSession()->getVariable('usr');
// trying automatic login (by 'remember me' cookie)
$blFoundInCookie = false;
if (!$sUserID && !$blAdmin && $oConfig->getConfigParam('blShowRememberMe')) {
$sUserID = $this->_getCookieUserId();
$blFoundInCookie = $sUserID ? true : false;
}
// checking user results
if ($sUserID) {
if ($this->load($sUserID)) {
// storing into session
if ($blAdmin) {
Registry::getSession()->setVariable('auth', $sUserID);
} else {
Registry::getSession()->setVariable('usr', $sUserID);
}
// marking the way user was loaded
$this->_blLoadedFromCookie = $blFoundInCookie;
return true;
}
} else {
// no user
if ($blAdmin) {
Registry::getSession()->deleteVariable('auth');
} else {
Registry::getSession()->deleteVariable('usr');
}
return false;
}
} | [
"public",
"function",
"loadActiveUser",
"(",
"$",
"blForceAdmin",
"=",
"false",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"blAdmin",
"=",
"$",
"this",
"->",
... | Loads active user object. If
user is not available - returns false.
@param bool $blForceAdmin (default false)
@return bool | [
"Loads",
"active",
"user",
"object",
".",
"If",
"user",
"is",
"not",
"available",
"-",
"returns",
"false",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1493-L1534 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getCookieUserId | protected function _getCookieUserId()
{
$sUserID = null;
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sShopID = $oConfig->getShopId();
if (($sSet = Registry::getUtilsServer()->getUserCookie($sShopID))) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$aData = explode('@@@', $sSet);
$sUser = $aData[0];
$sPWD = @$aData[1];
$sSelect = $this->formUserCookieQuery($sUser, $sShopID);
$rs = $oDb->select($sSelect);
if ($rs != false && $rs->count() > 0) {
while (!$rs->EOF) {
$sTest = crypt($rs->fields[1], static::USER_COOKIE_SALT);
if ($sTest == $sPWD) {
// found
$sUserID = $rs->fields[0];
break;
}
$rs->fetchRow();
}
}
// if cookie info is not valid, remove it.
if (!$sUserID) {
Registry::getUtilsServer()->deleteUserCookie($sShopID);
}
}
return $sUserID;
} | php | protected function _getCookieUserId()
{
$sUserID = null;
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sShopID = $oConfig->getShopId();
if (($sSet = Registry::getUtilsServer()->getUserCookie($sShopID))) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$aData = explode('@@@', $sSet);
$sUser = $aData[0];
$sPWD = @$aData[1];
$sSelect = $this->formUserCookieQuery($sUser, $sShopID);
$rs = $oDb->select($sSelect);
if ($rs != false && $rs->count() > 0) {
while (!$rs->EOF) {
$sTest = crypt($rs->fields[1], static::USER_COOKIE_SALT);
if ($sTest == $sPWD) {
// found
$sUserID = $rs->fields[0];
break;
}
$rs->fetchRow();
}
}
// if cookie info is not valid, remove it.
if (!$sUserID) {
Registry::getUtilsServer()->deleteUserCookie($sShopID);
}
}
return $sUserID;
} | [
"protected",
"function",
"_getCookieUserId",
"(",
")",
"{",
"$",
"sUserID",
"=",
"null",
";",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"sShopID",
"=",
"$",
"oConfig",
... | Checks if user is connected via cookies and if so, returns user id.
@return string | [
"Checks",
"if",
"user",
"is",
"connected",
"via",
"cookies",
"and",
"if",
"so",
"returns",
"user",
"id",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1541-L1572 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._ldapLogin | protected function _ldapLogin($sUser, $sPassword, $sShopID, $sShopSelect)
{
$aLDAPParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aLDAPParams');
$oLDAP = oxNew(\OxidEsales\Eshop\Core\LDAP::class, $aLDAPParams['HOST'], $aLDAPParams['PORT']);
// maybe this is LDAP user but supplied email Address instead of LDAP login
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sLDAPKey = $oDb->getOne("select oxldapkey from oxuser where oxuser.oxactive = 1 and oxuser.oxusername = " . $oDb->quote($sUser) . " $sShopSelect");
if (isset($sLDAPKey) && $sLDAPKey) {
$sUser = $sLDAPKey;
}
//$throws oxConnectionException
$oLDAP->login($sUser, $sPassword, $aLDAPParams['USERQUERY'], $aLDAPParams['BASEDN'], $aLDAPParams['FILTER']);
$aData = $oLDAP->mapData($aLDAPParams['DATAMAP']);
if (isset($aData['OXUSERNAME']) && $aData['OXUSERNAME']) {
// login successful
// check if user is already in database
$sSelect = "select oxid from oxuser where oxuser.oxusername = " . $oDb->quote($aData['OXUSERNAME']) . " $sShopSelect";
$sOXID = $oDb->getOne($sSelect);
if (!isset($sOXID) || !$sOXID) {
// we need to create a new user
//$oUser->oxuser__oxid->setValue($oUser->setId());
$this->setId();
// map all user data fields
foreach ($aData as $fldname => $value) {
$sField = "oxuser__" . strtolower($fldname);
$this->$sField = new Field($aData[$fldname]);
}
$this->oxuser__oxactive = new \OxidEsales\Eshop\Core\Field(1);
$this->oxuser__oxshopid = new \OxidEsales\Eshop\Core\Field($sShopID);
$this->oxuser__oxldapkey = new \OxidEsales\Eshop\Core\Field($sUser);
$this->oxuser__oxrights = new \OxidEsales\Eshop\Core\Field("user");
$this->setPassword("ldap user");
$this->save();
} else {
// LDAP user is already in OXID DB, load it
$this->load($sOXID);
}
} else {
/** @var UserException $oEx */
$oEx = oxNew(UserException::class);
$oEx->setMessage('ERROR_MESSAGE_USER_NOVALUES');
throw $oEx;
}
} | php | protected function _ldapLogin($sUser, $sPassword, $sShopID, $sShopSelect)
{
$aLDAPParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aLDAPParams');
$oLDAP = oxNew(\OxidEsales\Eshop\Core\LDAP::class, $aLDAPParams['HOST'], $aLDAPParams['PORT']);
// maybe this is LDAP user but supplied email Address instead of LDAP login
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sLDAPKey = $oDb->getOne("select oxldapkey from oxuser where oxuser.oxactive = 1 and oxuser.oxusername = " . $oDb->quote($sUser) . " $sShopSelect");
if (isset($sLDAPKey) && $sLDAPKey) {
$sUser = $sLDAPKey;
}
//$throws oxConnectionException
$oLDAP->login($sUser, $sPassword, $aLDAPParams['USERQUERY'], $aLDAPParams['BASEDN'], $aLDAPParams['FILTER']);
$aData = $oLDAP->mapData($aLDAPParams['DATAMAP']);
if (isset($aData['OXUSERNAME']) && $aData['OXUSERNAME']) {
// login successful
// check if user is already in database
$sSelect = "select oxid from oxuser where oxuser.oxusername = " . $oDb->quote($aData['OXUSERNAME']) . " $sShopSelect";
$sOXID = $oDb->getOne($sSelect);
if (!isset($sOXID) || !$sOXID) {
// we need to create a new user
//$oUser->oxuser__oxid->setValue($oUser->setId());
$this->setId();
// map all user data fields
foreach ($aData as $fldname => $value) {
$sField = "oxuser__" . strtolower($fldname);
$this->$sField = new Field($aData[$fldname]);
}
$this->oxuser__oxactive = new \OxidEsales\Eshop\Core\Field(1);
$this->oxuser__oxshopid = new \OxidEsales\Eshop\Core\Field($sShopID);
$this->oxuser__oxldapkey = new \OxidEsales\Eshop\Core\Field($sUser);
$this->oxuser__oxrights = new \OxidEsales\Eshop\Core\Field("user");
$this->setPassword("ldap user");
$this->save();
} else {
// LDAP user is already in OXID DB, load it
$this->load($sOXID);
}
} else {
/** @var UserException $oEx */
$oEx = oxNew(UserException::class);
$oEx->setMessage('ERROR_MESSAGE_USER_NOVALUES');
throw $oEx;
}
} | [
"protected",
"function",
"_ldapLogin",
"(",
"$",
"sUser",
",",
"$",
"sPassword",
",",
"$",
"sShopID",
",",
"$",
"sShopSelect",
")",
"{",
"$",
"aLDAPParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
"... | Login for Ldap
@param string $sUser User username
@param string $sPassword User password
@param string $sShopID Shop id
@param string $sShopSelect Shop select
@deprecated v5.3 (2016-10-06); LDAP will be moved to own module.
@throws $oEx if user is wrong | [
"Login",
"for",
"Ldap"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1586-L1637 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getUserRights | protected function _getUserRights()
{
// previously user had no rights defined
if (!$this->oxuser__oxrights instanceof \OxidEsales\Eshop\Core\Field || !$this->oxuser__oxrights->value) {
return 'user';
}
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sAuthRights = null;
// choosing possible user rights index
$sAuthUserID = $this->isAdmin() ? Registry::getSession()->getVariable('auth') : null;
$sAuthUserID = $sAuthUserID ? $sAuthUserID : Registry::getSession()->getVariable('usr');
if ($sAuthUserID) {
$sAuthRights = $oDb->getOne('select oxrights from ' . $this->getViewName() . ' where oxid=' . $oDb->quote($sAuthUserID));
}
//preventing user rights edit for non admin
$aRights = [];
// selecting current users rights ...
if ($sCurrRights = $oDb->getOne('select oxrights from ' . $this->getViewName() . ' where oxid=' . $oDb->quote($this->getId()))) {
$aRights[] = $sCurrRights;
}
$aRights[] = 'user';
if (!$sAuthRights || !($sAuthRights == 'malladmin' || $sAuthRights == $myConfig->getShopId())) {
return current($aRights);
} elseif ($sAuthRights == $myConfig->getShopId()) {
$aRights[] = $sAuthRights;
if (!in_array($this->oxuser__oxrights->value, $aRights)) {
return current($aRights);
}
}
// leaving as it was set ...
return $this->oxuser__oxrights->value;
} | php | protected function _getUserRights()
{
// previously user had no rights defined
if (!$this->oxuser__oxrights instanceof \OxidEsales\Eshop\Core\Field || !$this->oxuser__oxrights->value) {
return 'user';
}
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$sAuthRights = null;
// choosing possible user rights index
$sAuthUserID = $this->isAdmin() ? Registry::getSession()->getVariable('auth') : null;
$sAuthUserID = $sAuthUserID ? $sAuthUserID : Registry::getSession()->getVariable('usr');
if ($sAuthUserID) {
$sAuthRights = $oDb->getOne('select oxrights from ' . $this->getViewName() . ' where oxid=' . $oDb->quote($sAuthUserID));
}
//preventing user rights edit for non admin
$aRights = [];
// selecting current users rights ...
if ($sCurrRights = $oDb->getOne('select oxrights from ' . $this->getViewName() . ' where oxid=' . $oDb->quote($this->getId()))) {
$aRights[] = $sCurrRights;
}
$aRights[] = 'user';
if (!$sAuthRights || !($sAuthRights == 'malladmin' || $sAuthRights == $myConfig->getShopId())) {
return current($aRights);
} elseif ($sAuthRights == $myConfig->getShopId()) {
$aRights[] = $sAuthRights;
if (!in_array($this->oxuser__oxrights->value, $aRights)) {
return current($aRights);
}
}
// leaving as it was set ...
return $this->oxuser__oxrights->value;
} | [
"protected",
"function",
"_getUserRights",
"(",
")",
"{",
"// previously user had no rights defined",
"if",
"(",
"!",
"$",
"this",
"->",
"oxuser__oxrights",
"instanceof",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
"||",
"!",
"$",
"this",
"->... | Returns user rights index. Index cannot be higher than current session
user rights index.
@return string | [
"Returns",
"user",
"rights",
"index",
".",
"Index",
"cannot",
"be",
"higher",
"than",
"current",
"session",
"user",
"rights",
"index",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1645-L1683 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._insert | protected function _insert()
{
// set oxcreate date
$this->oxuser__oxcreate = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s'), \OxidEsales\Eshop\Core\Field::T_RAW);
if (!isset($this->oxuser__oxboni->value)) {
$this->oxuser__oxboni = new \OxidEsales\Eshop\Core\Field($this->getBoni(), \OxidEsales\Eshop\Core\Field::T_RAW);
}
return parent::_insert();
} | php | protected function _insert()
{
// set oxcreate date
$this->oxuser__oxcreate = new \OxidEsales\Eshop\Core\Field(date('Y-m-d H:i:s'), \OxidEsales\Eshop\Core\Field::T_RAW);
if (!isset($this->oxuser__oxboni->value)) {
$this->oxuser__oxboni = new \OxidEsales\Eshop\Core\Field($this->getBoni(), \OxidEsales\Eshop\Core\Field::T_RAW);
}
return parent::_insert();
} | [
"protected",
"function",
"_insert",
"(",
")",
"{",
"// set oxcreate date",
"$",
"this",
"->",
"oxuser__oxcreate",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
"(",
"date",
"(",
"'Y-m-d H:i:s'",
")",
",",
"\\",
"OxidEsales",
"\\... | Inserts user object data to DB. Returns true on success.
@return bool | [
"Inserts",
"user",
"object",
"data",
"to",
"DB",
".",
"Returns",
"true",
"on",
"success",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1690-L1701 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._update | protected function _update()
{
//V #M418: for not registered users, don't change boni during update
if (!$this->oxuser__oxpassword->value && $this->oxuser__oxregister->value < 1) {
$this->_aSkipSaveFields[] = 'oxboni';
}
// don't change this field
$this->_aSkipSaveFields[] = 'oxcreate';
if (!$this->isAdmin()) {
$this->_aSkipSaveFields[] = 'oxcustnr';
$this->_aSkipSaveFields[] = 'oxrights';
}
// updating subscription information
if (($blUpdate = parent::_update())) {
$this->getNewsSubscription()->updateSubscription($this);
}
return $blUpdate;
} | php | protected function _update()
{
//V #M418: for not registered users, don't change boni during update
if (!$this->oxuser__oxpassword->value && $this->oxuser__oxregister->value < 1) {
$this->_aSkipSaveFields[] = 'oxboni';
}
// don't change this field
$this->_aSkipSaveFields[] = 'oxcreate';
if (!$this->isAdmin()) {
$this->_aSkipSaveFields[] = 'oxcustnr';
$this->_aSkipSaveFields[] = 'oxrights';
}
// updating subscription information
if (($blUpdate = parent::_update())) {
$this->getNewsSubscription()->updateSubscription($this);
}
return $blUpdate;
} | [
"protected",
"function",
"_update",
"(",
")",
"{",
"//V #M418: for not registered users, don't change boni during update",
"if",
"(",
"!",
"$",
"this",
"->",
"oxuser__oxpassword",
"->",
"value",
"&&",
"$",
"this",
"->",
"oxuser__oxregister",
"->",
"value",
"<",
"1",
... | Updates changed user object data to DB. Returns true on success.
@return bool | [
"Updates",
"changed",
"user",
"object",
"data",
"to",
"DB",
".",
"Returns",
"true",
"on",
"success",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1708-L1728 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.checkIfEmailExists | public function checkIfEmailExists($sEmail)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$iShopId = $myConfig->getShopId();
$blExists = false;
$sQ = 'select oxshopid, oxrights, oxpassword from oxuser where oxusername = ' . $masterDb->quote($sEmail);
if (($sOxid = $this->getId())) {
$sQ .= " and oxid <> " . $masterDb->quote($sOxid);
}
$oRs = $masterDb->select($sQ, false);
if ($oRs != false && $oRs->count() > 0) {
if ($this->_blMallUsers) {
$blExists = true;
if ($oRs->fields[1] == 'user' && !$oRs->fields[2]) {
// password is not set - allow to override
$blExists = false;
}
} else {
$blExists = false;
while (!$oRs->EOF) {
if ($oRs->fields[1] != 'user') {
// exists admin with same login - must not allow
$blExists = true;
break;
} elseif ($oRs->fields[0] == $iShopId && $oRs->fields[2]) {
// exists same login (with password) in same shop
$blExists = true;
break;
}
$oRs->fetchRow();
}
}
}
return $blExists;
} | php | public function checkIfEmailExists($sEmail)
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$iShopId = $myConfig->getShopId();
$blExists = false;
$sQ = 'select oxshopid, oxrights, oxpassword from oxuser where oxusername = ' . $masterDb->quote($sEmail);
if (($sOxid = $this->getId())) {
$sQ .= " and oxid <> " . $masterDb->quote($sOxid);
}
$oRs = $masterDb->select($sQ, false);
if ($oRs != false && $oRs->count() > 0) {
if ($this->_blMallUsers) {
$blExists = true;
if ($oRs->fields[1] == 'user' && !$oRs->fields[2]) {
// password is not set - allow to override
$blExists = false;
}
} else {
$blExists = false;
while (!$oRs->EOF) {
if ($oRs->fields[1] != 'user') {
// exists admin with same login - must not allow
$blExists = true;
break;
} elseif ($oRs->fields[0] == $iShopId && $oRs->fields[2]) {
// exists same login (with password) in same shop
$blExists = true;
break;
}
$oRs->fetchRow();
}
}
}
return $blExists;
} | [
"public",
"function",
"checkIfEmailExists",
"(",
"$",
"sEmail",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"// We force reading from master to prevent issues with slow replicatio... | Checks for already used email
@param string $sEmail user email/login
@return null | [
"Checks",
"for",
"already",
"used",
"email"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1737-L1776 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getUserRecommLists | public function getUserRecommLists($sOXID = null)
{
if (!$sOXID) {
$sOXID = $this->getId();
}
// sets active page
$iActPage = (int) Registry::getConfig()->getRequestParameter('pgNr');
$iActPage = ($iActPage < 0) ? 0 : $iActPage;
// load only lists which we show on screen
$iNrofCatArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10;
$oRecommList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oRecommList->init('oxrecommlist');
$oRecommList->setSqlLimit($iNrofCatArticles * $iActPage, $iNrofCatArticles);
$iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$sSelect = 'select * from oxrecommlists where oxuserid =' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOXID) . ' and oxshopid ="' . $iShopId . '"';
$oRecommList->selectString($sSelect);
return $oRecommList;
} | php | public function getUserRecommLists($sOXID = null)
{
if (!$sOXID) {
$sOXID = $this->getId();
}
// sets active page
$iActPage = (int) Registry::getConfig()->getRequestParameter('pgNr');
$iActPage = ($iActPage < 0) ? 0 : $iActPage;
// load only lists which we show on screen
$iNrofCatArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10;
$oRecommList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$oRecommList->init('oxrecommlist');
$oRecommList->setSqlLimit($iNrofCatArticles * $iActPage, $iNrofCatArticles);
$iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$sSelect = 'select * from oxrecommlists where oxuserid =' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOXID) . ' and oxshopid ="' . $iShopId . '"';
$oRecommList->selectString($sSelect);
return $oRecommList;
} | [
"public",
"function",
"getUserRecommLists",
"(",
"$",
"sOXID",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"sOXID",
")",
"{",
"$",
"sOXID",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"}",
"// sets active page",
"$",
"iActPage",
"=",
"(",
"int",
... | Returns user recommendation list object
@param string $sOXID object ID (default is null)
@deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
@return object oxList with oxrecommlist objects | [
"Returns",
"user",
"recommendation",
"list",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1787-L1810 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getRecommListsCount | public function getRecommListsCount($sOx = null)
{
if (!$sOx) {
$sOx = $this->getId();
}
if ($this->_iCntRecommLists === null || $sOx) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$this->_iCntRecommLists = 0;
$iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$sSelect = 'select count(oxid) from oxrecommlists where oxuserid = ' . $oDb->quote($sOx) . ' and oxshopid ="' . $iShopId . '"';
$this->_iCntRecommLists = $oDb->getOne($sSelect);
}
return $this->_iCntRecommLists;
} | php | public function getRecommListsCount($sOx = null)
{
if (!$sOx) {
$sOx = $this->getId();
}
if ($this->_iCntRecommLists === null || $sOx) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$this->_iCntRecommLists = 0;
$iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$sSelect = 'select count(oxid) from oxrecommlists where oxuserid = ' . $oDb->quote($sOx) . ' and oxshopid ="' . $iShopId . '"';
$this->_iCntRecommLists = $oDb->getOne($sSelect);
}
return $this->_iCntRecommLists;
} | [
"public",
"function",
"getRecommListsCount",
"(",
"$",
"sOx",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"sOx",
")",
"{",
"$",
"sOx",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"_iCntRecommLists",
"===",
"... | Returns recommlist count
@param string $sOx object ID (default is null)
@deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
@return int | [
"Returns",
"recommlist",
"count"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1821-L1836 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._setAutoGroups | protected function _setAutoGroups($sCountryId)
{
// assigning automatically to specific groups
$blForeigner = true;
$blForeignGroupExists = false;
$blInlandGroupExists = false;
$aHomeCountry = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aHomeCountry');
// foreigner ?
if (is_array($aHomeCountry)) {
if (in_array($sCountryId, $aHomeCountry)) {
$blForeigner = false;
}
} elseif ($sCountryId == $aHomeCountry) {
$blForeigner = false;
}
if ($this->inGroup('oxidforeigncustomer')) {
$blForeignGroupExists = true;
if (!$blForeigner) {
$this->removeFromGroup('oxidforeigncustomer');
}
}
if ($this->inGroup('oxidnewcustomer')) {
$blInlandGroupExists = true;
if ($blForeigner) {
$this->removeFromGroup('oxidnewcustomer');
}
}
if (!$blForeignGroupExists && $blForeigner) {
$this->addToGroup('oxidforeigncustomer');
}
if (!$blInlandGroupExists && !$blForeigner) {
$this->addToGroup('oxidnewcustomer');
}
} | php | protected function _setAutoGroups($sCountryId)
{
// assigning automatically to specific groups
$blForeigner = true;
$blForeignGroupExists = false;
$blInlandGroupExists = false;
$aHomeCountry = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aHomeCountry');
// foreigner ?
if (is_array($aHomeCountry)) {
if (in_array($sCountryId, $aHomeCountry)) {
$blForeigner = false;
}
} elseif ($sCountryId == $aHomeCountry) {
$blForeigner = false;
}
if ($this->inGroup('oxidforeigncustomer')) {
$blForeignGroupExists = true;
if (!$blForeigner) {
$this->removeFromGroup('oxidforeigncustomer');
}
}
if ($this->inGroup('oxidnewcustomer')) {
$blInlandGroupExists = true;
if ($blForeigner) {
$this->removeFromGroup('oxidnewcustomer');
}
}
if (!$blForeignGroupExists && $blForeigner) {
$this->addToGroup('oxidforeigncustomer');
}
if (!$blInlandGroupExists && !$blForeigner) {
$this->addToGroup('oxidnewcustomer');
}
} | [
"protected",
"function",
"_setAutoGroups",
"(",
"$",
"sCountryId",
")",
"{",
"// assigning automatically to specific groups",
"$",
"blForeigner",
"=",
"true",
";",
"$",
"blForeignGroupExists",
"=",
"false",
";",
"$",
"blInlandGroupExists",
"=",
"false",
";",
"$",
"a... | Automatically assigns user to specific groups
according to users country information
@param string $sCountryId users country id | [
"Automatically",
"assigns",
"user",
"to",
"specific",
"groups",
"according",
"to",
"users",
"country",
"information"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1844-L1881 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.loadUserByUpdateId | public function loadUserByUpdateId($sUid)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select oxid from " . $this->getViewName() . " where oxupdateexp >= " . time() . " and MD5( CONCAT( oxid, oxshopid, oxupdatekey ) ) = " . $oDb->quote($sUid);
if ($sUserId = $oDb->getOne($sQ)) {
return $this->load($sUserId);
}
} | php | public function loadUserByUpdateId($sUid)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select oxid from " . $this->getViewName() . " where oxupdateexp >= " . time() . " and MD5( CONCAT( oxid, oxshopid, oxupdatekey ) ) = " . $oDb->quote($sUid);
if ($sUserId = $oDb->getOne($sQ)) {
return $this->load($sUserId);
}
} | [
"public",
"function",
"loadUserByUpdateId",
"(",
"$",
"sUid",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sQ",
"=",
"\"select oxid from \"",
".",
"$",
"this",
"... | Tries to load user object by passed update id. Update id is
generated when user forgot passwords and wants to update it
@param string $sUid update id
@return oxuser | [
"Tries",
"to",
"load",
"user",
"object",
"by",
"passed",
"update",
"id",
".",
"Update",
"id",
"is",
"generated",
"when",
"user",
"forgot",
"passwords",
"and",
"wants",
"to",
"update",
"it"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1891-L1898 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.setUpdateKey | public function setUpdateKey($blReset = false)
{
$utilsObject = $this->getUtilsObjectInstance();
$sUpKey = $blReset ? '' : $utilsObject->generateUId();
$iUpTime = $blReset ? 0 : Registry::getUtilsDate()->getTime() + $this->getUpdateLinkTerm();
// generating key
$this->oxuser__oxupdatekey = new \OxidEsales\Eshop\Core\Field($sUpKey, Field::T_RAW);
// setting expiration time for 6 hours
$this->oxuser__oxupdateexp = new \OxidEsales\Eshop\Core\Field($iUpTime, Field::T_RAW);
// saving
$this->save();
} | php | public function setUpdateKey($blReset = false)
{
$utilsObject = $this->getUtilsObjectInstance();
$sUpKey = $blReset ? '' : $utilsObject->generateUId();
$iUpTime = $blReset ? 0 : Registry::getUtilsDate()->getTime() + $this->getUpdateLinkTerm();
// generating key
$this->oxuser__oxupdatekey = new \OxidEsales\Eshop\Core\Field($sUpKey, Field::T_RAW);
// setting expiration time for 6 hours
$this->oxuser__oxupdateexp = new \OxidEsales\Eshop\Core\Field($iUpTime, Field::T_RAW);
// saving
$this->save();
} | [
"public",
"function",
"setUpdateKey",
"(",
"$",
"blReset",
"=",
"false",
")",
"{",
"$",
"utilsObject",
"=",
"$",
"this",
"->",
"getUtilsObjectInstance",
"(",
")",
";",
"$",
"sUpKey",
"=",
"$",
"blReset",
"?",
"''",
":",
"$",
"utilsObject",
"->",
"generat... | Generates or resets and saves users update key
@param bool $blReset marker to reset update info | [
"Generates",
"or",
"resets",
"and",
"saves",
"users",
"update",
"key"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1905-L1919 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.isExpiredUpdateId | public function isExpiredUpdateId($sKey)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select 1 from " . $this->getViewName() . " where oxupdateexp >= " . time() . " and MD5( CONCAT( oxid, oxshopid, oxupdatekey ) ) = " . $oDb->quote($sKey);
return !((bool) $oDb->getOne($sQ));
} | php | public function isExpiredUpdateId($sKey)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select 1 from " . $this->getViewName() . " where oxupdateexp >= " . time() . " and MD5( CONCAT( oxid, oxshopid, oxupdatekey ) ) = " . $oDb->quote($sKey);
return !((bool) $oDb->getOne($sQ));
} | [
"public",
"function",
"isExpiredUpdateId",
"(",
"$",
"sKey",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sQ",
"=",
"\"select 1 from \"",
".",
"$",
"this",
"->",... | Checks if password update key is not expired yet
@param string $sKey key
@return bool | [
"Checks",
"if",
"password",
"update",
"key",
"is",
"not",
"expired",
"yet"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1938-L1944 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getUpdateId | public function getUpdateId()
{
if ($this->_sUpdateKey === null) {
$this->setUpdateKey();
$this->_sUpdateKey = md5($this->getId() . $this->oxuser__oxshopid->value . $this->oxuser__oxupdatekey->value);
}
return $this->_sUpdateKey;
} | php | public function getUpdateId()
{
if ($this->_sUpdateKey === null) {
$this->setUpdateKey();
$this->_sUpdateKey = md5($this->getId() . $this->oxuser__oxshopid->value . $this->oxuser__oxupdatekey->value);
}
return $this->_sUpdateKey;
} | [
"public",
"function",
"getUpdateId",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sUpdateKey",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setUpdateKey",
"(",
")",
";",
"$",
"this",
"->",
"_sUpdateKey",
"=",
"md5",
"(",
"$",
"this",
"->",
"getId",... | Returns user passwords update id
@return string | [
"Returns",
"user",
"passwords",
"update",
"id"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1951-L1959 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.encodePassword | public function encodePassword($sPassword, $sSalt)
{
/** @var oxSha512Hasher $oSha512Hasher */
$oSha512Hasher = oxNew('oxSha512Hasher');
/** @var oxPasswordHasher $oHasher */
$oHasher = oxNew('oxPasswordHasher', $oSha512Hasher);
return $oHasher->hash($sPassword, $sSalt);
} | php | public function encodePassword($sPassword, $sSalt)
{
/** @var oxSha512Hasher $oSha512Hasher */
$oSha512Hasher = oxNew('oxSha512Hasher');
/** @var oxPasswordHasher $oHasher */
$oHasher = oxNew('oxPasswordHasher', $oSha512Hasher);
return $oHasher->hash($sPassword, $sSalt);
} | [
"public",
"function",
"encodePassword",
"(",
"$",
"sPassword",
",",
"$",
"sSalt",
")",
"{",
"/** @var oxSha512Hasher $oSha512Hasher */",
"$",
"oSha512Hasher",
"=",
"oxNew",
"(",
"'oxSha512Hasher'",
")",
";",
"/** @var oxPasswordHasher $oHasher */",
"$",
"oHasher",
"=",
... | Encodes and returns given password
@param string $sPassword password to encode
@param string $sSalt any unique string value
@deprecated since v6.4.0 (2019-03-15); This method will be removed completely. Use PasswordServiceBridgeInterface
@return string | [
"Encodes",
"and",
"returns",
"given",
"password"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L1971-L1979 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getReviewUserHash | public function getReviewUserHash($sUserId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sReviewUserHash = $oDb->getOne('select md5(concat("oxid", oxpassword, oxusername )) from oxuser where oxid = ' . $oDb->quote($sUserId) . '');
return $sReviewUserHash;
} | php | public function getReviewUserHash($sUserId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sReviewUserHash = $oDb->getOne('select md5(concat("oxid", oxpassword, oxusername )) from oxuser where oxid = ' . $oDb->quote($sUserId) . '');
return $sReviewUserHash;
} | [
"public",
"function",
"getReviewUserHash",
"(",
"$",
"sUserId",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sReviewUserHash",
"=",
"$",
"oDb",
"->",
"getOne",
"... | Generates user password and username hash for review
@param string $sUserId userid
@return string | [
"Generates",
"user",
"password",
"and",
"username",
"hash",
"for",
"review"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2039-L2045 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.isTermsAccepted | public function isTermsAccepted()
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$sUserId = $oDb->quote($this->getId());
return (bool) $oDb->getOne("select 1 from oxacceptedterms where oxuserid={$sUserId} and oxshopid='{$sShopId}'");
} | php | public function isTermsAccepted()
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$sUserId = $oDb->quote($this->getId());
return (bool) $oDb->getOne("select 1 from oxacceptedterms where oxuserid={$sUserId} and oxshopid='{$sShopId}'");
} | [
"public",
"function",
"isTermsAccepted",
"(",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sShopId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
... | Checks if user accepted latest shopping terms and conditions version
@return bool | [
"Checks",
"if",
"user",
"accepted",
"latest",
"shopping",
"terms",
"and",
"conditions",
"version"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2095-L2102 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.acceptTerms | public function acceptTerms()
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sUserId = $oDb->quote($this->getId());
$sShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$sVersion = oxNew(\OxidEsales\Eshop\Application\Model\Content::class)->getTermsVersion();
$oDb->execute("replace oxacceptedterms set oxuserid={$sUserId}, oxshopid='{$sShopId}', oxtermversion='{$sVersion}'");
} | php | public function acceptTerms()
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sUserId = $oDb->quote($this->getId());
$sShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$sVersion = oxNew(\OxidEsales\Eshop\Application\Model\Content::class)->getTermsVersion();
$oDb->execute("replace oxacceptedterms set oxuserid={$sUserId}, oxshopid='{$sShopId}', oxtermversion='{$sVersion}'");
} | [
"public",
"function",
"acceptTerms",
"(",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sUserId",
"=",
"$",
"oDb",
"->",
"quote",
"(",
"$",
"this",
"->",
"get... | Writes terms acceptance info to db | [
"Writes",
"terms",
"acceptance",
"info",
"to",
"db"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2107-L2115 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.setCreditPointsForInviter | public function setCreditPointsForInviter()
{
$blSet = false;
$iPoints = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('dPointsForInvitation');
if ($iPoints) {
$iNewPoints = $this->oxuser__oxpoints->value + $iPoints;
$this->oxuser__oxpoints = new Field($iNewPoints, Field::T_RAW);
$blSet = $this->save();
}
return $blSet;
} | php | public function setCreditPointsForInviter()
{
$blSet = false;
$iPoints = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('dPointsForInvitation');
if ($iPoints) {
$iNewPoints = $this->oxuser__oxpoints->value + $iPoints;
$this->oxuser__oxpoints = new Field($iNewPoints, Field::T_RAW);
$blSet = $this->save();
}
return $blSet;
} | [
"public",
"function",
"setCreditPointsForInviter",
"(",
")",
"{",
"$",
"blSet",
"=",
"false",
";",
"$",
"iPoints",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'dPointsForI... | Assigns credit points to inviter
@return bool | [
"Assigns",
"credit",
"points",
"to",
"inviter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2156-L2167 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.updateInvitationStatistics | public function updateInvitationStatistics($aRecEmail)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sUserId = $this->getId();
if ($sUserId && is_array($aRecEmail) && count($aRecEmail) > 0) {
//iserting statistics about invitation
$sDate = Registry::getUtilsDate()->formatDBDate(date("Y-m-d"), true);
$aRecEmail = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aRecEmail);
foreach ($aRecEmail as $sRecEmail) {
$sSql = "INSERT INTO oxinvitations SET oxuserid = " . $oDb->quote($sUserId) . ", oxemail = $sRecEmail, oxdate='$sDate', oxpending = '1', oxaccepted = '0', oxtype = '1' ";
$oDb->execute($sSql);
}
}
} | php | public function updateInvitationStatistics($aRecEmail)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sUserId = $this->getId();
if ($sUserId && is_array($aRecEmail) && count($aRecEmail) > 0) {
//iserting statistics about invitation
$sDate = Registry::getUtilsDate()->formatDBDate(date("Y-m-d"), true);
$aRecEmail = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aRecEmail);
foreach ($aRecEmail as $sRecEmail) {
$sSql = "INSERT INTO oxinvitations SET oxuserid = " . $oDb->quote($sUserId) . ", oxemail = $sRecEmail, oxdate='$sDate', oxpending = '1', oxaccepted = '0', oxtype = '1' ";
$oDb->execute($sSql);
}
}
} | [
"public",
"function",
"updateInvitationStatistics",
"(",
"$",
"aRecEmail",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sUserId",
"=",
"$",
"this",
"->",
"getId",
... | Updating invitations statistics
@param array $aRecEmail array of recipients emails | [
"Updating",
"invitations",
"statistics"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2174-L2188 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.getIdByUserName | public function getIdByUserName($userName)
{
$shopId = Registry::getConfig()->getShopId();
$userId = DatabaseProvider::getDb()
->getOne(
'SELECT `OXID` FROM `oxuser` WHERE `OXUSERNAME` = ? AND `OXSHOPID` = ?',
[
$userName,
$shopId
]
);
return $userId;
} | php | public function getIdByUserName($userName)
{
$shopId = Registry::getConfig()->getShopId();
$userId = DatabaseProvider::getDb()
->getOne(
'SELECT `OXID` FROM `oxuser` WHERE `OXUSERNAME` = ? AND `OXSHOPID` = ?',
[
$userName,
$shopId
]
);
return $userId;
} | [
"public",
"function",
"getIdByUserName",
"(",
"$",
"userName",
")",
"{",
"$",
"shopId",
"=",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getShopId",
"(",
")",
";",
"$",
"userId",
"=",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
"->",
"getOne",
"(",
... | return user id by user name
@param string $userName
@return false|string | [
"return",
"user",
"id",
"by",
"user",
"name"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2197-L2210 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._dbLogin | protected function _dbLogin(string $userName, $password, $shopID)
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$userId = $database->getOne($this->_getLoginQuery($userName, $password, $shopID, $this->isAdmin()));
if (!$userId) {
$userId = $database->getOne($this->_getLoginQueryHashedWithMD5($userName, $password, $shopID, $this->isAdmin()));
}
/** Return here to give other log-in mechanisms the possibility to be triggered */
if (!$userId) {
return;
}
$this->loadAuthenticatedUser($userName, $shopID);
$this->isOutdatedPasswordHashAlgorithmUsed = true;
} | php | protected function _dbLogin(string $userName, $password, $shopID)
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$userId = $database->getOne($this->_getLoginQuery($userName, $password, $shopID, $this->isAdmin()));
if (!$userId) {
$userId = $database->getOne($this->_getLoginQueryHashedWithMD5($userName, $password, $shopID, $this->isAdmin()));
}
/** Return here to give other log-in mechanisms the possibility to be triggered */
if (!$userId) {
return;
}
$this->loadAuthenticatedUser($userName, $shopID);
$this->isOutdatedPasswordHashAlgorithmUsed = true;
} | [
"protected",
"function",
"_dbLogin",
"(",
"string",
"$",
"userName",
",",
"$",
"password",
",",
"$",
"shopID",
")",
"{",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
... | Initiates user login against data in DB.
@param string $userName User
@param string $password Password
@param string $shopID Shop id
@throws UserException
@deprecated since v6.4.0 (2019-03-15); This method will be removed completely. Verify the password directly
against the password hash
@return void | [
"Initiates",
"user",
"login",
"against",
"data",
"in",
"DB",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2257-L2272 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._isDemoShop | protected function _isDemoShop()
{
$blDemoMode = false;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->isDemoShop()) {
$blDemoMode = true;
}
return $blDemoMode;
} | php | protected function _isDemoShop()
{
$blDemoMode = false;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->isDemoShop()) {
$blDemoMode = true;
}
return $blDemoMode;
} | [
"protected",
"function",
"_isDemoShop",
"(",
")",
"{",
"$",
"blDemoMode",
"=",
"false",
";",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"isDemoShop",
"(",
")",
")",
"{",
"$",
"blDemo... | Return true - if shop is in demo mode
@return bool | [
"Return",
"true",
"-",
"if",
"shop",
"is",
"in",
"demo",
"mode"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2305-L2314 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User._getDemoShopLoginQuery | protected function _getDemoShopLoginQuery($sUser, $sPassword)
{
if ($sPassword == "admin" && $sUser == "admin") {
$sSelect = "SELECT `oxid` FROM `oxuser` WHERE `oxrights` = 'malladmin' ";
} else {
/** @var UserException $oEx */
$oEx = oxNew(UserException::class);
$oEx->setMessage('ERROR_MESSAGE_USER_NOVALIDLOGIN');
throw $oEx;
}
return $sSelect;
} | php | protected function _getDemoShopLoginQuery($sUser, $sPassword)
{
if ($sPassword == "admin" && $sUser == "admin") {
$sSelect = "SELECT `oxid` FROM `oxuser` WHERE `oxrights` = 'malladmin' ";
} else {
/** @var UserException $oEx */
$oEx = oxNew(UserException::class);
$oEx->setMessage('ERROR_MESSAGE_USER_NOVALIDLOGIN');
throw $oEx;
}
return $sSelect;
} | [
"protected",
"function",
"_getDemoShopLoginQuery",
"(",
"$",
"sUser",
",",
"$",
"sPassword",
")",
"{",
"if",
"(",
"$",
"sPassword",
"==",
"\"admin\"",
"&&",
"$",
"sUser",
"==",
"\"admin\"",
")",
"{",
"$",
"sSelect",
"=",
"\"SELECT `oxid` FROM `oxuser` WHERE `oxr... | Return sql to get id of mall admin in demo shop
@param string $sUser User name
@param string $sPassword User password
@throws object $oEx
@return string | [
"Return",
"sql",
"to",
"get",
"id",
"of",
"mall",
"admin",
"in",
"demo",
"shop"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2326-L2338 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.onLogin | protected function onLogin($userName, $password)
{
/** Demo shop log in */
if (!$this->isLoaded() && $this->_isDemoShop() && $this->isAdmin()) {
$database = DatabaseProvider::getDb();
$userId = $database->getOne($this->_getDemoShopLoginQuery($userName, $password));
if ($userId) {
$this->load($userId);
}
}
} | php | protected function onLogin($userName, $password)
{
/** Demo shop log in */
if (!$this->isLoaded() && $this->_isDemoShop() && $this->isAdmin()) {
$database = DatabaseProvider::getDb();
$userId = $database->getOne($this->_getDemoShopLoginQuery($userName, $password));
if ($userId) {
$this->load($userId);
}
}
} | [
"protected",
"function",
"onLogin",
"(",
"$",
"userName",
",",
"$",
"password",
")",
"{",
"/** Demo shop log in */",
"if",
"(",
"!",
"$",
"this",
"->",
"isLoaded",
"(",
")",
"&&",
"$",
"this",
"->",
"_isDemoShop",
"(",
")",
"&&",
"$",
"this",
"->",
"is... | Method is used for overriding and add additional actions when logging in.
@param string $userName
@param string $password | [
"Method",
"is",
"used",
"for",
"overriding",
"and",
"add",
"additional",
"actions",
"when",
"logging",
"in",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2376-L2386 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deleteAddresses | private function deleteAddresses(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxaddress WHERE oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\Address::class);
} | php | private function deleteAddresses(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxaddress WHERE oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\Address::class);
} | [
"private",
"function",
"deleteAddresses",
"(",
"DatabaseInterface",
"$",
"database",
")",
"{",
"$",
"ids",
"=",
"$",
"database",
"->",
"getCol",
"(",
"'SELECT oxid FROM oxaddress WHERE oxuserid = ?'",
",",
"[",
"$",
"this",
"->",
"getId",
"(",
")",
"]",
")",
"... | Deletes User addresses.
@param DatabaseInterface $database | [
"Deletes",
"User",
"addresses",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2453-L2457 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deleteBaskets | private function deleteBaskets(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxuserbaskets WHERE oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\UserBasket::class);
} | php | private function deleteBaskets(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxuserbaskets WHERE oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\UserBasket::class);
} | [
"private",
"function",
"deleteBaskets",
"(",
"DatabaseInterface",
"$",
"database",
")",
"{",
"$",
"ids",
"=",
"$",
"database",
"->",
"getCol",
"(",
"'SELECT oxid FROM oxuserbaskets WHERE oxuserid = ?'",
",",
"[",
"$",
"this",
"->",
"getId",
"(",
")",
"]",
")",
... | Deletes noticelists, wishlists or saved baskets
@param DatabaseInterface $database | [
"Deletes",
"noticelists",
"wishlists",
"or",
"saved",
"baskets"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2464-L2468 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deleteNotOrderRelatedRemarks | private function deleteNotOrderRelatedRemarks(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxremark WHERE oxparentid = ? and oxtype !=\'o\'', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\Remark::class);
} | php | private function deleteNotOrderRelatedRemarks(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxremark WHERE oxparentid = ? and oxtype !=\'o\'', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\Remark::class);
} | [
"private",
"function",
"deleteNotOrderRelatedRemarks",
"(",
"DatabaseInterface",
"$",
"database",
")",
"{",
"$",
"ids",
"=",
"$",
"database",
"->",
"getCol",
"(",
"'SELECT oxid FROM oxremark WHERE oxparentid = ? and oxtype !=\\'o\\''",
",",
"[",
"$",
"this",
"->",
"getI... | Deletes not Order related remarks.
@param DatabaseInterface $database | [
"Deletes",
"not",
"Order",
"related",
"remarks",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2475-L2479 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deleteRecommendationLists | private function deleteRecommendationLists(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxrecommlists WHERE oxuserid = ? ', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\RecommendationList::class);
} | php | private function deleteRecommendationLists(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxrecommlists WHERE oxuserid = ? ', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\RecommendationList::class);
} | [
"private",
"function",
"deleteRecommendationLists",
"(",
"DatabaseInterface",
"$",
"database",
")",
"{",
"$",
"ids",
"=",
"$",
"database",
"->",
"getCol",
"(",
"'SELECT oxid FROM oxrecommlists WHERE oxuserid = ? '",
",",
"[",
"$",
"this",
"->",
"getId",
"(",
")",
... | Deletes recommendation lists.
@param DatabaseInterface $database | [
"Deletes",
"recommendation",
"lists",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2486-L2490 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deleteNewsletterSubscriptions | private function deleteNewsletterSubscriptions(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxnewssubscribed WHERE oxuserid = ? ', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\NewsSubscribed::class);
} | php | private function deleteNewsletterSubscriptions(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxnewssubscribed WHERE oxuserid = ? ', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\NewsSubscribed::class);
} | [
"private",
"function",
"deleteNewsletterSubscriptions",
"(",
"DatabaseInterface",
"$",
"database",
")",
"{",
"$",
"ids",
"=",
"$",
"database",
"->",
"getCol",
"(",
"'SELECT oxid FROM oxnewssubscribed WHERE oxuserid = ? '",
",",
"[",
"$",
"this",
"->",
"getId",
"(",
... | Deletes newsletter subscriptions.
@param DatabaseInterface $database | [
"Deletes",
"newsletter",
"subscriptions",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2497-L2501 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deleteReviews | private function deleteReviews(DatabaseInterface $database)
{
$ids = $database->getCol('select oxid from oxreviews where oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\Review::class);
} | php | private function deleteReviews(DatabaseInterface $database)
{
$ids = $database->getCol('select oxid from oxreviews where oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\Review::class);
} | [
"private",
"function",
"deleteReviews",
"(",
"DatabaseInterface",
"$",
"database",
")",
"{",
"$",
"ids",
"=",
"$",
"database",
"->",
"getCol",
"(",
"'select oxid from oxreviews where oxuserid = ?'",
",",
"[",
"$",
"this",
"->",
"getId",
"(",
")",
"]",
")",
";"... | Deletes User reviews.
@param DatabaseInterface $database | [
"Deletes",
"User",
"reviews",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2509-L2513 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deleteRatings | private function deleteRatings(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxratings WHERE oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\Rating::class);
} | php | private function deleteRatings(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxratings WHERE oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\Rating::class);
} | [
"private",
"function",
"deleteRatings",
"(",
"DatabaseInterface",
"$",
"database",
")",
"{",
"$",
"ids",
"=",
"$",
"database",
"->",
"getCol",
"(",
"'SELECT oxid FROM oxratings WHERE oxuserid = ?'",
",",
"[",
"$",
"this",
"->",
"getId",
"(",
")",
"]",
")",
";"... | Deletes User ratings.
@param DatabaseInterface $database | [
"Deletes",
"User",
"ratings",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2520-L2524 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deletePriceAlarms | private function deletePriceAlarms(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxpricealarm WHERE oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\PriceAlarm::class);
} | php | private function deletePriceAlarms(DatabaseInterface $database)
{
$ids = $database->getCol('SELECT oxid FROM oxpricealarm WHERE oxuserid = ?', [$this->getId()]);
array_walk($ids, [$this, 'deleteItemById'], \OxidEsales\Eshop\Application\Model\PriceAlarm::class);
} | [
"private",
"function",
"deletePriceAlarms",
"(",
"DatabaseInterface",
"$",
"database",
")",
"{",
"$",
"ids",
"=",
"$",
"database",
"->",
"getCol",
"(",
"'SELECT oxid FROM oxpricealarm WHERE oxuserid = ?'",
",",
"[",
"$",
"this",
"->",
"getId",
"(",
")",
"]",
")"... | Deletes price alarms.
@param DatabaseInterface $database | [
"Deletes",
"price",
"alarms",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2531-L2535 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.deleteItemById | private function deleteItemById($id, $key, $className)
{
/** @var \OxidEsales\Eshop\Core\Model\BaseModel $modelObject */
$modelObject = oxNew($className);
if ($modelObject->load($id)) {
if ($this->_blMallUsers) {
$modelObject->setIsDerived(false);
}
$modelObject->delete();
}
} | php | private function deleteItemById($id, $key, $className)
{
/** @var \OxidEsales\Eshop\Core\Model\BaseModel $modelObject */
$modelObject = oxNew($className);
if ($modelObject->load($id)) {
if ($this->_blMallUsers) {
$modelObject->setIsDerived(false);
}
$modelObject->delete();
}
} | [
"private",
"function",
"deleteItemById",
"(",
"$",
"id",
",",
"$",
"key",
",",
"$",
"className",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Core\\Model\\BaseModel $modelObject */",
"$",
"modelObject",
"=",
"oxNew",
"(",
"$",
"className",
")",
";",
"if",
"(",
"$",
... | Callback function for array_walk to delete items using the delete method of the given model class
@param string $id Id of the item to be deleted
@param integer $key Key of the array
@param string $className Model class to be used | [
"Callback",
"function",
"for",
"array_walk",
"to",
"delete",
"items",
"using",
"the",
"delete",
"method",
"of",
"the",
"given",
"model",
"class"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2544-L2555 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/User.php | User.formUserCookieQuery | protected function formUserCookieQuery($user, $shopId)
{
$query = 'select oxid, oxpassword, oxpasssalt from oxuser '
. 'where oxuser.oxpassword != "" and oxuser.oxactive = 1 and oxuser.oxusername = '
. \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($user);
return $query;
} | php | protected function formUserCookieQuery($user, $shopId)
{
$query = 'select oxid, oxpassword, oxpasssalt from oxuser '
. 'where oxuser.oxpassword != "" and oxuser.oxactive = 1 and oxuser.oxusername = '
. \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($user);
return $query;
} | [
"protected",
"function",
"formUserCookieQuery",
"(",
"$",
"user",
",",
"$",
"shopId",
")",
"{",
"$",
"query",
"=",
"'select oxid, oxpassword, oxpasssalt from oxuser '",
".",
"'where oxuser.oxpassword != \"\" and oxuser.oxactive = 1 and oxuser.oxusername = '",
".",
"\\",
"OxidE... | Updates given query. Method is for overriding.
@param string $user
@param string $shopId
@return string | [
"Updates",
"given",
"query",
".",
"Method",
"is",
"for",
"overriding",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/User.php#L2645-L2652 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/StartController.php | StartController._getLoadActionsParam | protected function _getLoadActionsParam()
{
if ($this->_blLoadActions === null) {
$this->_blLoadActions = false;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadAktion')) {
$this->_blLoadActions = true;
}
}
return $this->_blLoadActions;
} | php | protected function _getLoadActionsParam()
{
if ($this->_blLoadActions === null) {
$this->_blLoadActions = false;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadAktion')) {
$this->_blLoadActions = true;
}
}
return $this->_blLoadActions;
} | [
"protected",
"function",
"_getLoadActionsParam",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_blLoadActions",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_blLoadActions",
"=",
"false",
";",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"... | Template variable getter. Returns if actions are ON
@return string | [
"Template",
"variable",
"getter",
".",
"Returns",
"if",
"actions",
"are",
"ON"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/StartController.php#L186-L196 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/StartController.php | StartController.getNewestArticles | public function getNewestArticles()
{
if ($this->_aNewArticleList === null) {
$this->_aNewArticleList = [];
if ($this->_getLoadActionsParam()) {
// newest articles
$oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oArtList->loadNewestArticles();
if ($oArtList->count()) {
$this->_aNewArticleList = $oArtList;
}
}
}
return $this->_aNewArticleList;
} | php | public function getNewestArticles()
{
if ($this->_aNewArticleList === null) {
$this->_aNewArticleList = [];
if ($this->_getLoadActionsParam()) {
// newest articles
$oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oArtList->loadNewestArticles();
if ($oArtList->count()) {
$this->_aNewArticleList = $oArtList;
}
}
}
return $this->_aNewArticleList;
} | [
"public",
"function",
"getNewestArticles",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aNewArticleList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_aNewArticleList",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"_getLoadActionsParam",
"(",
")"... | Template variable getter. Returns newest article list
@return array | [
"Template",
"variable",
"getter",
".",
"Returns",
"newest",
"article",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/StartController.php#L248-L263 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/StartController.php | StartController.getFirstArticle | public function getFirstArticle()
{
if ($this->_oFirstArticle === null) {
$this->_oFirstArticle = false;
if ($this->_getLoadActionsParam()) {
// top articles ( big one )
$oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oArtList->loadActionArticles('OXFIRSTSTART');
if ($oArtList->count()) {
$this->_oFirstArticle = $oArtList->current();
}
}
}
return $this->_oFirstArticle;
} | php | public function getFirstArticle()
{
if ($this->_oFirstArticle === null) {
$this->_oFirstArticle = false;
if ($this->_getLoadActionsParam()) {
// top articles ( big one )
$oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oArtList->loadActionArticles('OXFIRSTSTART');
if ($oArtList->count()) {
$this->_oFirstArticle = $oArtList->current();
}
}
}
return $this->_oFirstArticle;
} | [
"public",
"function",
"getFirstArticle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oFirstArticle",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oFirstArticle",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"_getLoadActionsParam",
"(",
")",
")",
... | Template variable getter. Returns first article
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"first",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/StartController.php#L270-L285 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/StartController.php | StartController.getBanners | public function getBanners()
{
$oBannerList = null;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadAktion')) {
$oBannerList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class);
$oBannerList->loadBanners();
}
return $oBannerList;
} | php | public function getBanners()
{
$oBannerList = null;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadAktion')) {
$oBannerList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class);
$oBannerList->loadBanners();
}
return $oBannerList;
} | [
"public",
"function",
"getBanners",
"(",
")",
"{",
"$",
"oBannerList",
"=",
"null",
";",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'bl_perfLoadAktion'",
")",
")"... | Returns active banner list
@return objects | [
"Returns",
"active",
"banner",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/StartController.php#L354-L365 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/StartController.php | StartController.getManufacturerForSlider | public function getManufacturerForSlider()
{
$oList = null;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadManufacturerTree')) {
$oList = $this->getManufacturerlist();
}
return $oList;
} | php | public function getManufacturerForSlider()
{
$oList = null;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadManufacturerTree')) {
$oList = $this->getManufacturerlist();
}
return $oList;
} | [
"public",
"function",
"getManufacturerForSlider",
"(",
")",
"{",
"$",
"oList",
"=",
"null",
";",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'bl_perfLoadManufacturerTr... | Returns manufacturer list for manufacturer slider
@return objects | [
"Returns",
"manufacturer",
"list",
"for",
"manufacturer",
"slider"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/StartController.php#L372-L382 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsObject.php | UtilsObject.resetInstanceCache | public function resetInstanceCache($className = null)
{
if ($className && isset(static::$_aInstanceCache[$className])) {
unset(static::$_aInstanceCache[$className]);
return;
}
//Get storage key as the class might be aliased.
$storageKey = Registry::getStorageKey($className);
if ($className && isset(static::$_aInstanceCache[$storageKey])) {
unset(static::$_aInstanceCache[$storageKey]);
return;
}
//looping due to possible memory "leak".
if (is_array(static::$_aInstanceCache)) {
foreach (static::$_aInstanceCache as $key => $instance) {
unset(static::$_aInstanceCache[$key]);
}
}
static::$_aInstanceCache = [];
} | php | public function resetInstanceCache($className = null)
{
if ($className && isset(static::$_aInstanceCache[$className])) {
unset(static::$_aInstanceCache[$className]);
return;
}
//Get storage key as the class might be aliased.
$storageKey = Registry::getStorageKey($className);
if ($className && isset(static::$_aInstanceCache[$storageKey])) {
unset(static::$_aInstanceCache[$storageKey]);
return;
}
//looping due to possible memory "leak".
if (is_array(static::$_aInstanceCache)) {
foreach (static::$_aInstanceCache as $key => $instance) {
unset(static::$_aInstanceCache[$key]);
}
}
static::$_aInstanceCache = [];
} | [
"public",
"function",
"resetInstanceCache",
"(",
"$",
"className",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"className",
"&&",
"isset",
"(",
"static",
"::",
"$",
"_aInstanceCache",
"[",
"$",
"className",
"]",
")",
")",
"{",
"unset",
"(",
"static",
"::",
... | Resets instance cache
@param string $className class name in the cache
@return null; | [
"Resets",
"instance",
"cache"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsObject.php#L130-L153 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.