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/OnlineLicenseCheckCaller.php | OnlineLicenseCheckCaller.doRequest | public function doRequest(\OxidEsales\Eshop\Core\OnlineLicenseCheckRequest $oRequest)
{
return $this->_formResponse($this->call($oRequest));
} | php | public function doRequest(\OxidEsales\Eshop\Core\OnlineLicenseCheckRequest $oRequest)
{
return $this->_formResponse($this->call($oRequest));
} | [
"public",
"function",
"doRequest",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"OnlineLicenseCheckRequest",
"$",
"oRequest",
")",
"{",
"return",
"$",
"this",
"->",
"_formResponse",
"(",
"$",
"this",
"->",
"call",
"(",
"$",
"oRequest",
")",
... | Performs Web service request
@param \OxidEsales\Eshop\Core\OnlineLicenseCheckRequest $oRequest Object with request parameters
@throws oxException
@return \OxidEsales\Eshop\Core\OnlineLicenseCheckResponse | [
"Performs",
"Web",
"service",
"request"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineLicenseCheckCaller.php#L42-L45 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineLicenseCheckCaller.php | OnlineLicenseCheckCaller._formResponse | protected function _formResponse($sRawResponse)
{
/** @var \OxidEsales\Eshop\Core\UtilsXml $oUtilsXml */
$oUtilsXml = \OxidEsales\Eshop\Core\Registry::getUtilsXml();
if (empty($sRawResponse) || !($oDomDoc = $oUtilsXml->loadXml($sRawResponse))) {
throw new \OxidEsales\Eshop\Core\Exception\StandardException('OLC_ERROR_RESPONSE_NOT_VALID');
}
if ($oDomDoc->documentElement->nodeName != $this->_sResponseElement) {
throw new \OxidEsales\Eshop\Core\Exception\StandardException('OLC_ERROR_RESPONSE_UNEXPECTED');
}
$oResponseNode = $oDomDoc->firstChild;
if (!$oResponseNode->hasChildNodes()) {
throw new \OxidEsales\Eshop\Core\Exception\StandardException('OLC_ERROR_RESPONSE_NOT_VALID');
}
$oNodes = $oResponseNode->childNodes;
/** @var \OxidEsales\Eshop\Core\OnlineLicenseCheckResponse $oResponse */
$oResponse = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheckResponse::class);
// iterate through response node to get response parameters
for ($i = 0; $i < $oNodes->length; $i++) {
$sNodeName = $oNodes->item($i)->nodeName;
$sNodeValue = $oNodes->item($i)->nodeValue;
$oResponse->$sNodeName = $sNodeValue;
}
return $oResponse;
} | php | protected function _formResponse($sRawResponse)
{
/** @var \OxidEsales\Eshop\Core\UtilsXml $oUtilsXml */
$oUtilsXml = \OxidEsales\Eshop\Core\Registry::getUtilsXml();
if (empty($sRawResponse) || !($oDomDoc = $oUtilsXml->loadXml($sRawResponse))) {
throw new \OxidEsales\Eshop\Core\Exception\StandardException('OLC_ERROR_RESPONSE_NOT_VALID');
}
if ($oDomDoc->documentElement->nodeName != $this->_sResponseElement) {
throw new \OxidEsales\Eshop\Core\Exception\StandardException('OLC_ERROR_RESPONSE_UNEXPECTED');
}
$oResponseNode = $oDomDoc->firstChild;
if (!$oResponseNode->hasChildNodes()) {
throw new \OxidEsales\Eshop\Core\Exception\StandardException('OLC_ERROR_RESPONSE_NOT_VALID');
}
$oNodes = $oResponseNode->childNodes;
/** @var \OxidEsales\Eshop\Core\OnlineLicenseCheckResponse $oResponse */
$oResponse = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheckResponse::class);
// iterate through response node to get response parameters
for ($i = 0; $i < $oNodes->length; $i++) {
$sNodeName = $oNodes->item($i)->nodeName;
$sNodeValue = $oNodes->item($i)->nodeValue;
$oResponse->$sNodeName = $sNodeValue;
}
return $oResponse;
} | [
"protected",
"function",
"_formResponse",
"(",
"$",
"sRawResponse",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Core\\UtilsXml $oUtilsXml */",
"$",
"oUtilsXml",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsXml",
"(",
")",
";",
... | Parse response message received from Online License Key Check web service and save it to response object.
@param string $sRawResponse UnResponse from server
@throws oxException
@return \OxidEsales\Eshop\Core\OnlineLicenseCheckResponse | [
"Parse",
"response",
"message",
"received",
"from",
"Online",
"License",
"Key",
"Check",
"web",
"service",
"and",
"save",
"it",
"to",
"response",
"object",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineLicenseCheckCaller.php#L70-L101 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.createClassChain | public function createClassChain($className, $classAlias = null)
{
if (!$classAlias) {
$classAlias = $className;
}
$activeChain = $this->getActiveChain($className, $classAlias);
if (!empty($activeChain)) {
$className = $this->createClassExtensions($activeChain, $classAlias);
}
return $className;
} | php | public function createClassChain($className, $classAlias = null)
{
if (!$classAlias) {
$classAlias = $className;
}
$activeChain = $this->getActiveChain($className, $classAlias);
if (!empty($activeChain)) {
$className = $this->createClassExtensions($activeChain, $classAlias);
}
return $className;
} | [
"public",
"function",
"createClassChain",
"(",
"$",
"className",
",",
"$",
"classAlias",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"classAlias",
")",
"{",
"$",
"classAlias",
"=",
"$",
"className",
";",
"}",
"$",
"activeChain",
"=",
"$",
"this",
"->",... | Creates given class chains.
@param string $className Class name.
@param string $classAlias Class alias, used for searching module extensions. Class is used if no alias given.
@return string | [
"Creates",
"given",
"class",
"chains",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L38-L49 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.getActiveChain | public function getActiveChain($className, $classAlias = null)
{
if (!$classAlias) {
$classAlias = $className;
}
$fullChain = $this->getFullChain($className, $classAlias);
$activeChain = [];
if (!empty($fullChain)) {
$activeChain = $this->filterInactiveExtensions($fullChain);
}
return $activeChain;
} | php | public function getActiveChain($className, $classAlias = null)
{
if (!$classAlias) {
$classAlias = $className;
}
$fullChain = $this->getFullChain($className, $classAlias);
$activeChain = [];
if (!empty($fullChain)) {
$activeChain = $this->filterInactiveExtensions($fullChain);
}
return $activeChain;
} | [
"public",
"function",
"getActiveChain",
"(",
"$",
"className",
",",
"$",
"classAlias",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"classAlias",
")",
"{",
"$",
"classAlias",
"=",
"$",
"className",
";",
"}",
"$",
"fullChain",
"=",
"$",
"this",
"->",
"... | Assembles class chains.
@param string $className Class name.
@param string $classAlias Class alias, used for searching module extensions. Class is used if no alias given.
@return array | [
"Assembles",
"class",
"chains",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L59-L71 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.getFullChain | public function getFullChain($className, $classAlias)
{
$fullChain = [];
$lowerCaseClassAlias = strtolower($classAlias);
$lowerCaseClassName = strtolower($className);
$variablesLocator = $this->getModuleVariablesLocator();
$modules = $this->getModulesArray($variablesLocator);
$modules = array_change_key_case($modules);
$allExtendedClasses = array_keys($modules);
$currentExtendedClasses = array_intersect($allExtendedClasses, [$lowerCaseClassName, $lowerCaseClassAlias]);
if (!empty($currentExtendedClasses)) {
/*
* there may be 2 class chains, matching the same class:
* - one for the class alias like 'oxUser' - metadata v1.1
* - another for the real class name like 'OxidEsales\Eshop\Application\Model\User' - metadata v1.2
* These chains must be merged in the same order as they appear in the modules array
*/
$classChains = [];
/* Get the position of the class name */
if (false !== $position = array_search($lowerCaseClassName, $allExtendedClasses)) {
$classChains[$position] = explode("&", $modules[$lowerCaseClassName]);
}
/* Get the position of the alias class name */
if (false !== $position = array_search($lowerCaseClassAlias, $allExtendedClasses)) {
$classChains[$position] = explode("&", $modules[$lowerCaseClassAlias]);
}
/* Notice that the array keys will be ordered, but do not necessarily start at 0 */
ksort($classChains);
$fullChain = [];
if (1 === count($classChains)) {
/**
* @var array $fullChain uses the one and only element of the array
*/
$fullChain = reset($classChains);
}
if (2 === count($classChains)) {
/**
* @var array $fullChain merges the first and then the second array from the $classChains
*/
$fullChain = array_merge(reset($classChains), next($classChains));
}
}
return $fullChain;
} | php | public function getFullChain($className, $classAlias)
{
$fullChain = [];
$lowerCaseClassAlias = strtolower($classAlias);
$lowerCaseClassName = strtolower($className);
$variablesLocator = $this->getModuleVariablesLocator();
$modules = $this->getModulesArray($variablesLocator);
$modules = array_change_key_case($modules);
$allExtendedClasses = array_keys($modules);
$currentExtendedClasses = array_intersect($allExtendedClasses, [$lowerCaseClassName, $lowerCaseClassAlias]);
if (!empty($currentExtendedClasses)) {
/*
* there may be 2 class chains, matching the same class:
* - one for the class alias like 'oxUser' - metadata v1.1
* - another for the real class name like 'OxidEsales\Eshop\Application\Model\User' - metadata v1.2
* These chains must be merged in the same order as they appear in the modules array
*/
$classChains = [];
/* Get the position of the class name */
if (false !== $position = array_search($lowerCaseClassName, $allExtendedClasses)) {
$classChains[$position] = explode("&", $modules[$lowerCaseClassName]);
}
/* Get the position of the alias class name */
if (false !== $position = array_search($lowerCaseClassAlias, $allExtendedClasses)) {
$classChains[$position] = explode("&", $modules[$lowerCaseClassAlias]);
}
/* Notice that the array keys will be ordered, but do not necessarily start at 0 */
ksort($classChains);
$fullChain = [];
if (1 === count($classChains)) {
/**
* @var array $fullChain uses the one and only element of the array
*/
$fullChain = reset($classChains);
}
if (2 === count($classChains)) {
/**
* @var array $fullChain merges the first and then the second array from the $classChains
*/
$fullChain = array_merge(reset($classChains), next($classChains));
}
}
return $fullChain;
} | [
"public",
"function",
"getFullChain",
"(",
"$",
"className",
",",
"$",
"classAlias",
")",
"{",
"$",
"fullChain",
"=",
"[",
"]",
";",
"$",
"lowerCaseClassAlias",
"=",
"strtolower",
"(",
"$",
"classAlias",
")",
";",
"$",
"lowerCaseClassName",
"=",
"strtolower"... | Build full class chain.
@param string $className
@param string $classAlias
@return array | [
"Build",
"full",
"class",
"chain",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L81-L127 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.filterInactiveExtensions | public function filterInactiveExtensions($classChain)
{
$disabledModules = $this->getDisabledModuleIds();
foreach ($disabledModules as $disabledModuleId) {
$classChain = $this->cleanModuleFromClassChain($disabledModuleId, $classChain);
}
return $classChain;
} | php | public function filterInactiveExtensions($classChain)
{
$disabledModules = $this->getDisabledModuleIds();
foreach ($disabledModules as $disabledModuleId) {
$classChain = $this->cleanModuleFromClassChain($disabledModuleId, $classChain);
}
return $classChain;
} | [
"public",
"function",
"filterInactiveExtensions",
"(",
"$",
"classChain",
")",
"{",
"$",
"disabledModules",
"=",
"$",
"this",
"->",
"getDisabledModuleIds",
"(",
")",
";",
"foreach",
"(",
"$",
"disabledModules",
"as",
"$",
"disabledModuleId",
")",
"{",
"$",
"cl... | Checks if module is disabled, added to aDisabledModules config.
@param array $classChain Module names
@return array | [
"Checks",
"if",
"module",
"is",
"disabled",
"added",
"to",
"aDisabledModules",
"config",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L136-L145 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.getDisabledModuleIds | public function getDisabledModuleIds()
{
$variablesLocator = $this->getModuleVariablesLocator();
$disabledModules = $variablesLocator->getModuleVariable('aDisabledModules');
$disabledModules = is_array($disabledModules) ? $disabledModules : [];
return $disabledModules;
} | php | public function getDisabledModuleIds()
{
$variablesLocator = $this->getModuleVariablesLocator();
$disabledModules = $variablesLocator->getModuleVariable('aDisabledModules');
$disabledModules = is_array($disabledModules) ? $disabledModules : [];
return $disabledModules;
} | [
"public",
"function",
"getDisabledModuleIds",
"(",
")",
"{",
"$",
"variablesLocator",
"=",
"$",
"this",
"->",
"getModuleVariablesLocator",
"(",
")",
";",
"$",
"disabledModules",
"=",
"$",
"variablesLocator",
"->",
"getModuleVariable",
"(",
"'aDisabledModules'",
")",... | Get Ids of all deactivated module.
If none are deactivated, returns an empty array.
@return array | [
"Get",
"Ids",
"of",
"all",
"deactivated",
"module",
".",
"If",
"none",
"are",
"deactivated",
"returns",
"an",
"empty",
"array",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L182-L189 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.createClassExtensions | protected function createClassExtensions($classChain, $baseClass)
{
//security: just preventing string termination
$lastClass = str_replace(chr(0), '', $baseClass);
$parentClass = $lastClass;
foreach ($classChain as $extensionPath) {
$extensionPath = str_replace(chr(0), '', $extensionPath);
if ($this->createClassExtension($parentClass, $extensionPath)) {
if (\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($extensionPath)) {
$parentClass = $extensionPath;
$lastClass = $extensionPath;
} else {
$parentClass = basename($extensionPath);
$lastClass = basename($extensionPath);
}
}
}
//returning the last module from the chain
return $lastClass;
} | php | protected function createClassExtensions($classChain, $baseClass)
{
//security: just preventing string termination
$lastClass = str_replace(chr(0), '', $baseClass);
$parentClass = $lastClass;
foreach ($classChain as $extensionPath) {
$extensionPath = str_replace(chr(0), '', $extensionPath);
if ($this->createClassExtension($parentClass, $extensionPath)) {
if (\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($extensionPath)) {
$parentClass = $extensionPath;
$lastClass = $extensionPath;
} else {
$parentClass = basename($extensionPath);
$lastClass = basename($extensionPath);
}
}
}
//returning the last module from the chain
return $lastClass;
} | [
"protected",
"function",
"createClassExtensions",
"(",
"$",
"classChain",
",",
"$",
"baseClass",
")",
"{",
"//security: just preventing string termination",
"$",
"lastClass",
"=",
"str_replace",
"(",
"chr",
"(",
"0",
")",
",",
"''",
",",
"$",
"baseClass",
")",
"... | Creates middle classes if needed.
@param array $classChain Module names
@param string $baseClass Oxid base class
@throws \OxidEsales\Eshop\Core\Exception\SystemComponentException missing system component exception
@return string | [
"Creates",
"middle",
"classes",
"if",
"needed",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L229-L251 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.createClassExtension | protected function createClassExtension($parentClass, $moduleClass)
{
if (!\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($moduleClass)) {
return $this->backwardsCompatibleCreateClassExtension($parentClass, $moduleClass);
}
/**
* Test if the class file could be loaded
*/
/** @var \Composer\Autoload\ClassLoader $composerClassLoader */
$composerClassLoader = include VENDOR_PATH . 'autoload.php';
if (!$this->isUnitTest() && // In unit test some classes are created dynamically, so the files would not exist :-(
!strpos($moduleClass, '_parent') &&
!$composerClassLoader->findFile($moduleClass)) {
$this->handleSpecialCases($parentClass);
$this->onModuleExtensionCreationError($moduleClass);
return false;
}
if (!class_exists($moduleClass, false)) {
$moduleClassParentAlias = $moduleClass . "_parent";
if (!class_exists($moduleClassParentAlias, false)) {
class_alias($parentClass, $moduleClassParentAlias);
}
}
return true;
} | php | protected function createClassExtension($parentClass, $moduleClass)
{
if (!\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($moduleClass)) {
return $this->backwardsCompatibleCreateClassExtension($parentClass, $moduleClass);
}
/**
* Test if the class file could be loaded
*/
/** @var \Composer\Autoload\ClassLoader $composerClassLoader */
$composerClassLoader = include VENDOR_PATH . 'autoload.php';
if (!$this->isUnitTest() && // In unit test some classes are created dynamically, so the files would not exist :-(
!strpos($moduleClass, '_parent') &&
!$composerClassLoader->findFile($moduleClass)) {
$this->handleSpecialCases($parentClass);
$this->onModuleExtensionCreationError($moduleClass);
return false;
}
if (!class_exists($moduleClass, false)) {
$moduleClassParentAlias = $moduleClass . "_parent";
if (!class_exists($moduleClassParentAlias, false)) {
class_alias($parentClass, $moduleClassParentAlias);
}
}
return true;
} | [
"protected",
"function",
"createClassExtension",
"(",
"$",
"parentClass",
",",
"$",
"moduleClass",
")",
"{",
"if",
"(",
"!",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"NamespaceInformationProvider",
"::",
"isNamespacedClass",
"(",
"$",
"moduleClass",
... | Checks, if a given class can be loaded and create an alias for _parent.
If the class cannot be loaded, some error handling is done.
@see self::onModuleExtensionCreationError
@see self::handleSpecialCases
e.g. class suboutput1_parent extends oxoutput {}
class suboutput2_parent extends suboutput1 {}
@param string $parentClass
@param string $moduleClass
@throws \OxidEsales\Eshop\Core\Exception\SystemComponentException
@return bool Return on error | [
"Checks",
"if",
"a",
"given",
"class",
"can",
"be",
"loaded",
"and",
"create",
"an",
"alias",
"for",
"_parent",
".",
"If",
"the",
"class",
"cannot",
"be",
"loaded",
"some",
"error",
"handling",
"is",
"done",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L270-L298 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.disableModule | public function disableModule($modulePath)
{
$module = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
$moduleId = $module->getIdByPath($modulePath);
$module->load($moduleId);
$moduleCache = oxNew('oxModuleCache', $module);
$moduleInstaller = oxNew('oxModuleInstaller', $moduleCache);
return $moduleInstaller->deactivate($module);
} | php | public function disableModule($modulePath)
{
$module = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
$moduleId = $module->getIdByPath($modulePath);
$module->load($moduleId);
$moduleCache = oxNew('oxModuleCache', $module);
$moduleInstaller = oxNew('oxModuleInstaller', $moduleCache);
return $moduleInstaller->deactivate($module);
} | [
"public",
"function",
"disableModule",
"(",
"$",
"modulePath",
")",
"{",
"$",
"module",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Module",
"\\",
"Module",
"::",
"class",
")",
";",
"$",
"moduleId",
"=",
"$",
"module",
"-... | Disables module, adds to aDisabledModules config.
@param string $modulePath Full module path
@return bool | [
"Disables",
"module",
"adds",
"to",
"aDisabledModules",
"config",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L415-L425 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleChainsGenerator.php | ModuleChainsGenerator.getModulesArray | protected function getModulesArray(\OxidEsales\Eshop\Core\Module\ModuleVariablesLocator $variablesLocator)
{
$modules = (array) $variablesLocator->getModuleVariable('aModules');
return $modules;
} | php | protected function getModulesArray(\OxidEsales\Eshop\Core\Module\ModuleVariablesLocator $variablesLocator)
{
$modules = (array) $variablesLocator->getModuleVariable('aModules');
return $modules;
} | [
"protected",
"function",
"getModulesArray",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Module",
"\\",
"ModuleVariablesLocator",
"$",
"variablesLocator",
")",
"{",
"$",
"modules",
"=",
"(",
"array",
")",
"$",
"variablesLocator",
"->",
"getModule... | Getter for module array.
@param \OxidEsales\Eshop\Core\Module\ModuleVariablesLocator $variablesLocator
@return array | [
"Getter",
"for",
"module",
"array",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleChainsGenerator.php#L444-L449 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate.formatDBDate | public function formatDBDate($sDBDateIn, $blForceEnglishRet = false)
{
// convert english format to output format
if (!$sDBDateIn) {
return null;
}
$oStr = getStr();
if ($blForceEnglishRet && $oStr->strstr($sDBDateIn, '-')) {
return $sDBDateIn;
}
if ($this->isEmptyDate($sDBDateIn) && $sDBDateIn != '-') {
return '-';
} elseif ($sDBDateIn == '-') {
return '0000-00-00 00:00:00';
}
// is it a timestamp ?
if (is_numeric($sDBDateIn)) {
// db timestamp : 20030322100409
$sNew = substr($sDBDateIn, 0, 4) . '-' . substr($sDBDateIn, 4, 2) . '-' . substr($sDBDateIn, 6, 2) . ' ';
// check if it is a timestamp or wrong data: 20030322
if (strlen($sDBDateIn) > 8) {
$sNew .= substr($sDBDateIn, 8, 2) . ':' . substr($sDBDateIn, 10, 2) . ':' . substr($sDBDateIn, 12, 2);
}
// convert it to english format
$sDBDateIn = $sNew;
}
// remove time as it is same in english as in german
$aData = explode(' ', trim($sDBDateIn));
// preparing time array
$sTime = (isset($aData[1]) && $oStr->strstr($aData[1], ':')) ? $aData[1] : '';
$aTime = $sTime ? explode(':', $sTime) : [0, 0, 0];
// preparing date array
$sDate = isset($aData[0]) ? $aData[0] : '';
$aDate = preg_split('/[\/.-]/', $sDate);
// choosing format..
if ($sTime) {
$sFormat = $blForceEnglishRet ? 'Y-m-d H:i:s' : \OxidEsales\Eshop\Core\Registry::getLang()->translateString('fullDateFormat');
} else {
$sFormat = $blForceEnglishRet ? 'Y-m-d' : \OxidEsales\Eshop\Core\Registry::getLang()->translateString('simpleDateFormat');
}
if (count($aDate) != 3) {
return date($sFormat);
} else {
return $this->_processDate($aTime, $aDate, $oStr->strstr($sDate, '.'), $sFormat);
}
} | php | public function formatDBDate($sDBDateIn, $blForceEnglishRet = false)
{
// convert english format to output format
if (!$sDBDateIn) {
return null;
}
$oStr = getStr();
if ($blForceEnglishRet && $oStr->strstr($sDBDateIn, '-')) {
return $sDBDateIn;
}
if ($this->isEmptyDate($sDBDateIn) && $sDBDateIn != '-') {
return '-';
} elseif ($sDBDateIn == '-') {
return '0000-00-00 00:00:00';
}
// is it a timestamp ?
if (is_numeric($sDBDateIn)) {
// db timestamp : 20030322100409
$sNew = substr($sDBDateIn, 0, 4) . '-' . substr($sDBDateIn, 4, 2) . '-' . substr($sDBDateIn, 6, 2) . ' ';
// check if it is a timestamp or wrong data: 20030322
if (strlen($sDBDateIn) > 8) {
$sNew .= substr($sDBDateIn, 8, 2) . ':' . substr($sDBDateIn, 10, 2) . ':' . substr($sDBDateIn, 12, 2);
}
// convert it to english format
$sDBDateIn = $sNew;
}
// remove time as it is same in english as in german
$aData = explode(' ', trim($sDBDateIn));
// preparing time array
$sTime = (isset($aData[1]) && $oStr->strstr($aData[1], ':')) ? $aData[1] : '';
$aTime = $sTime ? explode(':', $sTime) : [0, 0, 0];
// preparing date array
$sDate = isset($aData[0]) ? $aData[0] : '';
$aDate = preg_split('/[\/.-]/', $sDate);
// choosing format..
if ($sTime) {
$sFormat = $blForceEnglishRet ? 'Y-m-d H:i:s' : \OxidEsales\Eshop\Core\Registry::getLang()->translateString('fullDateFormat');
} else {
$sFormat = $blForceEnglishRet ? 'Y-m-d' : \OxidEsales\Eshop\Core\Registry::getLang()->translateString('simpleDateFormat');
}
if (count($aDate) != 3) {
return date($sFormat);
} else {
return $this->_processDate($aTime, $aDate, $oStr->strstr($sDate, '.'), $sFormat);
}
} | [
"public",
"function",
"formatDBDate",
"(",
"$",
"sDBDateIn",
",",
"$",
"blForceEnglishRet",
"=",
"false",
")",
"{",
"// convert english format to output format",
"if",
"(",
"!",
"$",
"sDBDateIn",
")",
"{",
"return",
"null",
";",
"}",
"$",
"oStr",
"=",
"getStr"... | Format date to user defined format.
@param string $sDBDateIn Date to reformat
@param bool $blForceEnglishRet Force to return primary value(default false)
@return string | [
"Format",
"date",
"to",
"user",
"defined",
"format",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L24-L77 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate.convertDBTimestamp | public function convertDBTimestamp($oObject, $blToTimeStamp = false)
{
// on this case usually means that we gonna save value, and value is formatted, not plain
$sSQLTimeStampPattern = "/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$/";
$sISOTimeStampPattern = "/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/";
$aMatches = [];
$oStr = getStr();
// preparing value to save
if ($blToTimeStamp) {
// reformatting value to ISO
$this->convertDBDateTime($oObject, $blToTimeStamp);
if ($oStr->preg_match($sISOTimeStampPattern, $oObject->value, $aMatches)) {
// changing layout
$oObject->setValue($aMatches[1] . $aMatches[2] . $aMatches[3] . $aMatches[4] . $aMatches[5] . $aMatches[6]);
$oObject->fldmax_length = strlen($oObject->value);
return $oObject->value;
}
} else {
// loading and formatting value
// checking and parsing SQL timestamp value
//$sSQLTimeStampPattern = "/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$/";
if ($oStr->preg_match($sSQLTimeStampPattern, $oObject->value, $aMatches)) {
$iTimestamp = mktime(
$aMatches[4], //h
$aMatches[5], //m
$aMatches[6], //s
$aMatches[2], //M
$aMatches[3], //d
$aMatches[1]
); //y
if (!$iTimestamp) {
$iTimestamp = "0";
}
$oObject->setValue(trim(date("Y-m-d H:i:s", $iTimestamp)));
$oObject->fldmax_length = strlen($oObject->value);
$this->convertDBDateTime($oObject, $blToTimeStamp);
return $oObject->value;
}
}
} | php | public function convertDBTimestamp($oObject, $blToTimeStamp = false)
{
// on this case usually means that we gonna save value, and value is formatted, not plain
$sSQLTimeStampPattern = "/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$/";
$sISOTimeStampPattern = "/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/";
$aMatches = [];
$oStr = getStr();
// preparing value to save
if ($blToTimeStamp) {
// reformatting value to ISO
$this->convertDBDateTime($oObject, $blToTimeStamp);
if ($oStr->preg_match($sISOTimeStampPattern, $oObject->value, $aMatches)) {
// changing layout
$oObject->setValue($aMatches[1] . $aMatches[2] . $aMatches[3] . $aMatches[4] . $aMatches[5] . $aMatches[6]);
$oObject->fldmax_length = strlen($oObject->value);
return $oObject->value;
}
} else {
// loading and formatting value
// checking and parsing SQL timestamp value
//$sSQLTimeStampPattern = "/^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$/";
if ($oStr->preg_match($sSQLTimeStampPattern, $oObject->value, $aMatches)) {
$iTimestamp = mktime(
$aMatches[4], //h
$aMatches[5], //m
$aMatches[6], //s
$aMatches[2], //M
$aMatches[3], //d
$aMatches[1]
); //y
if (!$iTimestamp) {
$iTimestamp = "0";
}
$oObject->setValue(trim(date("Y-m-d H:i:s", $iTimestamp)));
$oObject->fldmax_length = strlen($oObject->value);
$this->convertDBDateTime($oObject, $blToTimeStamp);
return $oObject->value;
}
}
} | [
"public",
"function",
"convertDBTimestamp",
"(",
"$",
"oObject",
",",
"$",
"blToTimeStamp",
"=",
"false",
")",
"{",
"// on this case usually means that we gonna save value, and value is formatted, not plain",
"$",
"sSQLTimeStampPattern",
"=",
"\"/^([0-9]{4})([0-9]{2})([0-9]{2})([0-... | Bidirectional converter for timestamp field
@param object $oObject oxField type object that keeps db field info
@param bool $blToTimeStamp if true - converts value to database compatible timestamp value
@return string | [
"Bidirectional",
"converter",
"for",
"timestamp",
"field"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L213-L257 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate._setDefaultFormatedValue | protected function _setDefaultFormatedValue($oObject, $sDate, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
{
$aDefTimePatterns = $this->_defaultTimePattern();
$aDFormats = $this->_defineDateFormattingRules();
$aTFormats = $this->_defineTimeFormattingRules();
$oStr = getStr();
foreach (array_keys($aDefTimePatterns) as $sDefTimePattern) {
if ($oStr->preg_match($sDefTimePattern, $sDate)) {
$blDefTimeFound = true;
break;
}
}
// setting and returning default formatted value
if ($blOnlyDate) {
$oObject->setValue(trim($aDFormats[$sLocalDateFormat][2])); // . " " . @$aTFormats[$sLocalTimeFormat][2]);
// increasing(decreasing) field length
$oObject->fldmax_length = strlen($oObject->value);
return;
} elseif ($blDefTimeFound) {
// setting value
$oObject->setValue(trim($aDFormats[$sLocalDateFormat][2] . " " . $aTFormats[$sLocalTimeFormat][2]));
// increasing(decreasing) field length
$oObject->fldmax_length = strlen($oObject->value);
return;
}
} | php | protected function _setDefaultFormatedValue($oObject, $sDate, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
{
$aDefTimePatterns = $this->_defaultTimePattern();
$aDFormats = $this->_defineDateFormattingRules();
$aTFormats = $this->_defineTimeFormattingRules();
$oStr = getStr();
foreach (array_keys($aDefTimePatterns) as $sDefTimePattern) {
if ($oStr->preg_match($sDefTimePattern, $sDate)) {
$blDefTimeFound = true;
break;
}
}
// setting and returning default formatted value
if ($blOnlyDate) {
$oObject->setValue(trim($aDFormats[$sLocalDateFormat][2])); // . " " . @$aTFormats[$sLocalTimeFormat][2]);
// increasing(decreasing) field length
$oObject->fldmax_length = strlen($oObject->value);
return;
} elseif ($blDefTimeFound) {
// setting value
$oObject->setValue(trim($aDFormats[$sLocalDateFormat][2] . " " . $aTFormats[$sLocalTimeFormat][2]));
// increasing(decreasing) field length
$oObject->fldmax_length = strlen($oObject->value);
return;
}
} | [
"protected",
"function",
"_setDefaultFormatedValue",
"(",
"$",
"oObject",
",",
"$",
"sDate",
",",
"$",
"sLocalDateFormat",
",",
"$",
"sLocalTimeFormat",
",",
"$",
"blOnlyDate",
")",
"{",
"$",
"aDefTimePatterns",
"=",
"$",
"this",
"->",
"_defaultTimePattern",
"("... | sets default formatted value
@param object $oObject date field object
@param string $sDate preferred date
@param string $sLocalDateFormat input format
@param string $sLocalTimeFormat local format
@param bool $blOnlyDate marker to format only date field (no time)
@return null | [
"sets",
"default",
"formatted",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L283-L312 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate._defineAndCheckDefaultTimeValues | protected function _defineAndCheckDefaultTimeValues($blToTimeStamp)
{
// defining time format
// checking for default values
$sLocalTimeFormat = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sLocalTimeFormat');
if (!$sLocalTimeFormat || $blToTimeStamp) {
$sLocalTimeFormat = "ISO";
}
return $sLocalTimeFormat;
} | php | protected function _defineAndCheckDefaultTimeValues($blToTimeStamp)
{
// defining time format
// checking for default values
$sLocalTimeFormat = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sLocalTimeFormat');
if (!$sLocalTimeFormat || $blToTimeStamp) {
$sLocalTimeFormat = "ISO";
}
return $sLocalTimeFormat;
} | [
"protected",
"function",
"_defineAndCheckDefaultTimeValues",
"(",
"$",
"blToTimeStamp",
")",
"{",
"// defining time format",
"// checking for default values",
"$",
"sLocalTimeFormat",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig... | defines and checks default time values
@param bool $blToTimeStamp -
@return string | [
"defines",
"and",
"checks",
"default",
"time",
"values"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L321-L331 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate._defineAndCheckDefaultDateValues | protected function _defineAndCheckDefaultDateValues($blToTimeStamp)
{
// defining time format
// checking for default values
$sLocalDateFormat = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sLocalDateFormat');
if (!$sLocalDateFormat || $blToTimeStamp) {
$sLocalDateFormat = "ISO";
}
return $sLocalDateFormat;
} | php | protected function _defineAndCheckDefaultDateValues($blToTimeStamp)
{
// defining time format
// checking for default values
$sLocalDateFormat = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sLocalDateFormat');
if (!$sLocalDateFormat || $blToTimeStamp) {
$sLocalDateFormat = "ISO";
}
return $sLocalDateFormat;
} | [
"protected",
"function",
"_defineAndCheckDefaultDateValues",
"(",
"$",
"blToTimeStamp",
")",
"{",
"// defining time format",
"// checking for default values",
"$",
"sLocalDateFormat",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig... | defines and checks default date values
@param bool $blToTimeStamp marker how to format
@return string | [
"defines",
"and",
"checks",
"default",
"date",
"values"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L340-L350 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate._setDefaultDateTimeValue | protected function _setDefaultDateTimeValue($oObject, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
{
$aDFormats = $this->_defineDateFormattingRules();
$aTFormats = $this->_defineTimeFormattingRules();
$sReturn = $aDFormats[$sLocalDateFormat][2];
if (!$blOnlyDate) {
$sReturn .= " " . $aTFormats[$sLocalTimeFormat][2];
}
if ($oObject instanceof \OxidEsales\Eshop\Core\Field) {
$oObject->setValue(trim($sReturn));
} else {
$oObject->value = trim($sReturn);
}
// increasing(decreasing) field lenght
$oObject->fldmax_length = strlen($oObject->value);
} | php | protected function _setDefaultDateTimeValue($oObject, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
{
$aDFormats = $this->_defineDateFormattingRules();
$aTFormats = $this->_defineTimeFormattingRules();
$sReturn = $aDFormats[$sLocalDateFormat][2];
if (!$blOnlyDate) {
$sReturn .= " " . $aTFormats[$sLocalTimeFormat][2];
}
if ($oObject instanceof \OxidEsales\Eshop\Core\Field) {
$oObject->setValue(trim($sReturn));
} else {
$oObject->value = trim($sReturn);
}
// increasing(decreasing) field lenght
$oObject->fldmax_length = strlen($oObject->value);
} | [
"protected",
"function",
"_setDefaultDateTimeValue",
"(",
"$",
"oObject",
",",
"$",
"sLocalDateFormat",
",",
"$",
"sLocalTimeFormat",
",",
"$",
"blOnlyDate",
")",
"{",
"$",
"aDFormats",
"=",
"$",
"this",
"->",
"_defineDateFormattingRules",
"(",
")",
";",
"$",
... | Sets default date time value
@param object $oObject date field object
@param string $sLocalDateFormat input format
@param string $sLocalTimeFormat local format
@param bool $blOnlyDate marker to format only date field (no time) | [
"Sets",
"default",
"date",
"time",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L438-L455 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate._formatCorrectTimeValue | protected function _formatCorrectTimeValue($oObject, $sDateFormat, $sTimeFormat, $aDateMatches, $aTimeMatches, $aTFields, $aDFields)
{
// formatting correct time value
$iTimestamp = @mktime(
(int) $aTimeMatches[$aTFields[0]],
(int) $aTimeMatches[$aTFields[1]],
(int) $aTimeMatches[$aTFields[2]],
(int) $aDateMatches[$aDFields[0]],
(int) $aDateMatches[$aDFields[1]],
(int) $aDateMatches[$aDFields[2]]
);
if ($oObject instanceof \OxidEsales\Eshop\Core\Field) {
$oObject->setValue(trim(@date($sDateFormat . " " . $sTimeFormat, $iTimestamp)));
} else {
$oObject->value = trim(@date($sDateFormat . " " . $sTimeFormat, $iTimestamp));
}
// we should increase (decrease) field lenght
$oObject->fldmax_length = strlen($oObject->value);
} | php | protected function _formatCorrectTimeValue($oObject, $sDateFormat, $sTimeFormat, $aDateMatches, $aTimeMatches, $aTFields, $aDFields)
{
// formatting correct time value
$iTimestamp = @mktime(
(int) $aTimeMatches[$aTFields[0]],
(int) $aTimeMatches[$aTFields[1]],
(int) $aTimeMatches[$aTFields[2]],
(int) $aDateMatches[$aDFields[0]],
(int) $aDateMatches[$aDFields[1]],
(int) $aDateMatches[$aDFields[2]]
);
if ($oObject instanceof \OxidEsales\Eshop\Core\Field) {
$oObject->setValue(trim(@date($sDateFormat . " " . $sTimeFormat, $iTimestamp)));
} else {
$oObject->value = trim(@date($sDateFormat . " " . $sTimeFormat, $iTimestamp));
}
// we should increase (decrease) field lenght
$oObject->fldmax_length = strlen($oObject->value);
} | [
"protected",
"function",
"_formatCorrectTimeValue",
"(",
"$",
"oObject",
",",
"$",
"sDateFormat",
",",
"$",
"sTimeFormat",
",",
"$",
"aDateMatches",
",",
"$",
"aTimeMatches",
",",
"$",
"aTFields",
",",
"$",
"aDFields",
")",
"{",
"// formatting correct time value",... | Formatting correct time value
@param object $oObject data field object
@param string $sDateFormat date format
@param string $sTimeFormat time format
@param array $aDateMatches new new date
@param array $aTimeMatches new time
@param array $aTFields defines the time fields
@param array $aDFields defines the date fields | [
"Formatting",
"correct",
"time",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L497-L517 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate.shiftServerTime | public function shiftServerTime($iTime)
{
$iServerTimeShift = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iServerTimeShift');
if ($iServerTimeShift) {
$iTime = $iTime + ((int) $iServerTimeShift * 3600);
}
return $iTime;
} | php | public function shiftServerTime($iTime)
{
$iServerTimeShift = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iServerTimeShift');
if ($iServerTimeShift) {
$iTime = $iTime + ((int) $iServerTimeShift * 3600);
}
return $iTime;
} | [
"public",
"function",
"shiftServerTime",
"(",
"$",
"iTime",
")",
"{",
"$",
"iServerTimeShift",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'iServerTimeShift'",
")",
";",
"... | Shift time if needed by configured timezone.
@param int $iTime
@return int | [
"Shift",
"time",
"if",
"needed",
"by",
"configured",
"timezone",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L609-L616 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate.german2English | public function german2English($sDate)
{
$aDate = explode(".", $sDate);
if (isset($aDate) && count($aDate) > 1) {
if (count($aDate) == 2) {
$sDate = $aDate[1] . "-" . $aDate[0];
} else {
$sDate = $aDate[2] . "-" . $aDate[1] . "-" . $aDate[0];
}
}
return $sDate;
} | php | public function german2English($sDate)
{
$aDate = explode(".", $sDate);
if (isset($aDate) && count($aDate) > 1) {
if (count($aDate) == 2) {
$sDate = $aDate[1] . "-" . $aDate[0];
} else {
$sDate = $aDate[2] . "-" . $aDate[1] . "-" . $aDate[0];
}
}
return $sDate;
} | [
"public",
"function",
"german2English",
"(",
"$",
"sDate",
")",
"{",
"$",
"aDate",
"=",
"explode",
"(",
"\".\"",
",",
"$",
"sDate",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"aDate",
")",
"&&",
"count",
"(",
"$",
"aDate",
")",
">",
"1",
")",
"{",
... | Reformats and returns German date string to English.
@param string $sDate German format date string
@return string | [
"Reformats",
"and",
"returns",
"German",
"date",
"string",
"to",
"English",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L651-L664 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsDate.php | UtilsDate.isEmptyDate | public function isEmptyDate($sDate)
{
if (!empty($sDate)) {
$sDate = preg_replace("/[^0-9a-z]/i", "", $sDate);
if (!is_numeric($sDate) || $sDate != 0) {
return false;
}
}
return true;
} | php | public function isEmptyDate($sDate)
{
if (!empty($sDate)) {
$sDate = preg_replace("/[^0-9a-z]/i", "", $sDate);
if (!is_numeric($sDate) || $sDate != 0) {
return false;
}
}
return true;
} | [
"public",
"function",
"isEmptyDate",
"(",
"$",
"sDate",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"sDate",
")",
")",
"{",
"$",
"sDate",
"=",
"preg_replace",
"(",
"\"/[^0-9a-z]/i\"",
",",
"\"\"",
",",
"$",
"sDate",
")",
";",
"if",
"(",
"!",
"is_n... | Checks if date string is empty date field. Empty string or string with
all date values equal to 0 is treated as empty.
@param array $sDate date or date time string
@return bool | [
"Checks",
"if",
"date",
"string",
"is",
"empty",
"date",
"field",
".",
"Empty",
"string",
"or",
"string",
"with",
"all",
"date",
"values",
"equal",
"to",
"0",
"is",
"treated",
"as",
"empty",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsDate.php#L674-L684 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/SystemRequirementsMain.php | SystemRequirementsMain.render | public function render()
{
parent::render();
$oSysReq = oxNew(\OxidEsales\Eshop\Core\SystemRequirements::class);
$this->_aViewData['aInfo'] = $oSysReq->getSystemInfo();
$this->_aViewData['aCollations'] = $oSysReq->checkCollation();
return "sysreq_main.tpl";
} | php | public function render()
{
parent::render();
$oSysReq = oxNew(\OxidEsales\Eshop\Core\SystemRequirements::class);
$this->_aViewData['aInfo'] = $oSysReq->getSystemInfo();
$this->_aViewData['aCollations'] = $oSysReq->checkCollation();
return "sysreq_main.tpl";
} | [
"public",
"function",
"render",
"(",
")",
"{",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"oSysReq",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"SystemRequirements",
"::",
"class",
")",
";",
"$",
"this",
"->",
"_aViewD... | Loads article Mercators info, passes it to Smarty engine and
returns name of template file "Mercator_main.tpl".
@return string | [
"Loads",
"article",
"Mercators",
"info",
"passes",
"it",
"to",
"Smarty",
"engine",
"and",
"returns",
"name",
"of",
"template",
"file",
"Mercator_main",
".",
"tpl",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/SystemRequirementsMain.php#L23-L33 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/SystemRequirementsMain.php | SystemRequirementsMain.getReqInfoUrl | public function getReqInfoUrl($sIdent)
{
$oSysReq = oxNew(\OxidEsales\Eshop\Core\SystemRequirements::class);
return $oSysReq->getReqInfoUrl($sIdent);
} | php | public function getReqInfoUrl($sIdent)
{
$oSysReq = oxNew(\OxidEsales\Eshop\Core\SystemRequirements::class);
return $oSysReq->getReqInfoUrl($sIdent);
} | [
"public",
"function",
"getReqInfoUrl",
"(",
"$",
"sIdent",
")",
"{",
"$",
"oSysReq",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"SystemRequirements",
"::",
"class",
")",
";",
"return",
"$",
"oSysReq",
"->",
"getReqInfoUrl",
"... | Returns hint URL
@param string $sIdent Module ident
@return string | [
"Returns",
"hint",
"URL"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/SystemRequirementsMain.php#L68-L73 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountRecommlistController.php | AccountRecommlistController.getRecommLists | public function getRecommLists()
{
if ($this->_aUserRecommLists === null) {
$this->_aUserRecommLists = false;
if (($oUser = $this->getUser())) {
// recommendation list
$this->_aUserRecommLists = $oUser->getUserRecommLists();
}
}
return $this->_aUserRecommLists;
} | php | public function getRecommLists()
{
if ($this->_aUserRecommLists === null) {
$this->_aUserRecommLists = false;
if (($oUser = $this->getUser())) {
// recommendation list
$this->_aUserRecommLists = $oUser->getUserRecommLists();
}
}
return $this->_aUserRecommLists;
} | [
"public",
"function",
"getRecommLists",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aUserRecommLists",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_aUserRecommLists",
"=",
"false",
";",
"if",
"(",
"(",
"$",
"oUser",
"=",
"$",
"this",
"->",
"getUser... | return recomm list from the user
@return array | [
"return",
"recomm",
"list",
"from",
"the",
"user"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountRecommlistController.php#L125-L136 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountRecommlistController.php | AccountRecommlistController.getArticleList | public function getArticleList()
{
if ($this->_oActRecommListArticles === null) {
$this->_oActRecommListArticles = false;
if (($oRecommList = $this->getActiveRecommList())) {
$oItemList = $oRecommList->getArticles();
if ($oItemList->count()) {
foreach ($oItemList as $key => $oItem) {
if (!$oItem->isVisible()) {
$oRecommList->removeArticle($oItem->getId());
$oItemList->offsetUnset($key);
continue;
}
$oItem->text = $oRecommList->getArtDescription($oItem->getId());
}
$this->_oActRecommListArticles = $oItemList;
}
}
}
return $this->_oActRecommListArticles;
} | php | public function getArticleList()
{
if ($this->_oActRecommListArticles === null) {
$this->_oActRecommListArticles = false;
if (($oRecommList = $this->getActiveRecommList())) {
$oItemList = $oRecommList->getArticles();
if ($oItemList->count()) {
foreach ($oItemList as $key => $oItem) {
if (!$oItem->isVisible()) {
$oRecommList->removeArticle($oItem->getId());
$oItemList->offsetUnset($key);
continue;
}
$oItem->text = $oRecommList->getArtDescription($oItem->getId());
}
$this->_oActRecommListArticles = $oItemList;
}
}
}
return $this->_oActRecommListArticles;
} | [
"public",
"function",
"getArticleList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oActRecommListArticles",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oActRecommListArticles",
"=",
"false",
";",
"if",
"(",
"(",
"$",
"oRecommList",
"=",
"$",
"this",
... | return all articles in the recomm list
@return null | [
"return",
"all",
"articles",
"in",
"the",
"recomm",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountRecommlistController.php#L143-L167 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountRecommlistController.php | AccountRecommlistController.getActiveRecommList | public function getActiveRecommList()
{
if (!$this->getViewConfig()->getShowListmania()) {
return false;
}
if ($this->_oActRecommList === null) {
$this->_oActRecommList = false;
if (($oUser = $this->getUser()) &&
($sRecommId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommid'))
) {
$oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
$sUserIdField = 'oxrecommlists__oxuserid';
if (($oRecommList->load($sRecommId)) && $oUser->getId() === $oRecommList->$sUserIdField->value) {
$this->_oActRecommList = $oRecommList;
}
}
}
return $this->_oActRecommList;
} | php | public function getActiveRecommList()
{
if (!$this->getViewConfig()->getShowListmania()) {
return false;
}
if ($this->_oActRecommList === null) {
$this->_oActRecommList = false;
if (($oUser = $this->getUser()) &&
($sRecommId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recommid'))
) {
$oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
$sUserIdField = 'oxrecommlists__oxuserid';
if (($oRecommList->load($sRecommId)) && $oUser->getId() === $oRecommList->$sUserIdField->value) {
$this->_oActRecommList = $oRecommList;
}
}
}
return $this->_oActRecommList;
} | [
"public",
"function",
"getActiveRecommList",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getViewConfig",
"(",
")",
"->",
"getShowListmania",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"_oActRecommList",
"===",
... | return the active entrys
@return null | [
"return",
"the",
"active",
"entrys"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountRecommlistController.php#L174-L195 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/AccountRecommlistController.php | AccountRecommlistController.saveRecommList | public function saveRecommList()
{
if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
return;
}
if (!$this->getViewConfig()->getShowListmania()) {
return;
}
if (($oUser = $this->getUser())) {
if (!($oRecommList = $this->getActiveRecommList())) {
$oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
$oRecommList->oxrecommlists__oxuserid = new \OxidEsales\Eshop\Core\Field($oUser->getId());
$oRecommList->oxrecommlists__oxshopid = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
} else {
$this->_sThisTemplate = 'page/account/recommendationedit.tpl';
}
$sTitle = trim(( string ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recomm_title', true));
$sAuthor = trim(( string ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recomm_author', true));
$sText = trim(( string ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recomm_desc', true));
$oRecommList->oxrecommlists__oxtitle = new \OxidEsales\Eshop\Core\Field($sTitle);
$oRecommList->oxrecommlists__oxauthor = new \OxidEsales\Eshop\Core\Field($sAuthor);
$oRecommList->oxrecommlists__oxdesc = new \OxidEsales\Eshop\Core\Field($sText);
try {
// marking entry as saved
$this->_blSavedEntry = (bool) $oRecommList->save();
$this->setActiveRecommList($this->_blSavedEntry ? $oRecommList : false);
} catch (\OxidEsales\Eshop\Core\Exception\ObjectException $oEx) {
//add to display at specific position
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx, false, true, 'user');
}
}
} | php | public function saveRecommList()
{
if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
return;
}
if (!$this->getViewConfig()->getShowListmania()) {
return;
}
if (($oUser = $this->getUser())) {
if (!($oRecommList = $this->getActiveRecommList())) {
$oRecommList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
$oRecommList->oxrecommlists__oxuserid = new \OxidEsales\Eshop\Core\Field($oUser->getId());
$oRecommList->oxrecommlists__oxshopid = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
} else {
$this->_sThisTemplate = 'page/account/recommendationedit.tpl';
}
$sTitle = trim(( string ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recomm_title', true));
$sAuthor = trim(( string ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recomm_author', true));
$sText = trim(( string ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recomm_desc', true));
$oRecommList->oxrecommlists__oxtitle = new \OxidEsales\Eshop\Core\Field($sTitle);
$oRecommList->oxrecommlists__oxauthor = new \OxidEsales\Eshop\Core\Field($sAuthor);
$oRecommList->oxrecommlists__oxdesc = new \OxidEsales\Eshop\Core\Field($sText);
try {
// marking entry as saved
$this->_blSavedEntry = (bool) $oRecommList->save();
$this->setActiveRecommList($this->_blSavedEntry ? $oRecommList : false);
} catch (\OxidEsales\Eshop\Core\Exception\ObjectException $oEx) {
//add to display at specific position
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx, false, true, 'user');
}
}
} | [
"public",
"function",
"saveRecommList",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"checkSessionChallenge",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!... | add new recommlist
@return null | [
"add",
"new",
"recommlist"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountRecommlistController.php#L212-L248 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/BasketComponent.php | BasketComponent.init | public function init()
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if ($oConfig->getConfigParam('blPsBasketReservationEnabled')) {
if ($oReservations = $this->getSession()->getBasketReservations()) {
if (!$oReservations->getTimeLeft()) {
$oBasket = $this->getSession()->getBasket();
if ($oBasket && $oBasket->getProductsCount()) {
$this->emptyBasket($oBasket);
}
}
$iLimit = (int) $oConfig->getConfigParam('iBasketReservationCleanPerRequest');
if (!$iLimit) {
$iLimit = 200;
}
$oReservations->discardUnusedReservations($iLimit);
}
}
parent::init();
// Basket exclude
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blBasketExcludeEnabled')) {
if ($oBasket = $this->getSession()->getBasket()) {
$this->getParent()->setRootCatChanged($this->isRootCatChanged() && $oBasket->getContents());
}
}
} | php | public function init()
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if ($oConfig->getConfigParam('blPsBasketReservationEnabled')) {
if ($oReservations = $this->getSession()->getBasketReservations()) {
if (!$oReservations->getTimeLeft()) {
$oBasket = $this->getSession()->getBasket();
if ($oBasket && $oBasket->getProductsCount()) {
$this->emptyBasket($oBasket);
}
}
$iLimit = (int) $oConfig->getConfigParam('iBasketReservationCleanPerRequest');
if (!$iLimit) {
$iLimit = 200;
}
$oReservations->discardUnusedReservations($iLimit);
}
}
parent::init();
// Basket exclude
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blBasketExcludeEnabled')) {
if ($oBasket = $this->getSession()->getBasket()) {
$this->getParent()->setRootCatChanged($this->isRootCatChanged() && $oBasket->getContents());
}
}
} | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"if",
"(",
"$",
"oConfig",
"->",
"getConfigParam",
"(",
"'blPsBasketReservationEnabled'",
... | Initiates component. | [
"Initiates",
"component",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/BasketComponent.php#L60-L87 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/BasketComponent.php | BasketComponent._getRedirectUrl | protected function _getRedirectUrl()
{
// active controller id
$controllerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestControllerId();
$controllerId = $controllerId ? $controllerId . '?' : 'start?';
$sPosition = '';
// setting redirect parameters
foreach ($this->aRedirectParams as $sParamName) {
$sParamVal = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sParamName);
$sPosition .= $sParamVal ? $sParamName . '=' . $sParamVal . '&' : '';
}
// special treatment
// search param
$sParam = rawurlencode(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam', true));
$sPosition .= $sParam ? 'searchparam=' . $sParam . '&' : '';
// current page number
$iPageNr = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr');
$sPosition .= ($iPageNr > 0) ? 'pgNr=' . $iPageNr . '&' : '';
// reload and backbutton blocker
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNewBasketItemMessage') == 3) {
// saving return to shop link to session
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('_backtoshop', $controllerId . $sPosition);
// redirecting to basket
$controllerId = 'basket?';
}
return $controllerId . $sPosition;
} | php | protected function _getRedirectUrl()
{
// active controller id
$controllerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestControllerId();
$controllerId = $controllerId ? $controllerId . '?' : 'start?';
$sPosition = '';
// setting redirect parameters
foreach ($this->aRedirectParams as $sParamName) {
$sParamVal = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($sParamName);
$sPosition .= $sParamVal ? $sParamName . '=' . $sParamVal . '&' : '';
}
// special treatment
// search param
$sParam = rawurlencode(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchparam', true));
$sPosition .= $sParam ? 'searchparam=' . $sParam . '&' : '';
// current page number
$iPageNr = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr');
$sPosition .= ($iPageNr > 0) ? 'pgNr=' . $iPageNr . '&' : '';
// reload and backbutton blocker
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNewBasketItemMessage') == 3) {
// saving return to shop link to session
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('_backtoshop', $controllerId . $sPosition);
// redirecting to basket
$controllerId = 'basket?';
}
return $controllerId . $sPosition;
} | [
"protected",
"function",
"_getRedirectUrl",
"(",
")",
"{",
"// active controller id",
"$",
"controllerId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestControllerId",
"(",
")",
";",
"$",
... | Formats and returns redirect URL where shop must be redirected after
storing something to basket
@return string $sClass.$sPosition redirection URL | [
"Formats",
"and",
"returns",
"redirect",
"URL",
"where",
"shop",
"must",
"be",
"redirected",
"after",
"storing",
"something",
"to",
"basket"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/BasketComponent.php#L248-L281 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/BasketComponent.php | BasketComponent.getPersistedParameters | protected function getPersistedParameters($persistedParameters = null)
{
$persistedParameters = ($persistedParameters ?: \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('persparam'));
if (!is_array($persistedParameters)) {
return null;
}
return array_filter($persistedParameters) ?: null;
} | php | protected function getPersistedParameters($persistedParameters = null)
{
$persistedParameters = ($persistedParameters ?: \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('persparam'));
if (!is_array($persistedParameters)) {
return null;
}
return array_filter($persistedParameters) ?: null;
} | [
"protected",
"function",
"getPersistedParameters",
"(",
"$",
"persistedParameters",
"=",
"null",
")",
"{",
"$",
"persistedParameters",
"=",
"(",
"$",
"persistedParameters",
"?",
":",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getCo... | Cleans and returns persisted parameters.
@param array $persistedParameters key-value parameters (optional). If not passed - takes parameters from request.
@return array|null cleaned up parameters or null, if there are no non-empty parameters | [
"Cleans",
"and",
"returns",
"persisted",
"parameters",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/BasketComponent.php#L290-L297 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/BasketComponent.php | BasketComponent._getItems | protected function _getItems(
$sProductId = null,
$dAmount = null,
$aSel = null,
$aPersParam = null,
$blOverride = false
) {
// collecting items to add
$aProducts = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aproducts');
// collecting specified item
$sProductId = $sProductId ? $sProductId : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid');
if ($sProductId) {
// additionally fetching current product info
$dAmount = isset($dAmount) ? $dAmount : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('am');
// select lists
$aSel = isset($aSel) ? $aSel : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sel');
// persistent parameters
if (empty($aPersParam)) {
$aPersParam = $this->getPersistedParameters();
}
$sBasketItemId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('bindex');
$aProducts[$sProductId] = ['am' => $dAmount,
'sel' => $aSel,
'persparam' => $aPersParam,
'override' => $blOverride,
'basketitemid' => $sBasketItemId
];
}
if (is_array($aProducts) && count($aProducts)) {
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('removeBtn') !== null) {
//setting amount to 0 if removing article from basket
foreach ($aProducts as $sProductId => $aProduct) {
if (isset($aProduct['remove']) && $aProduct['remove']) {
$aProducts[$sProductId]['am'] = 0;
} else {
unset($aProducts[$sProductId]);
}
}
}
return $aProducts;
}
return false;
} | php | protected function _getItems(
$sProductId = null,
$dAmount = null,
$aSel = null,
$aPersParam = null,
$blOverride = false
) {
// collecting items to add
$aProducts = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aproducts');
// collecting specified item
$sProductId = $sProductId ? $sProductId : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid');
if ($sProductId) {
// additionally fetching current product info
$dAmount = isset($dAmount) ? $dAmount : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('am');
// select lists
$aSel = isset($aSel) ? $aSel : \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sel');
// persistent parameters
if (empty($aPersParam)) {
$aPersParam = $this->getPersistedParameters();
}
$sBasketItemId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('bindex');
$aProducts[$sProductId] = ['am' => $dAmount,
'sel' => $aSel,
'persparam' => $aPersParam,
'override' => $blOverride,
'basketitemid' => $sBasketItemId
];
}
if (is_array($aProducts) && count($aProducts)) {
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('removeBtn') !== null) {
//setting amount to 0 if removing article from basket
foreach ($aProducts as $sProductId => $aProduct) {
if (isset($aProduct['remove']) && $aProduct['remove']) {
$aProducts[$sProductId]['am'] = 0;
} else {
unset($aProducts[$sProductId]);
}
}
}
return $aProducts;
}
return false;
} | [
"protected",
"function",
"_getItems",
"(",
"$",
"sProductId",
"=",
"null",
",",
"$",
"dAmount",
"=",
"null",
",",
"$",
"aSel",
"=",
"null",
",",
"$",
"aPersParam",
"=",
"null",
",",
"$",
"blOverride",
"=",
"false",
")",
"{",
"// collecting items to add",
... | Collects and returns array of items to add to basket. Product info is taken not only from
given parameters, but additionally from request 'aproducts' parameter
@param string $sProductId product ID
@param double $dAmount product amount
@param array $aSel product select lists
@param array $aPersParam product persistent parameters
@param bool $blOverride amount override status
@return mixed | [
"Collects",
"and",
"returns",
"array",
"of",
"items",
"to",
"add",
"to",
"basket",
".",
"Product",
"info",
"is",
"taken",
"not",
"only",
"from",
"given",
"parameters",
"but",
"additionally",
"from",
"request",
"aproducts",
"parameter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/BasketComponent.php#L311-L361 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/BasketComponent.php | BasketComponent._addItems | protected function _addItems($products)
{
$activeView = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView();
$errorDestination = $activeView->getErrorDestination();
$basket = $this->getSession()->getBasket();
$basketInfo = $basket->getBasketSummary();
$basketItemAmounts = [];
foreach ($products as $addProductId => $productInfo) {
$data = $this->prepareProductInformation($addProductId, $productInfo);
$productAmount = 0;
if (isset($basketInfo->aArticles[$data['id']])) {
$productAmount = $basketInfo->aArticles[$data['id']];
}
$products[$addProductId]['oldam'] = $productAmount;
//If we already changed articles so they now exactly match existing ones,
//we need to make sure we get the amounts correct
if (isset($basketItemAmounts[$data['oldBasketItemId']])) {
$data['amount'] = $data['amount'] + $basketItemAmounts[$data['oldBasketItemId']];
}
$basketItem = $this->addItemToBasket($basket, $data, $errorDestination);
if (($basketItem instanceof \OxidEsales\Eshop\Application\Model\BasketItem)) {
$basketItemKey = $basketItem->getBasketItemKey();
if ($basketItemKey) {
if (! isset($basketItemAmounts[$basketItemKey])) {
$basketItemAmounts[$basketItemKey] = 0;
}
$basketItemAmounts[$basketItemKey] += $data['amount'];
}
}
if (!$basketItem) {
$info = $basket->getBasketSummary();
$productAmount = $info->aArticles[$data['id']];
$products[$addProductId]['am'] = isset($productAmount) ? $productAmount : 0;
}
}
//if basket empty remove possible gift card
if ($basket->getProductsCount() == 0) {
$basket->setCardId(null);
}
// information that last call was tobasket
$this->_setLastCall($this->_getLastCallFnc(), $products, $basketInfo);
return $basketItem;
} | php | protected function _addItems($products)
{
$activeView = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView();
$errorDestination = $activeView->getErrorDestination();
$basket = $this->getSession()->getBasket();
$basketInfo = $basket->getBasketSummary();
$basketItemAmounts = [];
foreach ($products as $addProductId => $productInfo) {
$data = $this->prepareProductInformation($addProductId, $productInfo);
$productAmount = 0;
if (isset($basketInfo->aArticles[$data['id']])) {
$productAmount = $basketInfo->aArticles[$data['id']];
}
$products[$addProductId]['oldam'] = $productAmount;
//If we already changed articles so they now exactly match existing ones,
//we need to make sure we get the amounts correct
if (isset($basketItemAmounts[$data['oldBasketItemId']])) {
$data['amount'] = $data['amount'] + $basketItemAmounts[$data['oldBasketItemId']];
}
$basketItem = $this->addItemToBasket($basket, $data, $errorDestination);
if (($basketItem instanceof \OxidEsales\Eshop\Application\Model\BasketItem)) {
$basketItemKey = $basketItem->getBasketItemKey();
if ($basketItemKey) {
if (! isset($basketItemAmounts[$basketItemKey])) {
$basketItemAmounts[$basketItemKey] = 0;
}
$basketItemAmounts[$basketItemKey] += $data['amount'];
}
}
if (!$basketItem) {
$info = $basket->getBasketSummary();
$productAmount = $info->aArticles[$data['id']];
$products[$addProductId]['am'] = isset($productAmount) ? $productAmount : 0;
}
}
//if basket empty remove possible gift card
if ($basket->getProductsCount() == 0) {
$basket->setCardId(null);
}
// information that last call was tobasket
$this->_setLastCall($this->_getLastCallFnc(), $products, $basketInfo);
return $basketItem;
} | [
"protected",
"function",
"_addItems",
"(",
"$",
"products",
")",
"{",
"$",
"activeView",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getActiveView",
"(",
")",
";",
"$",
"errorDestination",
"="... | Adds all articles user wants to add to basket. Returns
last added to basket item.
@param array $products products to add array
@return object $oBasketItem last added basket item | [
"Adds",
"all",
"articles",
"user",
"wants",
"to",
"add",
"to",
"basket",
".",
"Returns",
"last",
"added",
"to",
"basket",
"item",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/BasketComponent.php#L371-L423 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/BasketComponent.php | BasketComponent.isRootCatChanged | public function isRootCatChanged()
{
// in Basket
$oBasket = $this->getSession()->getBasket();
if ($oBasket->showCatChangeWarning()) {
$oBasket->setCatChangeWarningState(false);
return true;
}
// in Category, only then category is empty ant not equal to default category
$sDefCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveShop()->oxshops__oxdefcat->value;
$sActCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid');
$oActCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($sActCat && $sActCat != $sDefCat && $oActCat->load($sActCat)) {
$sActRoot = $oActCat->oxcategories__oxrootid->value;
if ($oBasket->getBasketRootCatId() && $sActRoot != $oBasket->getBasketRootCatId()) {
return true;
}
}
return false;
} | php | public function isRootCatChanged()
{
// in Basket
$oBasket = $this->getSession()->getBasket();
if ($oBasket->showCatChangeWarning()) {
$oBasket->setCatChangeWarningState(false);
return true;
}
// in Category, only then category is empty ant not equal to default category
$sDefCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveShop()->oxshops__oxdefcat->value;
$sActCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid');
$oActCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($sActCat && $sActCat != $sDefCat && $oActCat->load($sActCat)) {
$sActRoot = $oActCat->oxcategories__oxrootid->value;
if ($oBasket->getBasketRootCatId() && $sActRoot != $oBasket->getBasketRootCatId()) {
return true;
}
}
return false;
} | [
"public",
"function",
"isRootCatChanged",
"(",
")",
"{",
"// in Basket",
"$",
"oBasket",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getBasket",
"(",
")",
";",
"if",
"(",
"$",
"oBasket",
"->",
"showCatChangeWarning",
"(",
")",
")",
"{",
"$",
... | Returns true if active root category was changed
@return bool | [
"Returns",
"true",
"if",
"active",
"root",
"category",
"was",
"changed"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/BasketComponent.php#L462-L484 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/BasketComponent.php | BasketComponent.prepareProductInformation | protected function prepareProductInformation($addProductId, $productInfo)
{
$return = [];
$return['id'] = isset($productInfo['aid']) ? $productInfo['aid'] : $addProductId;
$return['amount'] = isset($productInfo['am']) ? $productInfo['am'] : 0;
$return['selectList'] = isset($productInfo['sel']) ? $productInfo['sel'] : null;
$return['persistentParameters'] = $this->getPersistedParameters($productInfo['persparam']);
$return['override'] = isset($productInfo['override']) ? $productInfo['override'] : null;
$return['bundle'] = isset($productInfo['bundle']) ? true : false;
$return['oldBasketItemId'] = isset($productInfo['basketitemid']) ? $productInfo['basketitemid'] : null;
return $return;
} | php | protected function prepareProductInformation($addProductId, $productInfo)
{
$return = [];
$return['id'] = isset($productInfo['aid']) ? $productInfo['aid'] : $addProductId;
$return['amount'] = isset($productInfo['am']) ? $productInfo['am'] : 0;
$return['selectList'] = isset($productInfo['sel']) ? $productInfo['sel'] : null;
$return['persistentParameters'] = $this->getPersistedParameters($productInfo['persparam']);
$return['override'] = isset($productInfo['override']) ? $productInfo['override'] : null;
$return['bundle'] = isset($productInfo['bundle']) ? true : false;
$return['oldBasketItemId'] = isset($productInfo['basketitemid']) ? $productInfo['basketitemid'] : null;
return $return;
} | [
"protected",
"function",
"prepareProductInformation",
"(",
"$",
"addProductId",
",",
"$",
"productInfo",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"$",
"return",
"[",
"'id'",
"]",
"=",
"isset",
"(",
"$",
"productInfo",
"[",
"'aid'",
"]",
")",
"?",
"... | Prepare information for adding product to basket.
@param string $addProductId
@param array $productInfo
@return array | [
"Prepare",
"information",
"for",
"adding",
"product",
"to",
"basket",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/BasketComponent.php#L526-L540 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/BasketComponent.php | BasketComponent.addItemToBasket | protected function addItemToBasket($basket, $itemData, $errorDestination)
{
$basketItem = null;
try {
$basketItem = $basket->addToBasket(
$itemData['id'],
$itemData['amount'],
$itemData['selectList'],
$itemData['persistentParameters'],
$itemData['override'],
$itemData['bundle'],
$itemData['oldBasketItemId']
);
} catch (\OxidEsales\Eshop\Core\Exception\OutOfStockException $exception) {
$exception->setDestination($errorDestination);
// #950 Change error destination to basket popup
if (!$errorDestination && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNewBasketItemMessage') == 2) {
$errorDestination = 'popup';
}
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($exception, false, (bool) $errorDestination, $errorDestination);
} catch (\OxidEsales\Eshop\Core\Exception\ArticleInputException $exception) {
//add to display at specific position
$exception->setDestination($errorDestination);
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($exception, false, (bool) $errorDestination, $errorDestination);
} catch (\OxidEsales\Eshop\Core\Exception\NoArticleException $exception) {
//ignored, best solution F ?
}
return $basketItem;
} | php | protected function addItemToBasket($basket, $itemData, $errorDestination)
{
$basketItem = null;
try {
$basketItem = $basket->addToBasket(
$itemData['id'],
$itemData['amount'],
$itemData['selectList'],
$itemData['persistentParameters'],
$itemData['override'],
$itemData['bundle'],
$itemData['oldBasketItemId']
);
} catch (\OxidEsales\Eshop\Core\Exception\OutOfStockException $exception) {
$exception->setDestination($errorDestination);
// #950 Change error destination to basket popup
if (!$errorDestination && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNewBasketItemMessage') == 2) {
$errorDestination = 'popup';
}
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($exception, false, (bool) $errorDestination, $errorDestination);
} catch (\OxidEsales\Eshop\Core\Exception\ArticleInputException $exception) {
//add to display at specific position
$exception->setDestination($errorDestination);
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($exception, false, (bool) $errorDestination, $errorDestination);
} catch (\OxidEsales\Eshop\Core\Exception\NoArticleException $exception) {
//ignored, best solution F ?
}
return $basketItem;
} | [
"protected",
"function",
"addItemToBasket",
"(",
"$",
"basket",
",",
"$",
"itemData",
",",
"$",
"errorDestination",
")",
"{",
"$",
"basketItem",
"=",
"null",
";",
"try",
"{",
"$",
"basketItem",
"=",
"$",
"basket",
"->",
"addToBasket",
"(",
"$",
"itemData",... | Add one item to basket. Handle eventual errors.
@param \OxidEsales\Eshop\Application\Model\Basket $basket
@param array $itemData
@param string $errorDestination
@return null|oxBasketItem | [
"Add",
"one",
"item",
"to",
"basket",
".",
"Handle",
"eventual",
"errors",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/BasketComponent.php#L551-L581 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/DiscountList.php | DiscountList._getFilterSelect | protected function _getFilterSelect($oUser)
{
$oBaseObject = $this->getBaseObject();
$sTable = $oBaseObject->getViewName();
$sQ = "select " . $oBaseObject->getSelectFields() . " from $sTable ";
$sQ .= "where " . $oBaseObject->getSqlActiveSnippet() . ' ';
// defining initial filter parameters
$sUserId = null;
$sGroupIds = null;
$sCountryId = $this->getCountryId($oUser);
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
// checking for current session user which gives additional restrictions for user itself, users group and country
if ($oUser) {
// user ID
$sUserId = $oUser->getId();
// user group ids
foreach ($oUser->getUserGroups() as $oGroup) {
if ($sGroupIds) {
$sGroupIds .= ', ';
}
$sGroupIds .= $oDb->quote($oGroup->getId());
}
}
$sUserTable = getViewName('oxuser');
$sGroupTable = getViewName('oxgroups');
$sCountryTable = getViewName('oxcountry');
$sCountrySql = $sCountryId ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxcountry' and oxobject2discount.OXOBJECTID=" . $oDb->quote($sCountryId) . ")" : '0';
$sUserSql = $sUserId ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxuser' and oxobject2discount.OXOBJECTID=" . $oDb->quote($sUserId) . ")" : '0';
$sGroupSql = $sGroupIds ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxgroups' and oxobject2discount.OXOBJECTID in ($sGroupIds) )" : '0';
$sQ .= "and (
select
if(EXISTS(select 1 from oxobject2discount, $sCountryTable where $sCountryTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxcountry' LIMIT 1),
$sCountrySql,
1) &&
if(EXISTS(select 1 from oxobject2discount, $sUserTable where $sUserTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxuser' LIMIT 1),
$sUserSql,
1) &&
if(EXISTS(select 1 from oxobject2discount, $sGroupTable where $sGroupTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxgroups' LIMIT 1),
$sGroupSql,
1)
)";
$sQ .= " order by $sTable.oxsort ";
return $sQ;
} | php | protected function _getFilterSelect($oUser)
{
$oBaseObject = $this->getBaseObject();
$sTable = $oBaseObject->getViewName();
$sQ = "select " . $oBaseObject->getSelectFields() . " from $sTable ";
$sQ .= "where " . $oBaseObject->getSqlActiveSnippet() . ' ';
// defining initial filter parameters
$sUserId = null;
$sGroupIds = null;
$sCountryId = $this->getCountryId($oUser);
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
// checking for current session user which gives additional restrictions for user itself, users group and country
if ($oUser) {
// user ID
$sUserId = $oUser->getId();
// user group ids
foreach ($oUser->getUserGroups() as $oGroup) {
if ($sGroupIds) {
$sGroupIds .= ', ';
}
$sGroupIds .= $oDb->quote($oGroup->getId());
}
}
$sUserTable = getViewName('oxuser');
$sGroupTable = getViewName('oxgroups');
$sCountryTable = getViewName('oxcountry');
$sCountrySql = $sCountryId ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxcountry' and oxobject2discount.OXOBJECTID=" . $oDb->quote($sCountryId) . ")" : '0';
$sUserSql = $sUserId ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxuser' and oxobject2discount.OXOBJECTID=" . $oDb->quote($sUserId) . ")" : '0';
$sGroupSql = $sGroupIds ? "EXISTS(select oxobject2discount.oxid from oxobject2discount where oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxgroups' and oxobject2discount.OXOBJECTID in ($sGroupIds) )" : '0';
$sQ .= "and (
select
if(EXISTS(select 1 from oxobject2discount, $sCountryTable where $sCountryTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxcountry' LIMIT 1),
$sCountrySql,
1) &&
if(EXISTS(select 1 from oxobject2discount, $sUserTable where $sUserTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxuser' LIMIT 1),
$sUserSql,
1) &&
if(EXISTS(select 1 from oxobject2discount, $sGroupTable where $sGroupTable.oxid=oxobject2discount.oxobjectid and oxobject2discount.OXDISCOUNTID=$sTable.OXID and oxobject2discount.oxtype='oxgroups' LIMIT 1),
$sGroupSql,
1)
)";
$sQ .= " order by $sTable.oxsort ";
return $sQ;
} | [
"protected",
"function",
"_getFilterSelect",
"(",
"$",
"oUser",
")",
"{",
"$",
"oBaseObject",
"=",
"$",
"this",
"->",
"getBaseObject",
"(",
")",
";",
"$",
"sTable",
"=",
"$",
"oBaseObject",
"->",
"getViewName",
"(",
")",
";",
"$",
"sQ",
"=",
"\"select \"... | Creates discount list filter SQL to load current state discount list
@param \OxidEsales\Eshop\Application\Model\User $oUser user object
@return string | [
"Creates",
"discount",
"list",
"filter",
"SQL",
"to",
"load",
"current",
"state",
"discount",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/DiscountList.php#L108-L161 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/DiscountList.php | DiscountList.getBasketItemDiscounts | public function getBasketItemDiscounts($oArticle, $oBasket, $oUser = null)
{
$aList = [];
$aDiscList = $this->_getList($oUser)->getArray();
/** @var \OxidEsales\Eshop\Application\Model\Discount $oDiscount */
foreach ($aDiscList as $oDiscount) {
if ($oDiscount->isForBasketItem($oArticle) && $oDiscount->isForBasketAmount($oBasket)) {
$aList[$oDiscount->getId()] = $oDiscount;
}
}
return $aList;
} | php | public function getBasketItemDiscounts($oArticle, $oBasket, $oUser = null)
{
$aList = [];
$aDiscList = $this->_getList($oUser)->getArray();
/** @var \OxidEsales\Eshop\Application\Model\Discount $oDiscount */
foreach ($aDiscList as $oDiscount) {
if ($oDiscount->isForBasketItem($oArticle) && $oDiscount->isForBasketAmount($oBasket)) {
$aList[$oDiscount->getId()] = $oDiscount;
}
}
return $aList;
} | [
"public",
"function",
"getBasketItemDiscounts",
"(",
"$",
"oArticle",
",",
"$",
"oBasket",
",",
"$",
"oUser",
"=",
"null",
")",
"{",
"$",
"aList",
"=",
"[",
"]",
";",
"$",
"aDiscList",
"=",
"$",
"this",
"->",
"_getList",
"(",
"$",
"oUser",
")",
"->",... | Returns array of discounts that can be applied for individual basket item
@param mixed $oArticle article object or article id (according to needs)
@param \OxidEsales\Eshop\Application\Model\Basket $oBasket array of basket items containing article id, amount and price
@param \OxidEsales\Eshop\Application\Model\User $oUser user object (optional)
@return array | [
"Returns",
"array",
"of",
"discounts",
"that",
"can",
"be",
"applied",
"for",
"individual",
"basket",
"item"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/DiscountList.php#L193-L205 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/DiscountList.php | DiscountList.getBasketDiscounts | public function getBasketDiscounts($oBasket, $oUser = null)
{
$aList = [];
$aDiscList = $this->_getList($oUser)->getArray();
/** @var \OxidEsales\Eshop\Application\Model\Discount $oDiscount */
foreach ($aDiscList as $oDiscount) {
if ($oDiscount->isForBasket($oBasket)) {
$aList[$oDiscount->getId()] = $oDiscount;
}
}
return $aList;
} | php | public function getBasketDiscounts($oBasket, $oUser = null)
{
$aList = [];
$aDiscList = $this->_getList($oUser)->getArray();
/** @var \OxidEsales\Eshop\Application\Model\Discount $oDiscount */
foreach ($aDiscList as $oDiscount) {
if ($oDiscount->isForBasket($oBasket)) {
$aList[$oDiscount->getId()] = $oDiscount;
}
}
return $aList;
} | [
"public",
"function",
"getBasketDiscounts",
"(",
"$",
"oBasket",
",",
"$",
"oUser",
"=",
"null",
")",
"{",
"$",
"aList",
"=",
"[",
"]",
";",
"$",
"aDiscList",
"=",
"$",
"this",
"->",
"_getList",
"(",
"$",
"oUser",
")",
"->",
"getArray",
"(",
")",
"... | Returns array of discounts that can be applied for whole basket
@param \OxidEsales\Eshop\Application\Model\Basket $oBasket basket
@param \OxidEsales\Eshop\Application\Model\User $oUser user object (optional)
@return array | [
"Returns",
"array",
"of",
"discounts",
"that",
"can",
"be",
"applied",
"for",
"whole",
"basket"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/DiscountList.php#L215-L227 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/DiscountList.php | DiscountList.getBasketItemBundleDiscounts | public function getBasketItemBundleDiscounts($oArticle, $oBasket, $oUser = null)
{
$aList = [];
$aDiscList = $this->_getList($oUser)->getArray();
/** @var \OxidEsales\Eshop\Application\Model\Discount $oDiscount */
foreach ($aDiscList as $oDiscount) {
if ($oDiscount->isForBundleItem($oArticle, $oBasket) && $oDiscount->isForBasketAmount($oBasket)) {
$aList[$oDiscount->getId()] = $oDiscount;
}
}
return $aList;
} | php | public function getBasketItemBundleDiscounts($oArticle, $oBasket, $oUser = null)
{
$aList = [];
$aDiscList = $this->_getList($oUser)->getArray();
/** @var \OxidEsales\Eshop\Application\Model\Discount $oDiscount */
foreach ($aDiscList as $oDiscount) {
if ($oDiscount->isForBundleItem($oArticle, $oBasket) && $oDiscount->isForBasketAmount($oBasket)) {
$aList[$oDiscount->getId()] = $oDiscount;
}
}
return $aList;
} | [
"public",
"function",
"getBasketItemBundleDiscounts",
"(",
"$",
"oArticle",
",",
"$",
"oBasket",
",",
"$",
"oUser",
"=",
"null",
")",
"{",
"$",
"aList",
"=",
"[",
"]",
";",
"$",
"aDiscList",
"=",
"$",
"this",
"->",
"_getList",
"(",
"$",
"oUser",
")",
... | Returns array of bundle discounts that can be applied for whole basket
@param \OxidEsales\Eshop\Application\Model\Article $oArticle article object
@param \OxidEsales\Eshop\Application\Model\Basket $oBasket basket
@param \OxidEsales\Eshop\Application\Model\User $oUser user object (optional)
@return array | [
"Returns",
"array",
"of",
"bundle",
"discounts",
"that",
"can",
"be",
"applied",
"for",
"whole",
"basket"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/DiscountList.php#L238-L250 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/DiscountList.php | DiscountList.getBasketBundleDiscounts | public function getBasketBundleDiscounts($oBasket, $oUser = null)
{
$aList = [];
$aDiscList = $this->_getList($oUser)->getArray();
/** @var \OxidEsales\Eshop\Application\Model\Discount $oDiscount */
foreach ($aDiscList as $oDiscount) {
if ($oDiscount->isForBundleBasket($oBasket)) {
$aList[$oDiscount->getId()] = $oDiscount;
}
}
return $aList;
} | php | public function getBasketBundleDiscounts($oBasket, $oUser = null)
{
$aList = [];
$aDiscList = $this->_getList($oUser)->getArray();
/** @var \OxidEsales\Eshop\Application\Model\Discount $oDiscount */
foreach ($aDiscList as $oDiscount) {
if ($oDiscount->isForBundleBasket($oBasket)) {
$aList[$oDiscount->getId()] = $oDiscount;
}
}
return $aList;
} | [
"public",
"function",
"getBasketBundleDiscounts",
"(",
"$",
"oBasket",
",",
"$",
"oUser",
"=",
"null",
")",
"{",
"$",
"aList",
"=",
"[",
"]",
";",
"$",
"aDiscList",
"=",
"$",
"this",
"->",
"_getList",
"(",
"$",
"oUser",
")",
"->",
"getArray",
"(",
")... | Returns array of basket bundle discounts
@param \OxidEsales\Eshop\Application\Model\Basket $oBasket oxbasket object
@param \OxidEsales\Eshop\Application\Model\User $oUser oxuser object (optional)
@return array | [
"Returns",
"array",
"of",
"basket",
"bundle",
"discounts"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/DiscountList.php#L260-L272 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/DiscountList.php | DiscountList.hasSkipDiscountCategories | public function hasSkipDiscountCategories()
{
if ($this->_hasSkipDiscountCategories === null || $this->_blReload) {
$sViewName = getViewName('oxcategories');
$sQ = "select 1 from {$sViewName} where {$sViewName}.oxactive = 1 and {$sViewName}.oxskipdiscounts = '1' ";
$this->_hasSkipDiscountCategories = (bool) \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sQ);
}
return $this->_hasSkipDiscountCategories;
} | php | public function hasSkipDiscountCategories()
{
if ($this->_hasSkipDiscountCategories === null || $this->_blReload) {
$sViewName = getViewName('oxcategories');
$sQ = "select 1 from {$sViewName} where {$sViewName}.oxactive = 1 and {$sViewName}.oxskipdiscounts = '1' ";
$this->_hasSkipDiscountCategories = (bool) \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($sQ);
}
return $this->_hasSkipDiscountCategories;
} | [
"public",
"function",
"hasSkipDiscountCategories",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_hasSkipDiscountCategories",
"===",
"null",
"||",
"$",
"this",
"->",
"_blReload",
")",
"{",
"$",
"sViewName",
"=",
"getViewName",
"(",
"'oxcategories'",
")",
";",
... | Checks if any category has "skip discounts" status
@return bool | [
"Checks",
"if",
"any",
"category",
"has",
"skip",
"discounts",
"status"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/DiscountList.php#L279-L289 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/CategoryPictures.php | CategoryPictures.render | public function render()
{
parent::render();
$this->_aViewData['edit'] = $oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
$soxId = $this->getEditObjectId();
if (isset($soxId) && $soxId != '-1') {
// load object
$oCategory->load($soxId);
}
return "category_pictures.tpl";
} | php | public function render()
{
parent::render();
$this->_aViewData['edit'] = $oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
$soxId = $this->getEditObjectId();
if (isset($soxId) && $soxId != '-1') {
// load object
$oCategory->load($soxId);
}
return "category_pictures.tpl";
} | [
"public",
"function",
"render",
"(",
")",
"{",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"this",
"->",
"_aViewData",
"[",
"'edit'",
"]",
"=",
"$",
"oCategory",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model"... | Loads category object, passes it to Smarty engine and returns name
of template file "category_pictures.tpl".
@return string | [
"Loads",
"category",
"object",
"passes",
"it",
"to",
"Smarty",
"engine",
"and",
"returns",
"name",
"of",
"template",
"file",
"category_pictures",
".",
"tpl",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/CategoryPictures.php#L22-L35 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getActiveCheckQuery | public function getActiveCheckQuery($blForceCoreTable = null)
{
$sTable = $this->getViewName($blForceCoreTable);
// check if article is still active
$sQ = " $sTable.oxactive = 1 ";
$sQ .= " and $sTable.oxhidden = 0 ";
// enabled time range check ?
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blUseTimeCheck')) {
$sQ = $this->addSqlActiveRangeSnippet($sQ, $sTable);
}
return $sQ;
} | php | public function getActiveCheckQuery($blForceCoreTable = null)
{
$sTable = $this->getViewName($blForceCoreTable);
// check if article is still active
$sQ = " $sTable.oxactive = 1 ";
$sQ .= " and $sTable.oxhidden = 0 ";
// enabled time range check ?
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blUseTimeCheck')) {
$sQ = $this->addSqlActiveRangeSnippet($sQ, $sTable);
}
return $sQ;
} | [
"public",
"function",
"getActiveCheckQuery",
"(",
"$",
"blForceCoreTable",
"=",
"null",
")",
"{",
"$",
"sTable",
"=",
"$",
"this",
"->",
"getViewName",
"(",
"$",
"blForceCoreTable",
")",
";",
"// check if article is still active",
"$",
"sQ",
"=",
"\" $sTable.oxact... | Returns part of sql query used in active snippet. Query checks
if product "oxactive = 1". If config option "blUseTimeCheck" is TRUE
additionally checks if "oxactivefrom < current data < oxactiveto"
@param bool $blForceCoreTable force core table usage
@return string | [
"Returns",
"part",
"of",
"sql",
"query",
"used",
"in",
"active",
"snippet",
".",
"Query",
"checks",
"if",
"product",
"oxactive",
"=",
"1",
".",
"If",
"config",
"option",
"blUseTimeCheck",
"is",
"TRUE",
"additionally",
"checks",
"if",
"oxactivefrom",
"<",
"cu... | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L561-L576 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getFUnitPrice | public function getFUnitPrice()
{
if ($this->_fPricePerUnit == null) {
if ($oPrice = $this->getUnitPrice()) {
if ($dPrice = $this->_getPriceForView($oPrice)) {
$this->_fPricePerUnit = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
}
}
return $this->_fPricePerUnit;
} | php | public function getFUnitPrice()
{
if ($this->_fPricePerUnit == null) {
if ($oPrice = $this->getUnitPrice()) {
if ($dPrice = $this->_getPriceForView($oPrice)) {
$this->_fPricePerUnit = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
}
}
return $this->_fPricePerUnit;
} | [
"public",
"function",
"getFUnitPrice",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_fPricePerUnit",
"==",
"null",
")",
"{",
"if",
"(",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getUnitPrice",
"(",
")",
")",
"{",
"if",
"(",
"$",
"dPrice",
"=",
"$",
... | Returns formatted price per unit
@deprecated since v5.1 (2013-09-25); use oxPrice smarty plugin for formatting in templates
@return string | [
"Returns",
"formatted",
"price",
"per",
"unit"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L866-L877 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getUnitPrice | public function getUnitPrice()
{
// Performance
if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
return;
}
$oPrice = null;
if ((double) $this->getUnitQuantity() && $this->oxarticles__oxunitname->value) {
$oPrice = clone $this->getPrice();
$oPrice->divide((double) $this->getUnitQuantity());
}
return $oPrice;
} | php | public function getUnitPrice()
{
// Performance
if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
return;
}
$oPrice = null;
if ((double) $this->getUnitQuantity() && $this->oxarticles__oxunitname->value) {
$oPrice = clone $this->getPrice();
$oPrice->divide((double) $this->getUnitQuantity());
}
return $oPrice;
} | [
"public",
"function",
"getUnitPrice",
"(",
")",
"{",
"// Performance",
"if",
"(",
"!",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'bl_perfLoadPrice'",
")",
"||",
"!",
"$",
"... | Returns price per unit
@return string | [
"Returns",
"price",
"per",
"unit"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L884-L898 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getFMinPrice | public function getFMinPrice()
{
$sPrice = '';
if ($oPrice = $this->getMinPrice()) {
$dPrice = $this->_getPriceForView($oPrice);
$sPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
return $sPrice;
} | php | public function getFMinPrice()
{
$sPrice = '';
if ($oPrice = $this->getMinPrice()) {
$dPrice = $this->_getPriceForView($oPrice);
$sPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
return $sPrice;
} | [
"public",
"function",
"getFMinPrice",
"(",
")",
"{",
"$",
"sPrice",
"=",
"''",
";",
"if",
"(",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getMinPrice",
"(",
")",
")",
"{",
"$",
"dPrice",
"=",
"$",
"this",
"->",
"_getPriceForView",
"(",
"$",
"oPrice",
... | Returns formatted article min price
@deprecated since v5.1 (2013-10-04); use oxPrice smarty plugin for formatting in templates
@return string | [
"Returns",
"formatted",
"article",
"min",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L907-L916 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getFVarMinPrice | public function getFVarMinPrice()
{
$sPrice = '';
if ($oPrice = $this->getVarMinPrice()) {
$dPrice = $this->_getPriceForView($oPrice);
$sPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
return $sPrice;
} | php | public function getFVarMinPrice()
{
$sPrice = '';
if ($oPrice = $this->getVarMinPrice()) {
$dPrice = $this->_getPriceForView($oPrice);
$sPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
return $sPrice;
} | [
"public",
"function",
"getFVarMinPrice",
"(",
")",
"{",
"$",
"sPrice",
"=",
"''",
";",
"if",
"(",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getVarMinPrice",
"(",
")",
")",
"{",
"$",
"dPrice",
"=",
"$",
"this",
"->",
"_getPriceForView",
"(",
"$",
"oPric... | Returns formatted min article variant price
@deprecated since v5.1 (2013-10-04); use oxPrice smarty plugin for formatting in templates
@return string | [
"Returns",
"formatted",
"min",
"article",
"variant",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L925-L934 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getVarMinPrice | public function getVarMinPrice()
{
if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
return;
}
$oPrice = null;
$dPrice = $this->_calculateVarMinPrice();
$oPrice = $this->_getPriceObject();
$oPrice->setPrice($dPrice);
$this->_calculatePrice($oPrice);
return $oPrice;
} | php | public function getVarMinPrice()
{
if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
return;
}
$oPrice = null;
$dPrice = $this->_calculateVarMinPrice();
$oPrice = $this->_getPriceObject();
$oPrice->setPrice($dPrice);
$this->_calculatePrice($oPrice);
return $oPrice;
} | [
"public",
"function",
"getVarMinPrice",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'bl_perfLoadPrice'",
")",
"||",
"!",
"$",
"this",
"->",
"... | Returns article min price of variants
@return \OxidEsales\Eshop\Core\Price | [
"Returns",
"article",
"min",
"price",
"of",
"variants"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L941-L956 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getMinPrice | public function getMinPrice()
{
if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
return;
}
$oPrice = null;
$dPrice = $this->_getPrice();
if ($this->_getVarMinPrice() !== null && $dPrice > $this->_getVarMinPrice()) {
$dPrice = $this->_getVarMinPrice();
}
$dPrice = $this->_prepareModifiedPrice($dPrice);
$oPrice = $this->_getPriceObject();
$oPrice->setPrice($dPrice);
$this->_calculatePrice($oPrice);
return $oPrice;
} | php | public function getMinPrice()
{
if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
return;
}
$oPrice = null;
$dPrice = $this->_getPrice();
if ($this->_getVarMinPrice() !== null && $dPrice > $this->_getVarMinPrice()) {
$dPrice = $this->_getVarMinPrice();
}
$dPrice = $this->_prepareModifiedPrice($dPrice);
$oPrice = $this->_getPriceObject();
$oPrice->setPrice($dPrice);
$this->_calculatePrice($oPrice);
return $oPrice;
} | [
"public",
"function",
"getMinPrice",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'bl_perfLoadPrice'",
")",
"||",
"!",
"$",
"this",
"->",
"_bl... | Returns article min price in calculation included variants
@return \OxidEsales\Eshop\Core\Price | [
"Returns",
"article",
"min",
"price",
"in",
"calculation",
"included",
"variants"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L975-L994 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.isRangePrice | public function isRangePrice()
{
if ($this->_blIsRangePrice === null) {
$this->setRangePrice(false);
if ($this->_hasAnyVariant()) {
$dPrice = $this->_getPrice();
$dMinPrice = $this->_getVarMinPrice();
$dMaxPrice = $this->_getVarMaxPrice();
if ($dMinPrice != $dMaxPrice) {
$this->setRangePrice();
} elseif (!$this->isParentNotBuyable() && $dMinPrice != $dPrice) {
$this->setRangePrice();
}
}
}
return $this->_blIsRangePrice;
} | php | public function isRangePrice()
{
if ($this->_blIsRangePrice === null) {
$this->setRangePrice(false);
if ($this->_hasAnyVariant()) {
$dPrice = $this->_getPrice();
$dMinPrice = $this->_getVarMinPrice();
$dMaxPrice = $this->_getVarMaxPrice();
if ($dMinPrice != $dMaxPrice) {
$this->setRangePrice();
} elseif (!$this->isParentNotBuyable() && $dMinPrice != $dPrice) {
$this->setRangePrice();
}
}
}
return $this->_blIsRangePrice;
} | [
"public",
"function",
"isRangePrice",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_blIsRangePrice",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setRangePrice",
"(",
"false",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_hasAnyVariant",
"(",
")",
")",
... | Returns true if article has variant with different price
@return bool | [
"Returns",
"true",
"if",
"article",
"has",
"variant",
"with",
"different",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1013-L1032 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.isVisible | public function isVisible()
{
// admin preview mode
if (($blCanPreview = \OxidEsales\Eshop\Core\Registry::getUtils()->canPreview()) !== null) {
return $blCanPreview;
}
// active ?
$sNow = date('Y-m-d H:i:s');
if (!$this->oxarticles__oxactive->value &&
($this->oxarticles__oxactivefrom->value > $sNow ||
$this->oxarticles__oxactiveto->value < $sNow
)
) {
return false;
}
// stock flags
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blUseStock') && $this->oxarticles__oxstockflag->value == 2) {
$iOnStock = $this->oxarticles__oxstock->value + $this->oxarticles__oxvarstock->value;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blPsBasketReservationEnabled')) {
$iOnStock += $this->getSession()->getBasketReservations()->getReservedAmount($this->getId());
}
if ($iOnStock <= 0) {
return false;
}
}
return true;
} | php | public function isVisible()
{
// admin preview mode
if (($blCanPreview = \OxidEsales\Eshop\Core\Registry::getUtils()->canPreview()) !== null) {
return $blCanPreview;
}
// active ?
$sNow = date('Y-m-d H:i:s');
if (!$this->oxarticles__oxactive->value &&
($this->oxarticles__oxactivefrom->value > $sNow ||
$this->oxarticles__oxactiveto->value < $sNow
)
) {
return false;
}
// stock flags
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blUseStock') && $this->oxarticles__oxstockflag->value == 2) {
$iOnStock = $this->oxarticles__oxstock->value + $this->oxarticles__oxvarstock->value;
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blPsBasketReservationEnabled')) {
$iOnStock += $this->getSession()->getBasketReservations()->getReservedAmount($this->getId());
}
if ($iOnStock <= 0) {
return false;
}
}
return true;
} | [
"public",
"function",
"isVisible",
"(",
")",
"{",
"// admin preview mode",
"if",
"(",
"(",
"$",
"blCanPreview",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtils",
"(",
")",
"->",
"canPreview",
"(",
")",
")",
"!==",
... | Checks if article has visible status. Returns TRUE if its visible
@return bool | [
"Checks",
"if",
"article",
"has",
"visible",
"status",
".",
"Returns",
"TRUE",
"if",
"its",
"visible"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1052-L1081 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.hasSortingFieldsChanged | public function hasSortingFieldsChanged()
{
$aSortingFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSortCols');
$aSortingFields = !empty($aSortingFields) ? (array) $aSortingFields : [];
$blChanged = false;
foreach ($aSortingFields as $sField) {
$sParameterName = 'oxarticles__' . $sField;
$currentValueOfField = $this->$sParameterName instanceof Field ? $this->$sParameterName->value : '';
$valueOfFieldOnLoad = $this->_aSortingFieldsOnLoad[$sParameterName] ?? null;
if ($valueOfFieldOnLoad !== $currentValueOfField) {
$blChanged = true;
break;
}
}
return $blChanged;
} | php | public function hasSortingFieldsChanged()
{
$aSortingFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aSortCols');
$aSortingFields = !empty($aSortingFields) ? (array) $aSortingFields : [];
$blChanged = false;
foreach ($aSortingFields as $sField) {
$sParameterName = 'oxarticles__' . $sField;
$currentValueOfField = $this->$sParameterName instanceof Field ? $this->$sParameterName->value : '';
$valueOfFieldOnLoad = $this->_aSortingFieldsOnLoad[$sParameterName] ?? null;
if ($valueOfFieldOnLoad !== $currentValueOfField) {
$blChanged = true;
break;
}
}
return $blChanged;
} | [
"public",
"function",
"hasSortingFieldsChanged",
"(",
")",
"{",
"$",
"aSortingFields",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'aSortCols'",
")",
";",
"$",
"aSortingFiel... | Checks whether sorting fields changed from last article loading.
@return bool | [
"Checks",
"whether",
"sorting",
"fields",
"changed",
"from",
"last",
"article",
"loading",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1180-L1196 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getArticleRatingAverage | public function getArticleRatingAverage($blIncludeVariants = false)
{
if (!$blIncludeVariants) {
return round($this->oxarticles__oxrating->value, 1);
} else {
$oRating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class);
return $oRating->getRatingAverage($this->getId(), 'oxarticle', $this->getVariantIds());
}
} | php | public function getArticleRatingAverage($blIncludeVariants = false)
{
if (!$blIncludeVariants) {
return round($this->oxarticles__oxrating->value, 1);
} else {
$oRating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class);
return $oRating->getRatingAverage($this->getId(), 'oxarticle', $this->getVariantIds());
}
} | [
"public",
"function",
"getArticleRatingAverage",
"(",
"$",
"blIncludeVariants",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"blIncludeVariants",
")",
"{",
"return",
"round",
"(",
"$",
"this",
"->",
"oxarticles__oxrating",
"->",
"value",
",",
"1",
")",
";",
... | Returns product rating average
@param bool $blIncludeVariants - include variant ratings
@return double | [
"Returns",
"product",
"rating",
"average"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1243-L1252 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getArticleRatingCount | public function getArticleRatingCount($blIncludeVariants = false)
{
if (!$blIncludeVariants) {
return $this->oxarticles__oxratingcnt->value;
} else {
$oRating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class);
return $oRating->getRatingCount($this->getId(), 'oxarticle', $this->getVariantIds());
}
} | php | public function getArticleRatingCount($blIncludeVariants = false)
{
if (!$blIncludeVariants) {
return $this->oxarticles__oxratingcnt->value;
} else {
$oRating = oxNew(\OxidEsales\Eshop\Application\Model\Rating::class);
return $oRating->getRatingCount($this->getId(), 'oxarticle', $this->getVariantIds());
}
} | [
"public",
"function",
"getArticleRatingCount",
"(",
"$",
"blIncludeVariants",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"blIncludeVariants",
")",
"{",
"return",
"$",
"this",
"->",
"oxarticles__oxratingcnt",
"->",
"value",
";",
"}",
"else",
"{",
"$",
"oRat... | Returns product rating count
@param bool $blIncludeVariants - include variant ratings
@return double | [
"Returns",
"product",
"rating",
"count"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1261-L1270 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getCrossSelling | public function getCrossSelling()
{
$oCrosslist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oCrosslist->loadArticleCrossSell($this->oxarticles__oxid->value);
if ($oCrosslist->count()) {
return $oCrosslist;
}
} | php | public function getCrossSelling()
{
$oCrosslist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oCrosslist->loadArticleCrossSell($this->oxarticles__oxid->value);
if ($oCrosslist->count()) {
return $oCrosslist;
}
} | [
"public",
"function",
"getCrossSelling",
"(",
")",
"{",
"$",
"oCrosslist",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"ArticleList",
"::",
"class",
")",
";",
"$",
"oCrosslist",
"->",
"loadArticleCrossSell",
... | Loads and returns array with cross selling information.
@return array | [
"Loads",
"and",
"returns",
"array",
"with",
"cross",
"selling",
"information",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1310-L1317 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getAccessoires | public function getAccessoires()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// Performance
if (!$myConfig->getConfigParam('bl_perfLoadAccessoires')) {
return;
}
$oAcclist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oAcclist->setSqlLimit(0, $myConfig->getConfigParam('iNrofCrossellArticles'));
$oAcclist->loadArticleAccessoires($this->oxarticles__oxid->value);
if ($oAcclist->count()) {
return $oAcclist;
}
} | php | public function getAccessoires()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// Performance
if (!$myConfig->getConfigParam('bl_perfLoadAccessoires')) {
return;
}
$oAcclist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oAcclist->setSqlLimit(0, $myConfig->getConfigParam('iNrofCrossellArticles'));
$oAcclist->loadArticleAccessoires($this->oxarticles__oxid->value);
if ($oAcclist->count()) {
return $oAcclist;
}
} | [
"public",
"function",
"getAccessoires",
"(",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"// Performance",
"if",
"(",
"!",
"$",
"myConfig",
"->",
"getConfigParam",
"("... | Loads and returns array with accessories information.
@return array | [
"Loads",
"and",
"returns",
"array",
"with",
"accessories",
"information",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1324-L1340 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getSimilarProducts | public function getSimilarProducts()
{
// Performance
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (!$myConfig->getConfigParam('bl_perfLoadSimilar')) {
return;
}
// Check configured number of similar products (bug #6062)
if ($myConfig->getConfigParam('iNrofSimilarArticles') < 1) {
return;
}
$sArticleTable = $this->getViewName();
$sAttribs = '';
$iCnt = 0;
$this->_getAttribsString($sAttribs, $iCnt);
if (!$sAttribs) {
return null;
}
$aList = $this->_getSimList($sAttribs, $iCnt);
if (count($aList)) {
uasort($aList, function ($a, $b) {
if ($a->cnt == $b->cnt) {
return 0;
}
return ($a->cnt < $b->cnt) ? -1 : 1;
});
$sSearch = $this->_generateSimListSearchStr($sArticleTable, $aList);
$oSimilarlist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oSimilarlist->setSqlLimit(0, $myConfig->getConfigParam('iNrofSimilarArticles'));
$oSimilarlist->selectString($sSearch);
return $oSimilarlist;
}
} | php | public function getSimilarProducts()
{
// Performance
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (!$myConfig->getConfigParam('bl_perfLoadSimilar')) {
return;
}
// Check configured number of similar products (bug #6062)
if ($myConfig->getConfigParam('iNrofSimilarArticles') < 1) {
return;
}
$sArticleTable = $this->getViewName();
$sAttribs = '';
$iCnt = 0;
$this->_getAttribsString($sAttribs, $iCnt);
if (!$sAttribs) {
return null;
}
$aList = $this->_getSimList($sAttribs, $iCnt);
if (count($aList)) {
uasort($aList, function ($a, $b) {
if ($a->cnt == $b->cnt) {
return 0;
}
return ($a->cnt < $b->cnt) ? -1 : 1;
});
$sSearch = $this->_generateSimListSearchStr($sArticleTable, $aList);
$oSimilarlist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oSimilarlist->setSqlLimit(0, $myConfig->getConfigParam('iNrofSimilarArticles'));
$oSimilarlist->selectString($sSearch);
return $oSimilarlist;
}
} | [
"public",
"function",
"getSimilarProducts",
"(",
")",
"{",
"// Performance",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"if",
"(",
"!",
"$",
"myConfig",
"->",
"getConfigParam",
... | Returns a list of similar products.
@return array | [
"Returns",
"a",
"list",
"of",
"similar",
"products",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1347-L1388 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getCustomerAlsoBoughtThisProducts | public function getCustomerAlsoBoughtThisProducts()
{
// Performance
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (!$myConfig->getConfigParam('bl_perfLoadCustomerWhoBoughtThis')) {
return;
}
// selecting products that fits
$sQ = $this->_generateSearchStrForCustomerBought();
$oArticles = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oArticles->setSqlLimit(0, $myConfig->getConfigParam('iNrofCustomerWhoArticles'));
$oArticles->selectString($sQ);
if ($oArticles->count()) {
return $oArticles;
}
} | php | public function getCustomerAlsoBoughtThisProducts()
{
// Performance
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (!$myConfig->getConfigParam('bl_perfLoadCustomerWhoBoughtThis')) {
return;
}
// selecting products that fits
$sQ = $this->_generateSearchStrForCustomerBought();
$oArticles = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oArticles->setSqlLimit(0, $myConfig->getConfigParam('iNrofCustomerWhoArticles'));
$oArticles->selectString($sQ);
if ($oArticles->count()) {
return $oArticles;
}
} | [
"public",
"function",
"getCustomerAlsoBoughtThisProducts",
"(",
")",
"{",
"// Performance",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"if",
"(",
"!",
"$",
"myConfig",
"->",
"get... | Loads and returns articles list, bought by same customer.
@return oxArticleList|null | [
"Loads",
"and",
"returns",
"articles",
"list",
"bought",
"by",
"same",
"customer",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1395-L1412 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.loadAmountPriceInfo | public function loadAmountPriceInfo()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (!$myConfig->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice || !$this->_blCalcPrice || !$this->hasAmountPrice()) {
return [];
}
if ($this->_oAmountPriceInfo === null) {
$this->_oAmountPriceInfo = [];
if (count(($aAmPriceList = $this->_getAmountPriceList()->getArray()))) {
$this->_oAmountPriceInfo = $this->_fillAmountPriceList($aAmPriceList);
}
}
return $this->_oAmountPriceInfo;
} | php | public function loadAmountPriceInfo()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (!$myConfig->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice || !$this->_blCalcPrice || !$this->hasAmountPrice()) {
return [];
}
if ($this->_oAmountPriceInfo === null) {
$this->_oAmountPriceInfo = [];
if (count(($aAmPriceList = $this->_getAmountPriceList()->getArray()))) {
$this->_oAmountPriceInfo = $this->_fillAmountPriceList($aAmPriceList);
}
}
return $this->_oAmountPriceInfo;
} | [
"public",
"function",
"loadAmountPriceInfo",
"(",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"if",
"(",
"!",
"$",
"myConfig",
"->",
"getConfigParam",
"(",
"'bl_perfLo... | Returns list object with info about article price that depends on amount in basket.
Takes data from oxprice2article table. Returns false if such info is not set.
@return mixed | [
"Returns",
"list",
"object",
"with",
"info",
"about",
"article",
"price",
"that",
"depends",
"on",
"amount",
"in",
"basket",
".",
"Takes",
"data",
"from",
"oxprice2article",
"table",
".",
"Returns",
"false",
"if",
"such",
"info",
"is",
"not",
"set",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1420-L1435 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getVariantSelections | public function getVariantSelections($aFilterIds = null, $sActVariantId = null, $iLimit = 0)
{
$iLimit = (int) $iLimit;
if (!isset($this->_aVariantSelections[$iLimit])) {
$aVariantSelections = false;
if ($this->oxarticles__oxvarcount->value) {
$oVariants = $this->getVariants(false);
$aVariantSelections = oxNew(\OxidEsales\Eshop\Application\Model\VariantHandler::class)->buildVariantSelections(
$this->oxarticles__oxvarname->getRawValue(),
$oVariants,
$aFilterIds,
$sActVariantId,
$iLimit
);
if (!empty($oVariants) && empty($aVariantSelections['rawselections'])) {
$aVariantSelections = false;
}
}
$this->_aVariantSelections[$iLimit] = $aVariantSelections;
}
return $this->_aVariantSelections[$iLimit];
} | php | public function getVariantSelections($aFilterIds = null, $sActVariantId = null, $iLimit = 0)
{
$iLimit = (int) $iLimit;
if (!isset($this->_aVariantSelections[$iLimit])) {
$aVariantSelections = false;
if ($this->oxarticles__oxvarcount->value) {
$oVariants = $this->getVariants(false);
$aVariantSelections = oxNew(\OxidEsales\Eshop\Application\Model\VariantHandler::class)->buildVariantSelections(
$this->oxarticles__oxvarname->getRawValue(),
$oVariants,
$aFilterIds,
$sActVariantId,
$iLimit
);
if (!empty($oVariants) && empty($aVariantSelections['rawselections'])) {
$aVariantSelections = false;
}
}
$this->_aVariantSelections[$iLimit] = $aVariantSelections;
}
return $this->_aVariantSelections[$iLimit];
} | [
"public",
"function",
"getVariantSelections",
"(",
"$",
"aFilterIds",
"=",
"null",
",",
"$",
"sActVariantId",
"=",
"null",
",",
"$",
"iLimit",
"=",
"0",
")",
"{",
"$",
"iLimit",
"=",
"(",
"int",
")",
"$",
"iLimit",
";",
"if",
"(",
"!",
"isset",
"(",
... | Returns variants selections lists array
@param array $aFilterIds ids of active selections [optional]
@param string $sActVariantId active variant id [optional]
@param int $iLimit limit variant lists count (if non zero, return limited number of multidimensional variant selections)
@return array | [
"Returns",
"variants",
"selections",
"lists",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1537-L1560 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getCategory | public function getCategory()
{
$oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
$oCategory->setLanguage($this->getLanguage());
// variant handling
$sOXID = $this->getId();
if (isset($this->oxarticles__oxparentid->value) && $this->oxarticles__oxparentid->value) {
$sOXID = $this->oxarticles__oxparentid->value;
}
if ($sOXID) {
// if the oxcategory instance of this article is not cached
if (!isset($this->_aCategoryCache[$sOXID])) {
startPRofile('getCategory');
$oStr = getStr();
$sWhere = $oCategory->getSqlActiveSnippet();
$sSelect = $this->_generateSearchStr($sOXID);
$sSelect .= ($oStr->strstr(
$sSelect,
'where'
) ? ' and ' : ' where ') . $sWhere . " order by oxobject2category.oxtime limit 1";
// category not found ?
if (!$oCategory->assignRecord($sSelect)) {
$sSelect = $this->_generateSearchStr($sOXID, true);
$sSelect .= ($oStr->strstr($sSelect, 'where') ? ' and ' : ' where ') . $sWhere . " limit 1";
// looking for price category
if (!$oCategory->assignRecord($sSelect)) {
$oCategory = null;
}
}
// add the category instance to cache
$this->_aCategoryCache[$sOXID] = $oCategory;
stopPRofile('getCategory');
} else {
// if the oxcategory instance is cached
$oCategory = $this->_aCategoryCache[$sOXID];
}
}
return $oCategory;
} | php | public function getCategory()
{
$oCategory = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
$oCategory->setLanguage($this->getLanguage());
// variant handling
$sOXID = $this->getId();
if (isset($this->oxarticles__oxparentid->value) && $this->oxarticles__oxparentid->value) {
$sOXID = $this->oxarticles__oxparentid->value;
}
if ($sOXID) {
// if the oxcategory instance of this article is not cached
if (!isset($this->_aCategoryCache[$sOXID])) {
startPRofile('getCategory');
$oStr = getStr();
$sWhere = $oCategory->getSqlActiveSnippet();
$sSelect = $this->_generateSearchStr($sOXID);
$sSelect .= ($oStr->strstr(
$sSelect,
'where'
) ? ' and ' : ' where ') . $sWhere . " order by oxobject2category.oxtime limit 1";
// category not found ?
if (!$oCategory->assignRecord($sSelect)) {
$sSelect = $this->_generateSearchStr($sOXID, true);
$sSelect .= ($oStr->strstr($sSelect, 'where') ? ' and ' : ' where ') . $sWhere . " limit 1";
// looking for price category
if (!$oCategory->assignRecord($sSelect)) {
$oCategory = null;
}
}
// add the category instance to cache
$this->_aCategoryCache[$sOXID] = $oCategory;
stopPRofile('getCategory');
} else {
// if the oxcategory instance is cached
$oCategory = $this->_aCategoryCache[$sOXID];
}
}
return $oCategory;
} | [
"public",
"function",
"getCategory",
"(",
")",
"{",
"$",
"oCategory",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Category",
"::",
"class",
")",
";",
"$",
"oCategory",
"->",
"setLanguage",
"(",
"$",
"t... | Loads and returns article category object. First tries to load
assigned category and is such category does not exist, tries to
load category by price
@return oxCategory | [
"Loads",
"and",
"returns",
"article",
"category",
"object",
".",
"First",
"tries",
"to",
"load",
"assigned",
"category",
"and",
"is",
"such",
"category",
"does",
"not",
"exist",
"tries",
"to",
"load",
"category",
"by",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1700-L1743 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getCategoryIds | public function getCategoryIds($blActCats = false, $blSkipCache = false)
{
$sArticleId = $this->getId();
if (!isset(self::$_aArticleCats[$sArticleId]) || $blSkipCache) {
$sSql = $this->_getCategoryIdsSelect($blActCats);
$aCategoryIds = $this->_selectCategoryIds($sSql, 'oxcatnid');
$sSql = $this->getSqlForPriceCategories();
$aPriceCategoryIds = $this->_selectCategoryIds($sSql, 'oxid');
self::$_aArticleCats[$sArticleId] = array_unique(array_merge($aCategoryIds, $aPriceCategoryIds));
}
return self::$_aArticleCats[$sArticleId];
} | php | public function getCategoryIds($blActCats = false, $blSkipCache = false)
{
$sArticleId = $this->getId();
if (!isset(self::$_aArticleCats[$sArticleId]) || $blSkipCache) {
$sSql = $this->_getCategoryIdsSelect($blActCats);
$aCategoryIds = $this->_selectCategoryIds($sSql, 'oxcatnid');
$sSql = $this->getSqlForPriceCategories();
$aPriceCategoryIds = $this->_selectCategoryIds($sSql, 'oxid');
self::$_aArticleCats[$sArticleId] = array_unique(array_merge($aCategoryIds, $aPriceCategoryIds));
}
return self::$_aArticleCats[$sArticleId];
} | [
"public",
"function",
"getCategoryIds",
"(",
"$",
"blActCats",
"=",
"false",
",",
"$",
"blSkipCache",
"=",
"false",
")",
"{",
"$",
"sArticleId",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_aArtic... | Returns ID's of categories where this article is assigned
@param bool $blActCats select categories if all parents are active
@param bool $blSkipCache Whether to skip cache
@return array | [
"Returns",
"ID",
"s",
"of",
"categories",
"where",
"this",
"article",
"is",
"assigned"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1753-L1768 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getTPrice | public function getTPrice()
{
if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
return;
}
// return cached result, since oPrice is created ONLY in this function [or function of EQUAL level]
if ($this->_oTPrice !== null) {
return $this->_oTPrice;
}
$oPrice = $this->_getPriceObject();
$dBasePrice = $this->oxarticles__oxtprice->value;
$dBasePrice = $this->_preparePrice($dBasePrice, $this->getArticleVat());
$oPrice->setPrice($dBasePrice);
$this->_applyVat($oPrice, $this->getArticleVat());
$this->_applyCurrency($oPrice);
if ($this->isParentNotBuyable()) {
// if parent article is not buyable then compare agains min article variant price
$oPrice2 = $this->getVarMinPrice();
} else {
// else compare against article price
$oPrice2 = $this->getPrice();
}
if ($oPrice->getPrice() <= $oPrice2->getPrice()) {
// if RRP price is less or equal to comparable price then return
return;
}
$this->_oTPrice = $oPrice;
return $this->_oTPrice;
} | php | public function getTPrice()
{
if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
return;
}
// return cached result, since oPrice is created ONLY in this function [or function of EQUAL level]
if ($this->_oTPrice !== null) {
return $this->_oTPrice;
}
$oPrice = $this->_getPriceObject();
$dBasePrice = $this->oxarticles__oxtprice->value;
$dBasePrice = $this->_preparePrice($dBasePrice, $this->getArticleVat());
$oPrice->setPrice($dBasePrice);
$this->_applyVat($oPrice, $this->getArticleVat());
$this->_applyCurrency($oPrice);
if ($this->isParentNotBuyable()) {
// if parent article is not buyable then compare agains min article variant price
$oPrice2 = $this->getVarMinPrice();
} else {
// else compare against article price
$oPrice2 = $this->getPrice();
}
if ($oPrice->getPrice() <= $oPrice2->getPrice()) {
// if RRP price is less or equal to comparable price then return
return;
}
$this->_oTPrice = $oPrice;
return $this->_oTPrice;
} | [
"public",
"function",
"getTPrice",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'bl_perfLoadPrice'",
")",
"||",
"!",
"$",
"this",
"->",
"_blLo... | Returns T price
@return \OxidEsales\Eshop\Core\Price | [
"Returns",
"T",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1920-L1957 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.skipDiscounts | public function skipDiscounts()
{
// already loaded skip discounts config
if ($this->_blSkipDiscounts !== null) {
return $this->_blSkipDiscounts;
}
if ($this->oxarticles__oxskipdiscounts->value) {
return true;
}
$this->_blSkipDiscounts = false;
if (\OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DiscountList::class)->hasSkipDiscountCategories()) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sO2CView = getViewName('oxobject2category', $this->getLanguage());
$sViewName = getViewName('oxcategories', $this->getLanguage());
$sSelect = "select 1 from $sO2CView as $sO2CView left join {$sViewName} on {$sViewName}.oxid = $sO2CView.oxcatnid
where $sO2CView.oxobjectid=" . $oDb->quote($this->getId()) . " and {$sViewName}.oxactive = 1 and {$sViewName}.oxskipdiscounts = '1' ";
$this->_blSkipDiscounts = ($oDb->getOne($sSelect) == 1);
}
return $this->_blSkipDiscounts;
} | php | public function skipDiscounts()
{
// already loaded skip discounts config
if ($this->_blSkipDiscounts !== null) {
return $this->_blSkipDiscounts;
}
if ($this->oxarticles__oxskipdiscounts->value) {
return true;
}
$this->_blSkipDiscounts = false;
if (\OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DiscountList::class)->hasSkipDiscountCategories()) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sO2CView = getViewName('oxobject2category', $this->getLanguage());
$sViewName = getViewName('oxcategories', $this->getLanguage());
$sSelect = "select 1 from $sO2CView as $sO2CView left join {$sViewName} on {$sViewName}.oxid = $sO2CView.oxcatnid
where $sO2CView.oxobjectid=" . $oDb->quote($this->getId()) . " and {$sViewName}.oxactive = 1 and {$sViewName}.oxskipdiscounts = '1' ";
$this->_blSkipDiscounts = ($oDb->getOne($sSelect) == 1);
}
return $this->_blSkipDiscounts;
} | [
"public",
"function",
"skipDiscounts",
"(",
")",
"{",
"// already loaded skip discounts config",
"if",
"(",
"$",
"this",
"->",
"_blSkipDiscounts",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"_blSkipDiscounts",
";",
"}",
"if",
"(",
"$",
"this",
"->",... | Checks if discount should be skipped for this article in basket. Returns true if yes.
@return bool | [
"Checks",
"if",
"discount",
"should",
"be",
"skipped",
"for",
"this",
"article",
"in",
"basket",
".",
"Returns",
"true",
"if",
"yes",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L1964-L1987 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getBasketPrice | public function getBasketPrice($dAmount, $aSelList, $oBasket)
{
$oUser = $oBasket->getBasketUser();
$this->setArticleUser($oUser);
$oBasketPrice = $this->_getPriceObject($oBasket->isCalculationModeNetto());
// get base price
$dBasePrice = $this->getBasePrice($dAmount);
$dBasePrice = $this->_modifySelectListPrice($dBasePrice, $aSelList);
$dBasePrice = $this->_preparePrice($dBasePrice, $this->getArticleVat(), $oBasket->isCalculationModeNetto());
// applying select list price
// setting price
$oBasketPrice->setPrice($dBasePrice);
$dVat = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\VatSelector::class)->getBasketItemVat($this, $oBasket);
$this->_calculatePrice($oBasketPrice, $dVat);
// returning final price object
return $oBasketPrice;
} | php | public function getBasketPrice($dAmount, $aSelList, $oBasket)
{
$oUser = $oBasket->getBasketUser();
$this->setArticleUser($oUser);
$oBasketPrice = $this->_getPriceObject($oBasket->isCalculationModeNetto());
// get base price
$dBasePrice = $this->getBasePrice($dAmount);
$dBasePrice = $this->_modifySelectListPrice($dBasePrice, $aSelList);
$dBasePrice = $this->_preparePrice($dBasePrice, $this->getArticleVat(), $oBasket->isCalculationModeNetto());
// applying select list price
// setting price
$oBasketPrice->setPrice($dBasePrice);
$dVat = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\VatSelector::class)->getBasketItemVat($this, $oBasket);
$this->_calculatePrice($oBasketPrice, $dVat);
// returning final price object
return $oBasketPrice;
} | [
"public",
"function",
"getBasketPrice",
"(",
"$",
"dAmount",
",",
"$",
"aSelList",
",",
"$",
"oBasket",
")",
"{",
"$",
"oUser",
"=",
"$",
"oBasket",
"->",
"getBasketUser",
"(",
")",
";",
"$",
"this",
"->",
"setArticleUser",
"(",
"$",
"oUser",
")",
";",... | Creates, calculates and returns oxPrice object for basket product.
@param float $dAmount Amount
@param array $aSelList Selection list
@param object $oBasket User shopping basket object
@return \OxidEsales\Eshop\Core\Price | [
"Creates",
"calculates",
"and",
"returns",
"oxPrice",
"object",
"for",
"basket",
"product",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2108-L2131 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.delete | public function delete($sOXID = null)
{
if (!$sOXID) {
$sOXID = $this->getId();
}
if (!$sOXID) {
return false;
}
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$database->startTransaction();
try {
// #2339 delete first variants before deleting parent product
$this->_deleteVariantRecords($sOXID);
$this->load($sOXID);
$this->_deletePics();
$this->_onChangeResetCounts($sOXID, $this->oxarticles__oxvendorid->value, $this->oxarticles__oxmanufacturerid->value);
// delete self
$deleted = parent::delete($sOXID);
$this->_deleteRecords($sOXID);
Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderArticle::class)->onDeleteArticle($this);
$this->onChange(ACTION_DELETE, $sOXID, $this->oxarticles__oxparentid->value);
$database->commitTransaction();
} catch (Exception $exception) {
$database->rollbackTransaction();
throw $exception;
}
return $deleted;
} | php | public function delete($sOXID = null)
{
if (!$sOXID) {
$sOXID = $this->getId();
}
if (!$sOXID) {
return false;
}
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$database->startTransaction();
try {
// #2339 delete first variants before deleting parent product
$this->_deleteVariantRecords($sOXID);
$this->load($sOXID);
$this->_deletePics();
$this->_onChangeResetCounts($sOXID, $this->oxarticles__oxvendorid->value, $this->oxarticles__oxmanufacturerid->value);
// delete self
$deleted = parent::delete($sOXID);
$this->_deleteRecords($sOXID);
Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderArticle::class)->onDeleteArticle($this);
$this->onChange(ACTION_DELETE, $sOXID, $this->oxarticles__oxparentid->value);
$database->commitTransaction();
} catch (Exception $exception) {
$database->rollbackTransaction();
throw $exception;
}
return $deleted;
} | [
"public",
"function",
"delete",
"(",
"$",
"sOXID",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"sOXID",
")",
"{",
"$",
"sOXID",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"sOXID",
")",
"{",
"return",
"false",
";... | Deletes record and other information related to this article such as images from DB,
also removes variants. Returns true if entry was deleted.
@param string $sOXID Article id
@throws \Exception
@return bool | [
"Deletes",
"record",
"and",
"other",
"information",
"related",
"to",
"this",
"article",
"such",
"as",
"images",
"from",
"DB",
"also",
"removes",
"variants",
".",
"Returns",
"true",
"if",
"entry",
"was",
"deleted",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2143-L2178 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.reduceStock | public function reduceStock($dAmount, $blAllowNegativeStock = false)
{
$this->actionType = ACTION_UPDATE_STOCK;
$this->beforeUpdate();
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = 'select oxstock from oxarticles where oxid = ' . $database->quote($this->getId()) . ' FOR UPDATE ';
$actualStock = $database->getOne($query);
$iStockCount = $actualStock - $dAmount;
if (!$blAllowNegativeStock && ($iStockCount < 0)) {
$dAmount += $iStockCount;
$iStockCount = 0;
}
$this->oxarticles__oxstock = new \OxidEsales\Eshop\Core\Field($iStockCount);
$query = 'update oxarticles set oxarticles.oxstock = ' . $database->quote($iStockCount) .
' where oxarticles.oxid = ' . $database->quote($this->getId());
$database->execute($query);
$this->onChange(ACTION_UPDATE_STOCK);
return $dAmount;
} | php | public function reduceStock($dAmount, $blAllowNegativeStock = false)
{
$this->actionType = ACTION_UPDATE_STOCK;
$this->beforeUpdate();
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$query = 'select oxstock from oxarticles where oxid = ' . $database->quote($this->getId()) . ' FOR UPDATE ';
$actualStock = $database->getOne($query);
$iStockCount = $actualStock - $dAmount;
if (!$blAllowNegativeStock && ($iStockCount < 0)) {
$dAmount += $iStockCount;
$iStockCount = 0;
}
$this->oxarticles__oxstock = new \OxidEsales\Eshop\Core\Field($iStockCount);
$query = 'update oxarticles set oxarticles.oxstock = ' . $database->quote($iStockCount) .
' where oxarticles.oxid = ' . $database->quote($this->getId());
$database->execute($query);
$this->onChange(ACTION_UPDATE_STOCK);
return $dAmount;
} | [
"public",
"function",
"reduceStock",
"(",
"$",
"dAmount",
",",
"$",
"blAllowNegativeStock",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"actionType",
"=",
"ACTION_UPDATE_STOCK",
";",
"$",
"this",
"->",
"beforeUpdate",
"(",
")",
";",
"$",
"database",
"=",
"\... | Reduce article stock. return the affected amount
@param float $dAmount amount to reduce
@param bool $blAllowNegativeStock are negative stocks allowed?
@return float | [
"Reduce",
"article",
"stock",
".",
"return",
"the",
"affected",
"amount"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2188-L2210 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.updateSoldAmount | public function updateSoldAmount($dAmount = 0)
{
if (!$dAmount) {
return;
}
// article is not variant - should be updated current amount
if (!$this->oxarticles__oxparentid->value) {
//updating by SQL query, due to wrong behaviour if saving article using not admin mode
$dAmount = (double) $dAmount;
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$rs = $oDb->execute("update oxarticles set oxarticles.oxsoldamount = oxarticles.oxsoldamount + $dAmount where oxarticles.oxid = " . $oDb->quote($this->oxarticles__oxid->value));
} elseif ($this->oxarticles__oxparentid->value) {
// article is variant - should be updated this article parent amount
$oUpdateArticle = $this->getParentArticle();
if ($oUpdateArticle) {
$oUpdateArticle->updateSoldAmount($dAmount);
}
}
return (bool) $rs;
} | php | public function updateSoldAmount($dAmount = 0)
{
if (!$dAmount) {
return;
}
// article is not variant - should be updated current amount
if (!$this->oxarticles__oxparentid->value) {
//updating by SQL query, due to wrong behaviour if saving article using not admin mode
$dAmount = (double) $dAmount;
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$rs = $oDb->execute("update oxarticles set oxarticles.oxsoldamount = oxarticles.oxsoldamount + $dAmount where oxarticles.oxid = " . $oDb->quote($this->oxarticles__oxid->value));
} elseif ($this->oxarticles__oxparentid->value) {
// article is variant - should be updated this article parent amount
$oUpdateArticle = $this->getParentArticle();
if ($oUpdateArticle) {
$oUpdateArticle->updateSoldAmount($dAmount);
}
}
return (bool) $rs;
} | [
"public",
"function",
"updateSoldAmount",
"(",
"$",
"dAmount",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"dAmount",
")",
"{",
"return",
";",
"}",
"// article is not variant - should be updated current amount",
"if",
"(",
"!",
"$",
"this",
"->",
"oxarticles__oxpar... | Recursive function. Updates quantity of sold articles.
Return true if amount was changed in database.
@param float $dAmount Number of articles sold
@return mixed | [
"Recursive",
"function",
".",
"Updates",
"quantity",
"of",
"sold",
"articles",
".",
"Return",
"true",
"if",
"amount",
"was",
"changed",
"in",
"database",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2220-L2241 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.disableReminder | public function disableReminder()
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
return (bool) $oDb->execute("update oxarticles set oxarticles.oxremindactive = 2 where oxarticles.oxid = " . $oDb->quote($this->oxarticles__oxid->value));
} | php | public function disableReminder()
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
return (bool) $oDb->execute("update oxarticles set oxarticles.oxremindactive = 2 where oxarticles.oxid = " . $oDb->quote($this->oxarticles__oxid->value));
} | [
"public",
"function",
"disableReminder",
"(",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"return",
"(",
"bool",
")",
"$",
"oDb",
"->",
"execute",
"(",
"\"update oxar... | Disables reminder functionality for article
@return bool | [
"Disables",
"reminder",
"functionality",
"for",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2248-L2253 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.resetParent | public function resetParent()
{
$sParentId = $this->oxarticles__oxparentid->value;
$this->oxarticles__oxparentid = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_blAllowEmptyParentId = true;
$this->save();
$this->_blAllowEmptyParentId = false;
if ($sParentId !== '') {
$this->onChange(ACTION_UPDATE, null, $sParentId);
}
} | php | public function resetParent()
{
$sParentId = $this->oxarticles__oxparentid->value;
$this->oxarticles__oxparentid = new \OxidEsales\Eshop\Core\Field('', \OxidEsales\Eshop\Core\Field::T_RAW);
$this->_blAllowEmptyParentId = true;
$this->save();
$this->_blAllowEmptyParentId = false;
if ($sParentId !== '') {
$this->onChange(ACTION_UPDATE, null, $sParentId);
}
} | [
"public",
"function",
"resetParent",
"(",
")",
"{",
"$",
"sParentId",
"=",
"$",
"this",
"->",
"oxarticles__oxparentid",
"->",
"value",
";",
"$",
"this",
"->",
"oxarticles__oxparentid",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field... | Changes article variant to parent article | [
"Changes",
"article",
"variant",
"to",
"parent",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2273-L2284 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getLongDescription | public function getLongDescription()
{
if ($this->_oLongDesc === null) {
// initializing
$this->_oLongDesc = new \OxidEsales\Eshop\Core\Field();
// choosing which to get..
$sOxid = $this->getId();
$sViewName = getViewName('oxartextends', $this->getLanguage());
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sDbValue = $oDb->getOne("select oxlongdesc from {$sViewName} where oxid = " . $oDb->quote($sOxid));
if ($sDbValue != false) {
$this->_oLongDesc->setValue($sDbValue, \OxidEsales\Eshop\Core\Field::T_RAW);
} elseif ($this->oxarticles__oxparentid && $this->oxarticles__oxparentid->value) {
if (!$this->isAdmin() || $this->_blLoadParentData) {
$oParent = $this->getParentArticle();
if ($oParent) {
$this->_oLongDesc->setValue($oParent->getLongDescription()->getRawValue(), \OxidEsales\Eshop\Core\Field::T_RAW);
}
}
}
}
return $this->_oLongDesc;
} | php | public function getLongDescription()
{
if ($this->_oLongDesc === null) {
// initializing
$this->_oLongDesc = new \OxidEsales\Eshop\Core\Field();
// choosing which to get..
$sOxid = $this->getId();
$sViewName = getViewName('oxartextends', $this->getLanguage());
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sDbValue = $oDb->getOne("select oxlongdesc from {$sViewName} where oxid = " . $oDb->quote($sOxid));
if ($sDbValue != false) {
$this->_oLongDesc->setValue($sDbValue, \OxidEsales\Eshop\Core\Field::T_RAW);
} elseif ($this->oxarticles__oxparentid && $this->oxarticles__oxparentid->value) {
if (!$this->isAdmin() || $this->_blLoadParentData) {
$oParent = $this->getParentArticle();
if ($oParent) {
$this->_oLongDesc->setValue($oParent->getLongDescription()->getRawValue(), \OxidEsales\Eshop\Core\Field::T_RAW);
}
}
}
}
return $this->_oLongDesc;
} | [
"public",
"function",
"getLongDescription",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oLongDesc",
"===",
"null",
")",
"{",
"// initializing",
"$",
"this",
"->",
"_oLongDesc",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
... | Get article long description
@return object $oField field object | [
"Get",
"article",
"long",
"description"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2516-L2542 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.setArticleLongDesc | public function setArticleLongDesc($longDescription)
{
// setting current value
$this->_oLongDesc = new \OxidEsales\Eshop\Core\Field($longDescription, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->oxarticles__oxlongdesc = new \OxidEsales\Eshop\Core\Field($longDescription, \OxidEsales\Eshop\Core\Field::T_RAW);
} | php | public function setArticleLongDesc($longDescription)
{
// setting current value
$this->_oLongDesc = new \OxidEsales\Eshop\Core\Field($longDescription, \OxidEsales\Eshop\Core\Field::T_RAW);
$this->oxarticles__oxlongdesc = new \OxidEsales\Eshop\Core\Field($longDescription, \OxidEsales\Eshop\Core\Field::T_RAW);
} | [
"public",
"function",
"setArticleLongDesc",
"(",
"$",
"longDescription",
")",
"{",
"// setting current value",
"$",
"this",
"->",
"_oLongDesc",
"=",
"new",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Field",
"(",
"$",
"longDescription",
",",
"\\",
... | Save article long description to oxartext table
@param string $longDescription description to set | [
"Save",
"article",
"long",
"description",
"to",
"oxartext",
"table"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2560-L2565 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getAttributes | public function getAttributes()
{
if ($this->_oAttributeList === null) {
$this->_oAttributeList = $this->newAttributelist();
$this->_oAttributeList->loadAttributes($this->getId(), $this->getParentId());
}
return $this->_oAttributeList;
} | php | public function getAttributes()
{
if ($this->_oAttributeList === null) {
$this->_oAttributeList = $this->newAttributelist();
$this->_oAttributeList->loadAttributes($this->getId(), $this->getParentId());
}
return $this->_oAttributeList;
} | [
"public",
"function",
"getAttributes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oAttributeList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oAttributeList",
"=",
"$",
"this",
"->",
"newAttributelist",
"(",
")",
";",
"$",
"this",
"->",
"_oAttribu... | Loads and returns attribute list associated with this article
@return \OxidEsales\Eshop\Application\Model\AttributeList | [
"Loads",
"and",
"returns",
"attribute",
"list",
"associated",
"with",
"this",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2582-L2590 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getAttributesDisplayableInBasket | public function getAttributesDisplayableInBasket()
{
if ($this->basketAttributeList === null) {
$this->basketAttributeList = $this->newAttributelist();
$this->basketAttributeList->loadAttributesDisplayableInBasket($this->getId(), $this->getParentId());
}
return $this->basketAttributeList;
} | php | public function getAttributesDisplayableInBasket()
{
if ($this->basketAttributeList === null) {
$this->basketAttributeList = $this->newAttributelist();
$this->basketAttributeList->loadAttributesDisplayableInBasket($this->getId(), $this->getParentId());
}
return $this->basketAttributeList;
} | [
"public",
"function",
"getAttributesDisplayableInBasket",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"basketAttributeList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"basketAttributeList",
"=",
"$",
"this",
"->",
"newAttributelist",
"(",
")",
";",
"$",
"... | Loads and returns attribute list for display in basket
@return \OxidEsales\Eshop\Application\Model\AttributeList | [
"Loads",
"and",
"returns",
"attribute",
"list",
"for",
"display",
"in",
"basket"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2597-L2605 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.appendLink | public function appendLink($sAddParams, $iLang = null)
{
if ($sAddParams) {
if ($iLang === null) {
$iLang = $this->getLanguage();
}
$this->_aSeoAddParams[$iLang] = isset($this->_aSeoAddParams[$iLang]) ? $this->_aSeoAddParams[$iLang] . "&" : "";
$this->_aSeoAddParams[$iLang] .= $sAddParams;
}
} | php | public function appendLink($sAddParams, $iLang = null)
{
if ($sAddParams) {
if ($iLang === null) {
$iLang = $this->getLanguage();
}
$this->_aSeoAddParams[$iLang] = isset($this->_aSeoAddParams[$iLang]) ? $this->_aSeoAddParams[$iLang] . "&" : "";
$this->_aSeoAddParams[$iLang] .= $sAddParams;
}
} | [
"public",
"function",
"appendLink",
"(",
"$",
"sAddParams",
",",
"$",
"iLang",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"sAddParams",
")",
"{",
"if",
"(",
"$",
"iLang",
"===",
"null",
")",
"{",
"$",
"iLang",
"=",
"$",
"this",
"->",
"getLanguage",
"("... | Appends article seo url with additional request parameters
@param string $sAddParams additional parameters which needs to be added to product url
@param int $iLang language id | [
"Appends",
"article",
"seo",
"url",
"with",
"additional",
"request",
"parameters"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2614-L2624 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getBaseSeoLink | public function getBaseSeoLink($iLang, $blMain = false)
{
/** @var \OxidEsales\Eshop\Application\Model\SeoEncoderArticle $oEncoder */
$oEncoder = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderArticle::class);
if (!$blMain) {
return $oEncoder->getArticleUrl($this, $iLang, $this->getLinkType());
}
return $oEncoder->getArticleMainUrl($this, $iLang);
} | php | public function getBaseSeoLink($iLang, $blMain = false)
{
/** @var \OxidEsales\Eshop\Application\Model\SeoEncoderArticle $oEncoder */
$oEncoder = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderArticle::class);
if (!$blMain) {
return $oEncoder->getArticleUrl($this, $iLang, $this->getLinkType());
}
return $oEncoder->getArticleMainUrl($this, $iLang);
} | [
"public",
"function",
"getBaseSeoLink",
"(",
"$",
"iLang",
",",
"$",
"blMain",
"=",
"false",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Application\\Model\\SeoEncoderArticle $oEncoder */",
"$",
"oEncoder",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Reg... | Returns raw article seo url
@param int $iLang language id
@param bool $blMain force to return main url [optional]
@return string | [
"Returns",
"raw",
"article",
"seo",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2634-L2643 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.appendStdLink | public function appendStdLink($sAddParams, $iLang = null)
{
if ($sAddParams) {
if ($iLang === null) {
$iLang = $this->getLanguage();
}
$this->_aStdAddParams[$iLang] = isset($this->_aStdAddParams[$iLang]) ? $this->_aStdAddParams[$iLang] . "&" : "";
$this->_aStdAddParams[$iLang] .= $sAddParams;
}
} | php | public function appendStdLink($sAddParams, $iLang = null)
{
if ($sAddParams) {
if ($iLang === null) {
$iLang = $this->getLanguage();
}
$this->_aStdAddParams[$iLang] = isset($this->_aStdAddParams[$iLang]) ? $this->_aStdAddParams[$iLang] . "&" : "";
$this->_aStdAddParams[$iLang] .= $sAddParams;
}
} | [
"public",
"function",
"appendStdLink",
"(",
"$",
"sAddParams",
",",
"$",
"iLang",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"sAddParams",
")",
"{",
"if",
"(",
"$",
"iLang",
"===",
"null",
")",
"{",
"$",
"iLang",
"=",
"$",
"this",
"->",
"getLanguage",
... | Appends article dynamic url with additional request parameters
@param string $sAddParams additional parameters which needs to be added to product url
@param int $iLang language id | [
"Appends",
"article",
"dynamic",
"url",
"with",
"additional",
"request",
"parameters"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2719-L2729 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getStdLink | public function getStdLink($iLang = null, $aParams = [])
{
if ($iLang === null) {
$iLang = $this->getLanguage();
}
if (!isset($this->_aStdUrls[$iLang])) {
$this->_aStdUrls[$iLang] = $this->getBaseStdLink($iLang);
}
return \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($this->_aStdUrls[$iLang], true, $aParams, $iLang);
} | php | public function getStdLink($iLang = null, $aParams = [])
{
if ($iLang === null) {
$iLang = $this->getLanguage();
}
if (!isset($this->_aStdUrls[$iLang])) {
$this->_aStdUrls[$iLang] = $this->getBaseStdLink($iLang);
}
return \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($this->_aStdUrls[$iLang], true, $aParams, $iLang);
} | [
"public",
"function",
"getStdLink",
"(",
"$",
"iLang",
"=",
"null",
",",
"$",
"aParams",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"iLang",
"===",
"null",
")",
"{",
"$",
"iLang",
"=",
"$",
"this",
"->",
"getLanguage",
"(",
")",
";",
"}",
"if",
"... | Returns standard URL to product
@param int $iLang required language. optional
@param array $aParams additional params to use [optional]
@return string | [
"Returns",
"standard",
"URL",
"to",
"product"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2761-L2772 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getMediaUrls | public function getMediaUrls()
{
if ($this->_aMediaUrls === null) {
$this->_aMediaUrls = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$this->_aMediaUrls->init("oxmediaurl");
$this->_aMediaUrls->getBaseObject()->setLanguage($this->getLanguage());
$sViewName = getViewName("oxmediaurls", $this->getLanguage());
$sQ = "select * from {$sViewName} where oxobjectid = '" . $this->getId() . "'";
$this->_aMediaUrls->selectString($sQ);
}
return $this->_aMediaUrls;
} | php | public function getMediaUrls()
{
if ($this->_aMediaUrls === null) {
$this->_aMediaUrls = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$this->_aMediaUrls->init("oxmediaurl");
$this->_aMediaUrls->getBaseObject()->setLanguage($this->getLanguage());
$sViewName = getViewName("oxmediaurls", $this->getLanguage());
$sQ = "select * from {$sViewName} where oxobjectid = '" . $this->getId() . "'";
$this->_aMediaUrls->selectString($sQ);
}
return $this->_aMediaUrls;
} | [
"public",
"function",
"getMediaUrls",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aMediaUrls",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_aMediaUrls",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Model",
"\\",
"ListM... | Return article media URL
@return array | [
"Return",
"article",
"media",
"URL"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2779-L2792 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getDispSelList | public function getDispSelList()
{
if ($this->_aDispSelList === null) {
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadSelectLists') && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadSelectListsInAList')) {
$this->_aDispSelList = $this->getSelectLists();
}
}
return $this->_aDispSelList;
} | php | public function getDispSelList()
{
if ($this->_aDispSelList === null) {
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadSelectLists') && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadSelectListsInAList')) {
$this->_aDispSelList = $this->getSelectLists();
}
}
return $this->_aDispSelList;
} | [
"public",
"function",
"getDispSelList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_aDispSelList",
"===",
"null",
")",
"{",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigPara... | Returns select lists to display
@return array | [
"Returns",
"select",
"lists",
"to",
"display"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2809-L2818 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getMoreDetailLink | public function getMoreDetailLink()
{
if ($this->_sMoreDetailLink == null) {
// and assign special article values
$this->_sMoreDetailLink = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl() . 'cl=moredetails';
// not always it is okey, as not all the time active category is the same as primary article cat.
if ($sActCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid')) {
$this->_sMoreDetailLink .= '&cnid=' . $sActCat;
}
$this->_sMoreDetailLink .= '&anid=' . $this->getId();
}
return $this->_sMoreDetailLink;
} | php | public function getMoreDetailLink()
{
if ($this->_sMoreDetailLink == null) {
// and assign special article values
$this->_sMoreDetailLink = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl() . 'cl=moredetails';
// not always it is okey, as not all the time active category is the same as primary article cat.
if ($sActCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid')) {
$this->_sMoreDetailLink .= '&cnid=' . $sActCat;
}
$this->_sMoreDetailLink .= '&anid=' . $this->getId();
}
return $this->_sMoreDetailLink;
} | [
"public",
"function",
"getMoreDetailLink",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sMoreDetailLink",
"==",
"null",
")",
"{",
"// and assign special article values",
"$",
"this",
"->",
"_sMoreDetailLink",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core... | Get more details link
@return string | [
"Get",
"more",
"details",
"link"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2825-L2839 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getToBasketLink | public function getToBasketLink()
{
if ($this->_sToBasketLink == null) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine()) {
$this->_sToBasketLink = $this->getLink();
} else {
// and assign special article values
$this->_sToBasketLink = $myConfig->getShopHomeUrl();
// override some classes as these should never showup
$actControllerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestControllerId();
if ($actControllerId == 'thankyou') {
$actControllerId = 'basket';
}
$this->_sToBasketLink .= 'cl=' . $actControllerId;
// this is not very correct
if ($sActCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid')) {
$this->_sToBasketLink .= '&cnid=' . $sActCat;
}
$this->_sToBasketLink .= '&fnc=tobasket&aid=' . $this->getId() . '&anid=' . $this->getId();
if ($sTpl = basename(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('tpl'))) {
$this->_sToBasketLink .= '&tpl=' . $sTpl;
}
}
}
return $this->_sToBasketLink;
} | php | public function getToBasketLink()
{
if ($this->_sToBasketLink == null) {
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
if (\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine()) {
$this->_sToBasketLink = $this->getLink();
} else {
// and assign special article values
$this->_sToBasketLink = $myConfig->getShopHomeUrl();
// override some classes as these should never showup
$actControllerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestControllerId();
if ($actControllerId == 'thankyou') {
$actControllerId = 'basket';
}
$this->_sToBasketLink .= 'cl=' . $actControllerId;
// this is not very correct
if ($sActCat = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid')) {
$this->_sToBasketLink .= '&cnid=' . $sActCat;
}
$this->_sToBasketLink .= '&fnc=tobasket&aid=' . $this->getId() . '&anid=' . $this->getId();
if ($sTpl = basename(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('tpl'))) {
$this->_sToBasketLink .= '&tpl=' . $sTpl;
}
}
}
return $this->_sToBasketLink;
} | [
"public",
"function",
"getToBasketLink",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sToBasketLink",
"==",
"null",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"... | Get to basket link
@return string | [
"Get",
"to",
"basket",
"link"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2846-L2878 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getFTPrice | public function getFTPrice()
{
// module
if ($oPrice = $this->getTPrice()) {
if ($dPrice = $this->_getPriceForView($oPrice)) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
}
} | php | public function getFTPrice()
{
// module
if ($oPrice = $this->getTPrice()) {
if ($dPrice = $this->_getPriceForView($oPrice)) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
}
} | [
"public",
"function",
"getFTPrice",
"(",
")",
"{",
"// module",
"if",
"(",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getTPrice",
"(",
")",
")",
"{",
"if",
"(",
"$",
"dPrice",
"=",
"$",
"this",
"->",
"_getPriceForView",
"(",
"$",
"oPrice",
")",
")",
"... | Returns rounded T price.
@deprecated since v5.1 (2013-10-03); use getTPrice() and oxPrice modifier;
@return double | bool | [
"Returns",
"rounded",
"T",
"price",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2932-L2940 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getFPrice | public function getFPrice()
{
if ($oPrice = $this->getPrice()) {
$dPrice = $this->_getPriceForView($oPrice);
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
} | php | public function getFPrice()
{
if ($oPrice = $this->getPrice()) {
$dPrice = $this->_getPriceForView($oPrice);
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
}
} | [
"public",
"function",
"getFPrice",
"(",
")",
"{",
"if",
"(",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getPrice",
"(",
")",
")",
"{",
"$",
"dPrice",
"=",
"$",
"this",
"->",
"_getPriceForView",
"(",
"$",
"oPrice",
")",
";",
"return",
"\\",
"OxidEsales",... | Returns formatted product's price.
@deprecated since v5.1 (2013-10-04); use oxPrice smarty plugin for formatting in templates
@return double | [
"Returns",
"formatted",
"product",
"s",
"price",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2949-L2956 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.resetRemindStatus | public function resetRemindStatus()
{
if ($this->oxarticles__oxremindactive->value == 2 &&
$this->oxarticles__oxremindamount->value <= $this->oxarticles__oxstock->value
) {
$this->oxarticles__oxremindactive->value = 1;
}
} | php | public function resetRemindStatus()
{
if ($this->oxarticles__oxremindactive->value == 2 &&
$this->oxarticles__oxremindamount->value <= $this->oxarticles__oxstock->value
) {
$this->oxarticles__oxremindactive->value = 1;
}
} | [
"public",
"function",
"resetRemindStatus",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"oxarticles__oxremindactive",
"->",
"value",
"==",
"2",
"&&",
"$",
"this",
"->",
"oxarticles__oxremindamount",
"->",
"value",
"<=",
"$",
"this",
"->",
"oxarticles__oxstock",
... | Resets oxremindactive status.
If remindActive status is 2, reminder is already sent. | [
"Resets",
"oxremindactive",
"status",
".",
"If",
"remindActive",
"status",
"is",
"2",
"reminder",
"is",
"already",
"sent",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2962-L2969 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getFNetPrice | public function getFNetPrice()
{
if ($oPrice = $this->getPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getNettoPrice());
}
} | php | public function getFNetPrice()
{
if ($oPrice = $this->getPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getNettoPrice());
}
} | [
"public",
"function",
"getFNetPrice",
"(",
")",
"{",
"if",
"(",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getPrice",
"(",
")",
")",
"{",
"return",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
"->",
"form... | Returns formatted product's NETTO price.
@deprecated since v5.1 (2013-10-03); use getPrice() and oxPrice modifier;
@return double | [
"Returns",
"formatted",
"product",
"s",
"NETTO",
"price",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L2978-L2983 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getPictureUrl | public function getPictureUrl($iIndex = 1)
{
if ($iIndex) {
$sImgName = false;
if (!$this->_isFieldEmpty("oxarticles__oxpic" . $iIndex)) {
$sImgName = basename($this->{"oxarticles__oxpic$iIndex"}->value);
}
$sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aDetailImageSizes');
return \OxidEsales\Eshop\Core\Registry::getPictureHandler()
->getProductPicUrl("product/{$iIndex}/", $sImgName, $sSize, 'oxpic' . $iIndex);
}
} | php | public function getPictureUrl($iIndex = 1)
{
if ($iIndex) {
$sImgName = false;
if (!$this->_isFieldEmpty("oxarticles__oxpic" . $iIndex)) {
$sImgName = basename($this->{"oxarticles__oxpic$iIndex"}->value);
}
$sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aDetailImageSizes');
return \OxidEsales\Eshop\Core\Registry::getPictureHandler()
->getProductPicUrl("product/{$iIndex}/", $sImgName, $sSize, 'oxpic' . $iIndex);
}
} | [
"public",
"function",
"getPictureUrl",
"(",
"$",
"iIndex",
"=",
"1",
")",
"{",
"if",
"(",
"$",
"iIndex",
")",
"{",
"$",
"sImgName",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_isFieldEmpty",
"(",
"\"oxarticles__oxpic\"",
".",
"$",
"iIndex",... | Returns article picture
@param int $iIndex picture index
@return string | [
"Returns",
"article",
"picture"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3032-L3045 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getIconUrl | public function getIconUrl($iIndex = 0)
{
$sImgName = false;
$sDirname = "product/1/";
if ($iIndex && !$this->_isFieldEmpty("oxarticles__oxpic{$iIndex}")) {
$sImgName = basename($this->{"oxarticles__oxpic$iIndex"}->value);
$sDirname = "product/{$iIndex}/";
} elseif (!$this->_isFieldEmpty("oxarticles__oxicon")) {
$sImgName = basename($this->oxarticles__oxicon->value);
$sDirname = "product/icon/";
} elseif (!$this->_isFieldEmpty("oxarticles__oxpic1")) {
$sImgName = basename($this->oxarticles__oxpic1->value);
}
$sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sIconsize');
$sIconUrl = \OxidEsales\Eshop\Core\Registry::getPictureHandler()->getProductPicUrl($sDirname, $sImgName, $sSize, $iIndex);
return $sIconUrl;
} | php | public function getIconUrl($iIndex = 0)
{
$sImgName = false;
$sDirname = "product/1/";
if ($iIndex && !$this->_isFieldEmpty("oxarticles__oxpic{$iIndex}")) {
$sImgName = basename($this->{"oxarticles__oxpic$iIndex"}->value);
$sDirname = "product/{$iIndex}/";
} elseif (!$this->_isFieldEmpty("oxarticles__oxicon")) {
$sImgName = basename($this->oxarticles__oxicon->value);
$sDirname = "product/icon/";
} elseif (!$this->_isFieldEmpty("oxarticles__oxpic1")) {
$sImgName = basename($this->oxarticles__oxpic1->value);
}
$sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sIconsize');
$sIconUrl = \OxidEsales\Eshop\Core\Registry::getPictureHandler()->getProductPicUrl($sDirname, $sImgName, $sSize, $iIndex);
return $sIconUrl;
} | [
"public",
"function",
"getIconUrl",
"(",
"$",
"iIndex",
"=",
"0",
")",
"{",
"$",
"sImgName",
"=",
"false",
";",
"$",
"sDirname",
"=",
"\"product/1/\"",
";",
"if",
"(",
"$",
"iIndex",
"&&",
"!",
"$",
"this",
"->",
"_isFieldEmpty",
"(",
"\"oxarticles__oxpi... | Returns article icon picture url. If no index specified, will
return main icon url.
@param int $iIndex picture index
@return string | [
"Returns",
"article",
"icon",
"picture",
"url",
".",
"If",
"no",
"index",
"specified",
"will",
"return",
"main",
"icon",
"url",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3055-L3074 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getThumbnailUrl | public function getThumbnailUrl($bSsl = null)
{
$sImgName = false;
$sDirname = "product/1/";
if (!$this->_isFieldEmpty("oxarticles__oxthumb")) {
$sImgName = basename($this->oxarticles__oxthumb->value);
$sDirname = "product/thumb/";
} elseif (!$this->_isFieldEmpty("oxarticles__oxpic1")) {
$sImgName = basename($this->oxarticles__oxpic1->value);
}
$sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sThumbnailsize');
return \OxidEsales\Eshop\Core\Registry::getPictureHandler()->getProductPicUrl($sDirname, $sImgName, $sSize, 0, $bSsl);
} | php | public function getThumbnailUrl($bSsl = null)
{
$sImgName = false;
$sDirname = "product/1/";
if (!$this->_isFieldEmpty("oxarticles__oxthumb")) {
$sImgName = basename($this->oxarticles__oxthumb->value);
$sDirname = "product/thumb/";
} elseif (!$this->_isFieldEmpty("oxarticles__oxpic1")) {
$sImgName = basename($this->oxarticles__oxpic1->value);
}
$sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sThumbnailsize');
return \OxidEsales\Eshop\Core\Registry::getPictureHandler()->getProductPicUrl($sDirname, $sImgName, $sSize, 0, $bSsl);
} | [
"public",
"function",
"getThumbnailUrl",
"(",
"$",
"bSsl",
"=",
"null",
")",
"{",
"$",
"sImgName",
"=",
"false",
";",
"$",
"sDirname",
"=",
"\"product/1/\"",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_isFieldEmpty",
"(",
"\"oxarticles__oxthumb\"",
")",
")",... | Returns article thumbnail picture url
@param bool $bSsl to force SSL
@return string | [
"Returns",
"article",
"thumbnail",
"picture",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3083-L3097 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getZoomPictureUrl | public function getZoomPictureUrl($iIndex = '')
{
$iIndex = (int) $iIndex;
if ($iIndex > 0 && !$this->_isFieldEmpty("oxarticles__oxpic" . $iIndex)) {
$sImgName = basename($this->{"oxarticles__oxpic" . $iIndex}->value);
$sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("sZoomImageSize");
return \OxidEsales\Eshop\Core\Registry::getPictureHandler()->getProductPicUrl(
"product/{$iIndex}/",
$sImgName,
$sSize,
'oxpic' . $iIndex
);
}
} | php | public function getZoomPictureUrl($iIndex = '')
{
$iIndex = (int) $iIndex;
if ($iIndex > 0 && !$this->_isFieldEmpty("oxarticles__oxpic" . $iIndex)) {
$sImgName = basename($this->{"oxarticles__oxpic" . $iIndex}->value);
$sSize = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("sZoomImageSize");
return \OxidEsales\Eshop\Core\Registry::getPictureHandler()->getProductPicUrl(
"product/{$iIndex}/",
$sImgName,
$sSize,
'oxpic' . $iIndex
);
}
} | [
"public",
"function",
"getZoomPictureUrl",
"(",
"$",
"iIndex",
"=",
"''",
")",
"{",
"$",
"iIndex",
"=",
"(",
"int",
")",
"$",
"iIndex",
";",
"if",
"(",
"$",
"iIndex",
">",
"0",
"&&",
"!",
"$",
"this",
"->",
"_isFieldEmpty",
"(",
"\"oxarticles__oxpic\""... | Returns article zoom picture url
@param int $iIndex picture index
@return string | [
"Returns",
"article",
"zoom",
"picture",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3106-L3120 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.applyVats | public function applyVats(\OxidEsales\Eshop\Core\Price $oPrice)
{
$this->_applyVAT($oPrice, $this->getArticleVat());
} | php | public function applyVats(\OxidEsales\Eshop\Core\Price $oPrice)
{
$this->_applyVAT($oPrice, $this->getArticleVat());
} | [
"public",
"function",
"applyVats",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Price",
"$",
"oPrice",
")",
"{",
"$",
"this",
"->",
"_applyVAT",
"(",
"$",
"oPrice",
",",
"$",
"this",
"->",
"getArticleVat",
"(",
")",
")",
";",
"}"
] | apply article and article use
@param \OxidEsales\Eshop\Core\Price $oPrice target price | [
"apply",
"article",
"and",
"article",
"use"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3127-L3130 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getParentArticle | public function getParentArticle()
{
if ($this->oxarticles__oxparentid && ($sParentId = $this->oxarticles__oxparentid->value)) {
$sIndex = $sParentId . "_" . $this->getLanguage();
if (!isset(self::$_aLoadedParents[$sIndex])) {
self::$_aLoadedParents[$sIndex] = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
self::$_aLoadedParents[$sIndex]->_blLoadPrice = false;
self::$_aLoadedParents[$sIndex]->_blLoadVariants = false;
if (!self::$_aLoadedParents[$sIndex]->loadInLang($this->getLanguage(), $sParentId)) {
//return false in case parent product failed to load
self::$_aLoadedParents[$sIndex] = false;
}
}
return self::$_aLoadedParents[$sIndex];
}
} | php | public function getParentArticle()
{
if ($this->oxarticles__oxparentid && ($sParentId = $this->oxarticles__oxparentid->value)) {
$sIndex = $sParentId . "_" . $this->getLanguage();
if (!isset(self::$_aLoadedParents[$sIndex])) {
self::$_aLoadedParents[$sIndex] = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
self::$_aLoadedParents[$sIndex]->_blLoadPrice = false;
self::$_aLoadedParents[$sIndex]->_blLoadVariants = false;
if (!self::$_aLoadedParents[$sIndex]->loadInLang($this->getLanguage(), $sParentId)) {
//return false in case parent product failed to load
self::$_aLoadedParents[$sIndex] = false;
}
}
return self::$_aLoadedParents[$sIndex];
}
} | [
"public",
"function",
"getParentArticle",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"oxarticles__oxparentid",
"&&",
"(",
"$",
"sParentId",
"=",
"$",
"this",
"->",
"oxarticles__oxparentid",
"->",
"value",
")",
")",
"{",
"$",
"sIndex",
"=",
"$",
"sParentI... | Get parent article
@return oxArticle | [
"Get",
"parent",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3157-L3174 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.updateVariantsRemind | public function updateVariantsRemind()
{
// check if it is parent article
if (!$this->isVariant() && $this->_hasAnyVariant()) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sOxId = $oDb->quote($this->getId());
$sOxShopId = $oDb->quote($this->getShopId());
$iRemindActive = $oDb->quote($this->oxarticles__oxremindactive->value);
$sUpdate = "
update oxarticles
set oxremindactive = $iRemindActive
where oxparentid = $sOxId and
oxshopid = $sOxShopId
";
$oDb->execute($sUpdate);
}
} | php | public function updateVariantsRemind()
{
// check if it is parent article
if (!$this->isVariant() && $this->_hasAnyVariant()) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sOxId = $oDb->quote($this->getId());
$sOxShopId = $oDb->quote($this->getShopId());
$iRemindActive = $oDb->quote($this->oxarticles__oxremindactive->value);
$sUpdate = "
update oxarticles
set oxremindactive = $iRemindActive
where oxparentid = $sOxId and
oxshopid = $sOxShopId
";
$oDb->execute($sUpdate);
}
} | [
"public",
"function",
"updateVariantsRemind",
"(",
")",
"{",
"// check if it is parent article",
"if",
"(",
"!",
"$",
"this",
"->",
"isVariant",
"(",
")",
"&&",
"$",
"this",
"->",
"_hasAnyVariant",
"(",
")",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"... | Updates article variants oxremindactive field, as variants inherit this setting from parent | [
"Updates",
"article",
"variants",
"oxremindactive",
"field",
"as",
"variants",
"inherit",
"this",
"setting",
"from",
"parent"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3179-L3195 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.isVariant | public function isVariant(): bool
{
$isVariant = false;
if (isset($this->oxarticles__oxparentid) && false !== $this->oxarticles__oxparentid) {
$isVariant = (bool) $this->oxarticles__oxparentid->value;
}
return $isVariant;
} | php | public function isVariant(): bool
{
$isVariant = false;
if (isset($this->oxarticles__oxparentid) && false !== $this->oxarticles__oxparentid) {
$isVariant = (bool) $this->oxarticles__oxparentid->value;
}
return $isVariant;
} | [
"public",
"function",
"isVariant",
"(",
")",
":",
"bool",
"{",
"$",
"isVariant",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"oxarticles__oxparentid",
")",
"&&",
"false",
"!==",
"$",
"this",
"->",
"oxarticles__oxparentid",
")",
"{",
"$... | Returns TRUE if product is variant, and false if not
@return bool | [
"Returns",
"TRUE",
"if",
"product",
"is",
"variant",
"and",
"false",
"if",
"not"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3233-L3241 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.isMdVariant | public function isMdVariant()
{
$oMdVariant = oxNew(\OxidEsales\Eshop\Application\Model\VariantHandler::class);
return $oMdVariant->isMdVariant($this);
} | php | public function isMdVariant()
{
$oMdVariant = oxNew(\OxidEsales\Eshop\Application\Model\VariantHandler::class);
return $oMdVariant->isMdVariant($this);
} | [
"public",
"function",
"isMdVariant",
"(",
")",
"{",
"$",
"oMdVariant",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"VariantHandler",
"::",
"class",
")",
";",
"return",
"$",
"oMdVariant",
"->",
"isMdVariant"... | Returns TRUE if product is multidimensional variant, and false if not
@return bool | [
"Returns",
"TRUE",
"if",
"product",
"is",
"multidimensional",
"variant",
"and",
"false",
"if",
"not"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3248-L3253 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getSqlForPriceCategories | public function getSqlForPriceCategories($sFields = '')
{
if (!$sFields) {
$sFields = 'oxid';
}
$sSelectWhere = "select $sFields from " . $this->_getObjectViewName('oxcategories') . " where";
$sQuotedPrice = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->oxarticles__oxprice->value);
return "$sSelectWhere oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $sQuotedPrice and oxpriceto >= $sQuotedPrice"
. " union $sSelectWhere oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $sQuotedPrice"
. " union $sSelectWhere oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $sQuotedPrice";
} | php | public function getSqlForPriceCategories($sFields = '')
{
if (!$sFields) {
$sFields = 'oxid';
}
$sSelectWhere = "select $sFields from " . $this->_getObjectViewName('oxcategories') . " where";
$sQuotedPrice = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($this->oxarticles__oxprice->value);
return "$sSelectWhere oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $sQuotedPrice and oxpriceto >= $sQuotedPrice"
. " union $sSelectWhere oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $sQuotedPrice"
. " union $sSelectWhere oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $sQuotedPrice";
} | [
"public",
"function",
"getSqlForPriceCategories",
"(",
"$",
"sFields",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"sFields",
")",
"{",
"$",
"sFields",
"=",
"'oxid'",
";",
"}",
"$",
"sSelectWhere",
"=",
"\"select $sFields from \"",
".",
"$",
"this",
"->",
... | get Sql for loading price categories which include this article
@param string $sFields fields to load from oxCategories
@return string | [
"get",
"Sql",
"for",
"loading",
"price",
"categories",
"which",
"include",
"this",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3262-L3273 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.fetchFirstInPriceCategory | protected function fetchFirstInPriceCategory($categoryPriceId)
{
$database = $this->getDatabase();
$query = $this->createFetchFirstInPriceCategorySql($categoryPriceId);
$result = $database->getOne($query);
return $result;
} | php | protected function fetchFirstInPriceCategory($categoryPriceId)
{
$database = $this->getDatabase();
$query = $this->createFetchFirstInPriceCategorySql($categoryPriceId);
$result = $database->getOne($query);
return $result;
} | [
"protected",
"function",
"fetchFirstInPriceCategory",
"(",
"$",
"categoryPriceId",
")",
"{",
"$",
"database",
"=",
"$",
"this",
"->",
"getDatabase",
"(",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"createFetchFirstInPriceCategorySql",
"(",
"$",
"categoryPri... | Fetch the article corresponding to this object in the price category with the given id.
@param string $categoryPriceId The id of the category we want to check, if this article is in.
@return string One, if the given article is in the given price category, else empty string. | [
"Fetch",
"the",
"article",
"corresponding",
"to",
"this",
"object",
"in",
"the",
"price",
"category",
"with",
"the",
"given",
"id",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3294-L3303 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.createFetchFirstInPriceCategorySql | protected function createFetchFirstInPriceCategorySql($categoryPriceId)
{
$database = $this->getDatabase();
$quotedPrice = $database->quote($this->oxarticles__oxprice->value);
$quotedCategoryId = $database->quote($categoryPriceId);
$query = "select 1 from " . $this->_getObjectViewName('oxcategories') . " where oxid=$quotedCategoryId and"
. "( (oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $quotedPrice and oxpriceto >= $quotedPrice)"
. " or (oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $quotedPrice)"
. " or (oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $quotedPrice)"
. ")";
return $query;
} | php | protected function createFetchFirstInPriceCategorySql($categoryPriceId)
{
$database = $this->getDatabase();
$quotedPrice = $database->quote($this->oxarticles__oxprice->value);
$quotedCategoryId = $database->quote($categoryPriceId);
$query = "select 1 from " . $this->_getObjectViewName('oxcategories') . " where oxid=$quotedCategoryId and"
. "( (oxpricefrom != 0 and oxpriceto != 0 and oxpricefrom <= $quotedPrice and oxpriceto >= $quotedPrice)"
. " or (oxpricefrom != 0 and oxpriceto = 0 and oxpricefrom <= $quotedPrice)"
. " or (oxpricefrom = 0 and oxpriceto != 0 and oxpriceto >= $quotedPrice)"
. ")";
return $query;
} | [
"protected",
"function",
"createFetchFirstInPriceCategorySql",
"(",
"$",
"categoryPriceId",
")",
"{",
"$",
"database",
"=",
"$",
"this",
"->",
"getDatabase",
"(",
")",
";",
"$",
"quotedPrice",
"=",
"$",
"database",
"->",
"quote",
"(",
"$",
"this",
"->",
"oxa... | Create the sql for the fetchFirstInPriceCategory method.
@param string $categoryPriceId The price category id.
@return string The wished sql. | [
"Create",
"the",
"sql",
"for",
"the",
"fetchFirstInPriceCategory",
"method",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3312-L3326 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getPictureFieldValue | public function getPictureFieldValue($sFieldName, $iIndex = null)
{
if ($sFieldName) {
$sFieldName = "oxarticles__" . $sFieldName . $iIndex;
return $this->$sFieldName->value;
}
} | php | public function getPictureFieldValue($sFieldName, $iIndex = null)
{
if ($sFieldName) {
$sFieldName = "oxarticles__" . $sFieldName . $iIndex;
return $this->$sFieldName->value;
}
} | [
"public",
"function",
"getPictureFieldValue",
"(",
"$",
"sFieldName",
",",
"$",
"iIndex",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"sFieldName",
")",
"{",
"$",
"sFieldName",
"=",
"\"oxarticles__\"",
".",
"$",
"sFieldName",
".",
"$",
"iIndex",
";",
"return",
... | Return article picture file name
@param string $sFieldName article picture field name
@param int $iIndex article picture index
@return string | [
"Return",
"article",
"picture",
"file",
"name"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3381-L3388 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Article.php | Article.getMasterZoomPictureUrl | public function getMasterZoomPictureUrl($iIndex)
{
$sPicUrl = false;
$sPicName = basename($this->{"oxarticles__oxpic" . $iIndex}->value);
if ($sPicName && $sPicName != "nopic.jpg") {
$sPicUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureUrl("master/product/" . $iIndex . "/" . $sPicName);
if (!$sPicUrl || basename($sPicUrl) == "nopic.jpg") {
$sPicUrl = false;
}
}
return $sPicUrl;
} | php | public function getMasterZoomPictureUrl($iIndex)
{
$sPicUrl = false;
$sPicName = basename($this->{"oxarticles__oxpic" . $iIndex}->value);
if ($sPicName && $sPicName != "nopic.jpg") {
$sPicUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getPictureUrl("master/product/" . $iIndex . "/" . $sPicName);
if (!$sPicUrl || basename($sPicUrl) == "nopic.jpg") {
$sPicUrl = false;
}
}
return $sPicUrl;
} | [
"public",
"function",
"getMasterZoomPictureUrl",
"(",
"$",
"iIndex",
")",
"{",
"$",
"sPicUrl",
"=",
"false",
";",
"$",
"sPicName",
"=",
"basename",
"(",
"$",
"this",
"->",
"{",
"\"oxarticles__oxpic\"",
".",
"$",
"iIndex",
"}",
"->",
"value",
")",
";",
"i... | Get master zoom picture url
@param int $iIndex picture index
@return string | [
"Get",
"master",
"zoom",
"picture",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Article.php#L3397-L3410 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.