repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getBasketCurrency | public function getBasketCurrency()
{
if ($this->_oCurrency === null) {
$this->_oCurrency = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
}
return $this->_oCurrency;
} | php | public function getBasketCurrency()
{
if ($this->_oCurrency === null) {
$this->_oCurrency = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject();
}
return $this->_oCurrency;
} | [
"public",
"function",
"getBasketCurrency",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oCurrency",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oCurrency",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"("... | Basket currency getter
@return object | [
"Basket",
"currency",
"getter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2175-L2182 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getProductsNetPrice | public function getProductsNetPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getNettoSum(), $this->getBasketCurrency());
} | php | public function getProductsNetPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getNettoSum(), $this->getBasketCurrency());
} | [
"public",
"function",
"getProductsNetPrice",
"(",
")",
"{",
"return",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
"->",
"formatCurrency",
"(",
"$",
"this",
"->",
"getNettoSum",
"(",
")",
",",
"$",
"this",
... | Formatted Products net price getter
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | [
"Formatted",
"Products",
"net",
"price",
"getter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2221-L2224 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getFProductsPrice | public function getFProductsPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getBruttoSum(), $this->getBasketCurrency());
} | php | public function getFProductsPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getBruttoSum(), $this->getBasketCurrency());
} | [
"public",
"function",
"getFProductsPrice",
"(",
")",
"{",
"return",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
"->",
"formatCurrency",
"(",
"$",
"this",
"->",
"getBruttoSum",
"(",
")",
",",
"$",
"this",
... | Formatted Products price getter
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | [
"Formatted",
"Products",
"price",
"getter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2233-L2236 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getDelCostVat | public function getDelCostVat()
{
$dDelVAT = $this->getCosts('oxdelivery')->getVatValue();
// blShowVATForDelivery option will be used, only for displaying, but not calculation
if ($dDelVAT > 0 && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForDelivery')) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dDelVAT, $this->getBasketCurrency());
}
return false;
} | php | public function getDelCostVat()
{
$dDelVAT = $this->getCosts('oxdelivery')->getVatValue();
// blShowVATForDelivery option will be used, only for displaying, but not calculation
if ($dDelVAT > 0 && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForDelivery')) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dDelVAT, $this->getBasketCurrency());
}
return false;
} | [
"public",
"function",
"getDelCostVat",
"(",
")",
"{",
"$",
"dDelVAT",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxdelivery'",
")",
"->",
"getVatValue",
"(",
")",
";",
"// blShowVATForDelivery option will be used, only for displaying, but not calculation",
"if",
"(",
... | Returns formatted VAT of delivery costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | bool | [
"Returns",
"formatted",
"VAT",
"of",
"delivery",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2257-L2267 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getDelCostNet | public function getDelCostNet()
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// blShowVATForDelivery option will be used, only for displaying, but not calculation
if ($oConfig->getConfigParam('blShowVATForDelivery') && ($this->getBasketUser() || $oConfig->getConfigParam('blCalculateDelCostIfNotLoggedIn'))) {
$dNetPrice = $this->getCosts('oxdelivery')->getNettoPrice();
if ($dNetPrice > 0) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dNetPrice, $this->getBasketCurrency());
}
}
return false;
} | php | public function getDelCostNet()
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// blShowVATForDelivery option will be used, only for displaying, but not calculation
if ($oConfig->getConfigParam('blShowVATForDelivery') && ($this->getBasketUser() || $oConfig->getConfigParam('blCalculateDelCostIfNotLoggedIn'))) {
$dNetPrice = $this->getCosts('oxdelivery')->getNettoPrice();
if ($dNetPrice > 0) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dNetPrice, $this->getBasketCurrency());
}
}
return false;
} | [
"public",
"function",
"getDelCostNet",
"(",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"// blShowVATForDelivery option will be used, only for displaying, but not calculation",
"if",... | Returns formatted netto price of delivery costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | [
"Returns",
"formatted",
"netto",
"price",
"of",
"delivery",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2276-L2289 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getPayCostVat | public function getPayCostVat()
{
$dPayVAT = $this->getCosts('oxpayment')->getVatValue();
// blShowVATForPayCharge option will be used, only for displaying, but not calculation
if ($dPayVAT > 0 && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForPayCharge')) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPayVAT, $this->getBasketCurrency());
}
return false;
} | php | public function getPayCostVat()
{
$dPayVAT = $this->getCosts('oxpayment')->getVatValue();
// blShowVATForPayCharge option will be used, only for displaying, but not calculation
if ($dPayVAT > 0 && \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForPayCharge')) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPayVAT, $this->getBasketCurrency());
}
return false;
} | [
"public",
"function",
"getPayCostVat",
"(",
")",
"{",
"$",
"dPayVAT",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxpayment'",
")",
"->",
"getVatValue",
"(",
")",
";",
"// blShowVATForPayCharge option will be used, only for displaying, but not calculation",
"if",
"(",
... | Returns formatted VAT of payment costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | [
"Returns",
"formatted",
"VAT",
"of",
"payment",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2310-L2320 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getPayCostNet | public function getPayCostNet()
{
// blShowVATForPayCharge option will be used, only for displaying, but not calculation
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForPayCharge')) {
$oPaymentCost = $this->getCosts('oxpayment');
if ($oPaymentCost && $oPaymentCost->getNettoPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getCosts('oxpayment')->getNettoPrice(), $this->getBasketCurrency());
}
}
return false;
} | php | public function getPayCostNet()
{
// blShowVATForPayCharge option will be used, only for displaying, but not calculation
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForPayCharge')) {
$oPaymentCost = $this->getCosts('oxpayment');
if ($oPaymentCost && $oPaymentCost->getNettoPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getCosts('oxpayment')->getNettoPrice(), $this->getBasketCurrency());
}
}
return false;
} | [
"public",
"function",
"getPayCostNet",
"(",
")",
"{",
"// blShowVATForPayCharge option will be used, only for displaying, but not calculation",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam... | Returns formatted netto price of payment costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | [
"Returns",
"formatted",
"netto",
"price",
"of",
"payment",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2329-L2340 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getFPaymentCosts | public function getFPaymentCosts()
{
$oPaymentCost = $this->getCosts('oxpayment');
if ($oPaymentCost && $oPaymentCost->getBruttoPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPaymentCost->getBruttoPrice(), $this->getBasketCurrency());
}
return false;
} | php | public function getFPaymentCosts()
{
$oPaymentCost = $this->getCosts('oxpayment');
if ($oPaymentCost && $oPaymentCost->getBruttoPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPaymentCost->getBruttoPrice(), $this->getBasketCurrency());
}
return false;
} | [
"public",
"function",
"getFPaymentCosts",
"(",
")",
"{",
"$",
"oPaymentCost",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxpayment'",
")",
";",
"if",
"(",
"$",
"oPaymentCost",
"&&",
"$",
"oPaymentCost",
"->",
"getBruttoPrice",
"(",
")",
")",
"{",
"return",... | Returns if exists formatted payment costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | bool | [
"Returns",
"if",
"exists",
"formatted",
"payment",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2374-L2382 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getFVoucherDiscountValue | public function getFVoucherDiscountValue()
{
if ($oVoucherDiscount = $this->getVoucherDiscount()) {
if ($oVoucherDiscount->getBruttoPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oVoucherDiscount->getBruttoPrice(), $this->getBasketCurrency());
}
}
return false;
} | php | public function getFVoucherDiscountValue()
{
if ($oVoucherDiscount = $this->getVoucherDiscount()) {
if ($oVoucherDiscount->getBruttoPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oVoucherDiscount->getBruttoPrice(), $this->getBasketCurrency());
}
}
return false;
} | [
"public",
"function",
"getFVoucherDiscountValue",
"(",
")",
"{",
"if",
"(",
"$",
"oVoucherDiscount",
"=",
"$",
"this",
"->",
"getVoucherDiscount",
"(",
")",
")",
"{",
"if",
"(",
"$",
"oVoucherDiscount",
"->",
"getBruttoPrice",
"(",
")",
")",
"{",
"return",
... | Returns formatted voucher discount
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | bool | [
"Returns",
"formatted",
"voucher",
"discount"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2405-L2414 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getWrappCostNet | public function getWrappCostNet()
{
// blShowVATForWrapping option will be used, only for displaying, but not calculation
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForWrapping')) {
$oPrice = $this->getCosts('oxwrapping');
if ($oPrice && $oPrice->getNettoPrice() > 0) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getNettoPrice(), $this->getBasketCurrency());
}
}
return false;
} | php | public function getWrappCostNet()
{
// blShowVATForWrapping option will be used, only for displaying, but not calculation
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForWrapping')) {
$oPrice = $this->getCosts('oxwrapping');
if ($oPrice && $oPrice->getNettoPrice() > 0) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getNettoPrice(), $this->getBasketCurrency());
}
}
return false;
} | [
"public",
"function",
"getWrappCostNet",
"(",
")",
"{",
"// blShowVATForWrapping option will be used, only for displaying, but not calculation",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigPara... | Returns formatted netto price of wrapping costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | [
"Returns",
"formatted",
"netto",
"price",
"of",
"wrapping",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2470-L2482 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getFWrappingCosts | public function getFWrappingCosts()
{
$oPrice = $this->getCosts('oxwrapping');
if ($oPrice && $oPrice->getBruttoPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getBruttoPrice(), $this->getBasketCurrency());
}
return false;
} | php | public function getFWrappingCosts()
{
$oPrice = $this->getCosts('oxwrapping');
if ($oPrice && $oPrice->getBruttoPrice()) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getBruttoPrice(), $this->getBasketCurrency());
}
return false;
} | [
"public",
"function",
"getFWrappingCosts",
"(",
")",
"{",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxwrapping'",
")",
";",
"if",
"(",
"$",
"oPrice",
"&&",
"$",
"oPrice",
"->",
"getBruttoPrice",
"(",
")",
")",
"{",
"return",
"\\",
"Oxid... | Returns if exists formatted wrapping costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | bool | [
"Returns",
"if",
"exists",
"formatted",
"wrapping",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2491-L2500 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getGiftCardCostVat | public function getGiftCardCostVat()
{
// blShowVATForWrapping option will be used, only for displaying, but not calculation
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForWrapping')) {
$oPrice = $this->getCosts('oxgiftcard');
if ($oPrice && $oPrice->getVatValue() > 0) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getVatValue(), $this->getBasketCurrency());
}
}
return false;
} | php | public function getGiftCardCostVat()
{
// blShowVATForWrapping option will be used, only for displaying, but not calculation
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blShowVATForWrapping')) {
$oPrice = $this->getCosts('oxgiftcard');
if ($oPrice && $oPrice->getVatValue() > 0) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getVatValue(), $this->getBasketCurrency());
}
}
return false;
} | [
"public",
"function",
"getGiftCardCostVat",
"(",
")",
"{",
"// blShowVATForWrapping option will be used, only for displaying, but not calculation",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigP... | Returns formatted VAT of gift card costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | bool | [
"Returns",
"formatted",
"VAT",
"of",
"gift",
"card",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2519-L2531 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getFPrice | public function getFPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getPrice()->getBruttoPrice(), $this->getBasketCurrency());
} | php | public function getFPrice()
{
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getPrice()->getBruttoPrice(), $this->getBasketCurrency());
} | [
"public",
"function",
"getFPrice",
"(",
")",
"{",
"return",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
"->",
"formatCurrency",
"(",
"$",
"this",
"->",
"getPrice",
"(",
")",
"->",
"getBruttoPrice",
"(",
"... | Returns formatted basket total price
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | [
"Returns",
"formatted",
"basket",
"total",
"price"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2589-L2592 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getFDeliveryCosts | public function getFDeliveryCosts()
{
$oPrice = $this->getCosts('oxdelivery');
if ($oPrice && ($this->getBasketUser() || \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blCalculateDelCostIfNotLoggedIn'))) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getBruttoPrice(), $this->getBasketCurrency());
}
return false;
} | php | public function getFDeliveryCosts()
{
$oPrice = $this->getCosts('oxdelivery');
if ($oPrice && ($this->getBasketUser() || \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blCalculateDelCostIfNotLoggedIn'))) {
return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($oPrice->getBruttoPrice(), $this->getBasketCurrency());
}
return false;
} | [
"public",
"function",
"getFDeliveryCosts",
"(",
")",
"{",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getCosts",
"(",
"'oxdelivery'",
")",
";",
"if",
"(",
"$",
"oPrice",
"&&",
"(",
"$",
"this",
"->",
"getBasketUser",
"(",
")",
"||",
"\\",
"OxidEsales",
"\\... | Returns if exists formatted delivery costs
@deprecated in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
@return string | bool | [
"Returns",
"if",
"exists",
"formatted",
"delivery",
"costs"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2601-L2610 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.setTotalDiscount | public function setTotalDiscount($dDiscount)
{
$this->_oTotalDiscount = oxNew(\OxidEsales\Eshop\Core\Price::class);
$this->_oTotalDiscount->setBruttoPriceMode();
$this->_oTotalDiscount->add($dDiscount);
} | php | public function setTotalDiscount($dDiscount)
{
$this->_oTotalDiscount = oxNew(\OxidEsales\Eshop\Core\Price::class);
$this->_oTotalDiscount->setBruttoPriceMode();
$this->_oTotalDiscount->add($dDiscount);
} | [
"public",
"function",
"setTotalDiscount",
"(",
"$",
"dDiscount",
")",
"{",
"$",
"this",
"->",
"_oTotalDiscount",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Price",
"::",
"class",
")",
";",
"$",
"this",
"->",
"_oTotalDiscount... | Sets total discount value
@param double $dDiscount new total discount value | [
"Sets",
"total",
"discount",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2643-L2648 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getPriceForPayment | public function getPriceForPayment()
{
$dPrice = $this->getDiscountedProductsBruttoPrice();
//#1905 not discounted products should be included in payment amount calculation
if ($oPriceList = $this->getNotDiscountProductsPrice()) {
$dPrice += $oPriceList->getBruttoSum();
}
// adding delivery price to final price
if ($oDeliveryPrice = $this->_aCosts['oxdelivery']) {
$dPrice += $oDeliveryPrice->getBruttoPrice();
}
return $dPrice;
} | php | public function getPriceForPayment()
{
$dPrice = $this->getDiscountedProductsBruttoPrice();
//#1905 not discounted products should be included in payment amount calculation
if ($oPriceList = $this->getNotDiscountProductsPrice()) {
$dPrice += $oPriceList->getBruttoSum();
}
// adding delivery price to final price
if ($oDeliveryPrice = $this->_aCosts['oxdelivery']) {
$dPrice += $oDeliveryPrice->getBruttoPrice();
}
return $dPrice;
} | [
"public",
"function",
"getPriceForPayment",
"(",
")",
"{",
"$",
"dPrice",
"=",
"$",
"this",
"->",
"getDiscountedProductsBruttoPrice",
"(",
")",
";",
"//#1905 not discounted products should be included in payment amount calculation",
"if",
"(",
"$",
"oPriceList",
"=",
"$",... | Get basket price for payment cost calculation. Returned price
is with applied discounts, vouchers and added delivery cost
@return double | [
"Get",
"basket",
"price",
"for",
"payment",
"cost",
"calculation",
".",
"Returned",
"price",
"is",
"with",
"applied",
"discounts",
"vouchers",
"and",
"added",
"delivery",
"cost"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2656-L2670 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getTotalDiscountSum | public function getTotalDiscountSum()
{
$dPrice = 0;
// subtracting total discount
if ($oPrice = $this->getTotalDiscount()) {
$dPrice += $oPrice->getPrice();
}
if ($oVoucherPrice = $this->getVoucherDiscount()) {
$dPrice += $oVoucherPrice->getPrice();
}
return $dPrice;
} | php | public function getTotalDiscountSum()
{
$dPrice = 0;
// subtracting total discount
if ($oPrice = $this->getTotalDiscount()) {
$dPrice += $oPrice->getPrice();
}
if ($oVoucherPrice = $this->getVoucherDiscount()) {
$dPrice += $oVoucherPrice->getPrice();
}
return $dPrice;
} | [
"public",
"function",
"getTotalDiscountSum",
"(",
")",
"{",
"$",
"dPrice",
"=",
"0",
";",
"// subtracting total discount",
"if",
"(",
"$",
"oPrice",
"=",
"$",
"this",
"->",
"getTotalDiscount",
"(",
")",
")",
"{",
"$",
"dPrice",
"+=",
"$",
"oPrice",
"->",
... | Gets total discount sum.
@return float|int | [
"Gets",
"total",
"discount",
"sum",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2701-L2714 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getArtStockInBasket | public function getArtStockInBasket($sArtId, $sExpiredArtId = null)
{
$dArtStock = 0;
foreach ($this->_aBasketContents as $sItemKey => $oOrderArticle) {
if ($oOrderArticle && ($sExpiredArtId == null || $sExpiredArtId != $sItemKey)) {
if ($oOrderArticle->getArticle(true)->getId() == $sArtId) {
$dArtStock += $oOrderArticle->getAmount();
}
}
}
return $dArtStock;
} | php | public function getArtStockInBasket($sArtId, $sExpiredArtId = null)
{
$dArtStock = 0;
foreach ($this->_aBasketContents as $sItemKey => $oOrderArticle) {
if ($oOrderArticle && ($sExpiredArtId == null || $sExpiredArtId != $sItemKey)) {
if ($oOrderArticle->getArticle(true)->getId() == $sArtId) {
$dArtStock += $oOrderArticle->getAmount();
}
}
}
return $dArtStock;
} | [
"public",
"function",
"getArtStockInBasket",
"(",
"$",
"sArtId",
",",
"$",
"sExpiredArtId",
"=",
"null",
")",
"{",
"$",
"dArtStock",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_aBasketContents",
"as",
"$",
"sItemKey",
"=>",
"$",
"oOrderArticle",
")... | Returns stock of article in basket, including bundle article
@param string $sArtId article id
@param string $sExpiredArtId item id of updated article
@return double | [
"Returns",
"stock",
"of",
"article",
"in",
"basket",
"including",
"bundle",
"article"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2768-L2780 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.canAddProductToBasket | public function canAddProductToBasket($sProductId)
{
$blCanAdd = null;
// if basket category is not set..
if ($this->_sBasketCategoryId === null) {
$oCat = null;
// request category
if ($oView = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView()) {
if ($oCat = $oView->getActiveCategory()) {
if (!$this->_isProductInRootCategory($sProductId, $oCat->oxcategories__oxrootid->value)) {
$oCat = null;
} else {
$blCanAdd = true;
}
}
}
// product main category
if (!$oCat) {
$oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($oProduct->load($sProductId)) {
$oCat = $oProduct->getCategory();
}
}
// root category id
if ($oCat) {
$this->setBasketRootCatId($oCat->oxcategories__oxrootid->value);
}
}
// avoiding double check..
if ($blCanAdd === null) {
$blCanAdd = $this->_sBasketCategoryId ? $this->_isProductInRootCategory($sProductId, $this->getBasketRootCatId()) : true;
}
return $blCanAdd;
} | php | public function canAddProductToBasket($sProductId)
{
$blCanAdd = null;
// if basket category is not set..
if ($this->_sBasketCategoryId === null) {
$oCat = null;
// request category
if ($oView = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView()) {
if ($oCat = $oView->getActiveCategory()) {
if (!$this->_isProductInRootCategory($sProductId, $oCat->oxcategories__oxrootid->value)) {
$oCat = null;
} else {
$blCanAdd = true;
}
}
}
// product main category
if (!$oCat) {
$oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($oProduct->load($sProductId)) {
$oCat = $oProduct->getCategory();
}
}
// root category id
if ($oCat) {
$this->setBasketRootCatId($oCat->oxcategories__oxrootid->value);
}
}
// avoiding double check..
if ($blCanAdd === null) {
$blCanAdd = $this->_sBasketCategoryId ? $this->_isProductInRootCategory($sProductId, $this->getBasketRootCatId()) : true;
}
return $blCanAdd;
} | [
"public",
"function",
"canAddProductToBasket",
"(",
"$",
"sProductId",
")",
"{",
"$",
"blCanAdd",
"=",
"null",
";",
"// if basket category is not set..",
"if",
"(",
"$",
"this",
"->",
"_sBasketCategoryId",
"===",
"null",
")",
"{",
"$",
"oCat",
"=",
"null",
";"... | Checks if product can be added to basket
@param string $sProductId product id
@return bool | [
"Checks",
"if",
"product",
"can",
"be",
"added",
"to",
"basket"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2789-L2828 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket._isProductInRootCategory | protected function _isProductInRootCategory($sProductId, $sRootCatId)
{
$sO2CTable = getViewName('oxobject2category');
$sCatTable = getViewName('oxcategories');
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sParentId = $oDb->getOne("select oxparentid from oxarticles where oxid = " . $oDb->quote($sProductId));
$sProductId = $sParentId ? $sParentId : $sProductId;
$sQ = "select 1 from {$sO2CTable}
left join {$sCatTable} on {$sCatTable}.oxid = {$sO2CTable}.oxcatnid
where {$sO2CTable}.oxobjectid = " . $oDb->quote($sProductId) . " and
{$sCatTable}.oxrootid = " . $oDb->quote($sRootCatId);
return (bool) $oDb->getOne($sQ);
} | php | protected function _isProductInRootCategory($sProductId, $sRootCatId)
{
$sO2CTable = getViewName('oxobject2category');
$sCatTable = getViewName('oxcategories');
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sParentId = $oDb->getOne("select oxparentid from oxarticles where oxid = " . $oDb->quote($sProductId));
$sProductId = $sParentId ? $sParentId : $sProductId;
$sQ = "select 1 from {$sO2CTable}
left join {$sCatTable} on {$sCatTable}.oxid = {$sO2CTable}.oxcatnid
where {$sO2CTable}.oxobjectid = " . $oDb->quote($sProductId) . " and
{$sCatTable}.oxrootid = " . $oDb->quote($sRootCatId);
return (bool) $oDb->getOne($sQ);
} | [
"protected",
"function",
"_isProductInRootCategory",
"(",
"$",
"sProductId",
",",
"$",
"sRootCatId",
")",
"{",
"$",
"sO2CTable",
"=",
"getViewName",
"(",
"'oxobject2category'",
")",
";",
"$",
"sCatTable",
"=",
"getViewName",
"(",
"'oxcategories'",
")",
";",
"$",... | Checks if product is in root category
@param string $sProductId product id
@param string $sRootCatId root category id
@return bool | [
"Checks",
"if",
"product",
"is",
"in",
"root",
"category"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2838-L2853 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.isNewItemAdded | public function isNewItemAdded()
{
if ($this->_blNewITemAdded == null) {
$this->_blNewITemAdded = (bool) \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("blAddedNewItem");
\OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("blAddedNewItem");
}
return $this->_blNewITemAdded;
} | php | public function isNewItemAdded()
{
if ($this->_blNewITemAdded == null) {
$this->_blNewITemAdded = (bool) \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("blAddedNewItem");
\OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("blAddedNewItem");
}
return $this->_blNewITemAdded;
} | [
"public",
"function",
"isNewItemAdded",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_blNewITemAdded",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"_blNewITemAdded",
"=",
"(",
"bool",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry"... | Returns true if new product was just added to basket
@return bool | [
"Returns",
"true",
"if",
"new",
"product",
"was",
"just",
"added",
"to",
"basket"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2950-L2958 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.hasDownloadableProducts | public function hasDownloadableProducts()
{
$this->_blDownloadableProducts = false;
/** @var \OxidEsales\Eshop\Application\Model\BasketItem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) {
if ($oBasketItem->getArticle(false) && $oBasketItem->getArticle(false)->isDownloadable()) {
$this->_blDownloadableProducts = true;
break;
}
}
return $this->_blDownloadableProducts;
} | php | public function hasDownloadableProducts()
{
$this->_blDownloadableProducts = false;
/** @var \OxidEsales\Eshop\Application\Model\BasketItem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) {
if ($oBasketItem->getArticle(false) && $oBasketItem->getArticle(false)->isDownloadable()) {
$this->_blDownloadableProducts = true;
break;
}
}
return $this->_blDownloadableProducts;
} | [
"public",
"function",
"hasDownloadableProducts",
"(",
")",
"{",
"$",
"this",
"->",
"_blDownloadableProducts",
"=",
"false",
";",
"/** @var \\OxidEsales\\Eshop\\Application\\Model\\BasketItem $oBasketItem */",
"foreach",
"(",
"$",
"this",
"->",
"_aBasketContents",
"as",
"$",... | Returns true if at least one product is downloadable in basket
@return bool | [
"Returns",
"true",
"if",
"at",
"least",
"one",
"product",
"is",
"downloadable",
"in",
"basket"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2965-L2977 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.hasArticlesWithIntangibleAgreement | public function hasArticlesWithIntangibleAgreement()
{
$blHasArticlesWithIntangibleAgreement = false;
/** @var \OxidEsales\Eshop\Application\Model\BasketItem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) {
if ($oBasketItem->getArticle(false) && $oBasketItem->getArticle(false)->hasIntangibleAgreement()) {
$blHasArticlesWithIntangibleAgreement = true;
break;
}
}
return $blHasArticlesWithIntangibleAgreement;
} | php | public function hasArticlesWithIntangibleAgreement()
{
$blHasArticlesWithIntangibleAgreement = false;
/** @var \OxidEsales\Eshop\Application\Model\BasketItem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) {
if ($oBasketItem->getArticle(false) && $oBasketItem->getArticle(false)->hasIntangibleAgreement()) {
$blHasArticlesWithIntangibleAgreement = true;
break;
}
}
return $blHasArticlesWithIntangibleAgreement;
} | [
"public",
"function",
"hasArticlesWithIntangibleAgreement",
"(",
")",
"{",
"$",
"blHasArticlesWithIntangibleAgreement",
"=",
"false",
";",
"/** @var \\OxidEsales\\Eshop\\Application\\Model\\BasketItem $oBasketItem */",
"foreach",
"(",
"$",
"this",
"->",
"_aBasketContents",
"as",
... | Returns whether there are any articles in basket with intangible products agreement enabled.
@return bool | [
"Returns",
"whether",
"there",
"are",
"any",
"articles",
"in",
"basket",
"with",
"intangible",
"products",
"agreement",
"enabled",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L2984-L2997 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.hasArticlesWithDownloadableAgreement | public function hasArticlesWithDownloadableAgreement()
{
$blHasArticlesWithIntangibleAgreement = false;
/** @var \OxidEsales\Eshop\Application\Model\BasketItem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) {
if ($oBasketItem->getArticle(false) && $oBasketItem->getArticle(false)->hasDownloadableAgreement()) {
$blHasArticlesWithIntangibleAgreement = true;
break;
}
}
return $blHasArticlesWithIntangibleAgreement;
} | php | public function hasArticlesWithDownloadableAgreement()
{
$blHasArticlesWithIntangibleAgreement = false;
/** @var \OxidEsales\Eshop\Application\Model\BasketItem $oBasketItem */
foreach ($this->_aBasketContents as $oBasketItem) {
if ($oBasketItem->getArticle(false) && $oBasketItem->getArticle(false)->hasDownloadableAgreement()) {
$blHasArticlesWithIntangibleAgreement = true;
break;
}
}
return $blHasArticlesWithIntangibleAgreement;
} | [
"public",
"function",
"hasArticlesWithDownloadableAgreement",
"(",
")",
"{",
"$",
"blHasArticlesWithIntangibleAgreement",
"=",
"false",
";",
"/** @var \\OxidEsales\\Eshop\\Application\\Model\\BasketItem $oBasketItem */",
"foreach",
"(",
"$",
"this",
"->",
"_aBasketContents",
"as"... | Returns whether there are any articles in basket with downloadable products agreement enabled.
@return bool | [
"Returns",
"whether",
"there",
"are",
"any",
"articles",
"in",
"basket",
"with",
"downloadable",
"products",
"agreement",
"enabled",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L3004-L3017 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Basket.php | Basket.getMinOrderPrice | public function getMinOrderPrice()
{
return \OxidEsales\Eshop\Core\Price::getPriceInActCurrency(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iMinOrderPrice'));
} | php | public function getMinOrderPrice()
{
return \OxidEsales\Eshop\Core\Price::getPriceInActCurrency(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iMinOrderPrice'));
} | [
"public",
"function",
"getMinOrderPrice",
"(",
")",
"{",
"return",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Price",
"::",
"getPriceInActCurrency",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
... | Returns min order price value
@return float | [
"Returns",
"min",
"order",
"price",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Basket.php#L3024-L3027 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ShopRdfa.php | ShopRdfa.getContentList | public function getContentList()
{
$oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
$sTable = getViewName("oxcontents", $this->_iEditLang);
$oContentList->selectString(
"SELECT *
FROM {$sTable}
WHERE OXACTIVE = 1 AND OXTYPE = 0
AND OXLOADID IN ('oxagb', 'oxdeliveryinfo', 'oximpressum', 'oxrightofwithdrawal')
AND OXSHOPID = '" . \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid") . "'
ORDER BY OXLOADID ASC"
);
return $oContentList;
} | php | public function getContentList()
{
$oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
$sTable = getViewName("oxcontents", $this->_iEditLang);
$oContentList->selectString(
"SELECT *
FROM {$sTable}
WHERE OXACTIVE = 1 AND OXTYPE = 0
AND OXLOADID IN ('oxagb', 'oxdeliveryinfo', 'oximpressum', 'oxrightofwithdrawal')
AND OXSHOPID = '" . \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid") . "'
ORDER BY OXLOADID ASC"
);
return $oContentList;
} | [
"public",
"function",
"getContentList",
"(",
")",
"{",
"$",
"oContentList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"ContentList",
"::",
"class",
")",
";",
"$",
"sTable",
"=",
"getViewName",
"(",
"\"o... | Gets list of content pages which could be used for embedding
business entity, price specification, and delivery specification data
@return oxContentList | [
"Gets",
"list",
"of",
"content",
"pages",
"which",
"could",
"be",
"used",
"for",
"embedding",
"business",
"entity",
"price",
"specification",
"and",
"delivery",
"specification",
"data"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ShopRdfa.php#L42-L56 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ShopRdfa.php | ShopRdfa.getCustomers | public function getCustomers()
{
$aCustomersConf = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopConfVar("aRDFaCustomers");
if (isset($aCustomersConf)) {
foreach ($this->_aCustomers as $sCustomer => $iValue) {
$aCustomers[$sCustomer] = (in_array($sCustomer, $aCustomersConf)) ? 1 : 0;
}
} else {
$aCustomers = [];
}
return $aCustomers;
} | php | public function getCustomers()
{
$aCustomersConf = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopConfVar("aRDFaCustomers");
if (isset($aCustomersConf)) {
foreach ($this->_aCustomers as $sCustomer => $iValue) {
$aCustomers[$sCustomer] = (in_array($sCustomer, $aCustomersConf)) ? 1 : 0;
}
} else {
$aCustomers = [];
}
return $aCustomers;
} | [
"public",
"function",
"getCustomers",
"(",
")",
"{",
"$",
"aCustomersConf",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getShopConfVar",
"(",
"\"aRDFaCustomers\"",
")",
";",
"if",
"(",
"isset",
... | Handles and returns customer array
@return array | [
"Handles",
"and",
"returns",
"customer",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ShopRdfa.php#L63-L75 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ShopRdfa.php | ShopRdfa.submitUrl | public function submitUrl()
{
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aSubmitUrl");
if ($aParams['url']) {
$sNotificationUrl = "http://gr-notify.appspot.com/submit?uri=" . urlencode($aParams['url']) . "&agent=oxid";
if ($aParams['email']) {
$sNotificationUrl .= "&contact=" . urlencode($aParams['email']);
}
$aHeaders = $this->getHttpResponseCode($sNotificationUrl);
if (substr($aHeaders[2], -4) === "True") {
$this->_aViewData["submitMessage"] = 'SHOP_RDFA_SUBMITED_SUCCESSFULLY';
} else {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay(substr($aHeaders[3], strpos($aHeaders[3], ":") + 2));
}
} else {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay('SHOP_RDFA_MESSAGE_NOURL');
}
} | php | public function submitUrl()
{
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aSubmitUrl");
if ($aParams['url']) {
$sNotificationUrl = "http://gr-notify.appspot.com/submit?uri=" . urlencode($aParams['url']) . "&agent=oxid";
if ($aParams['email']) {
$sNotificationUrl .= "&contact=" . urlencode($aParams['email']);
}
$aHeaders = $this->getHttpResponseCode($sNotificationUrl);
if (substr($aHeaders[2], -4) === "True") {
$this->_aViewData["submitMessage"] = 'SHOP_RDFA_SUBMITED_SUCCESSFULLY';
} else {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay(substr($aHeaders[3], strpos($aHeaders[3], ":") + 2));
}
} else {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay('SHOP_RDFA_MESSAGE_NOURL');
}
} | [
"public",
"function",
"submitUrl",
"(",
")",
"{",
"$",
"aParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"\"aSubmitUrl\"",
")",
";",
"if",
"(",
"$",
"aParams",
... | Submits shop main page to web search engines.
@deprecated since v6.0-rc.3 (2017-10-16); GR-Notify registration feature is removed. | [
"Submits",
"shop",
"main",
"page",
"to",
"web",
"search",
"engines",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ShopRdfa.php#L82-L99 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/DeliveryCategoriesAjax.php | DeliveryCategoriesAjax.removeCatFromDel | public function removeCatFromDel()
{
$aChosenCat = $this->_getActionIds('oxobject2delivery.oxid');
// removing all
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
$sQ = $this->_addFilter("delete oxobject2delivery.* " . $this->_getQuery());
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
} elseif (is_array($aChosenCat)) {
$sChosenCategoriess = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aChosenCat));
$sQ = "delete from oxobject2delivery where oxobject2delivery.oxid in (" . $sChosenCategoriess . ") ";
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
}
} | php | public function removeCatFromDel()
{
$aChosenCat = $this->_getActionIds('oxobject2delivery.oxid');
// removing all
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
$sQ = $this->_addFilter("delete oxobject2delivery.* " . $this->_getQuery());
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
} elseif (is_array($aChosenCat)) {
$sChosenCategoriess = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aChosenCat));
$sQ = "delete from oxobject2delivery where oxobject2delivery.oxid in (" . $sChosenCategoriess . ") ";
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
}
} | [
"public",
"function",
"removeCatFromDel",
"(",
")",
"{",
"$",
"aChosenCat",
"=",
"$",
"this",
"->",
"_getActionIds",
"(",
"'oxobject2delivery.oxid'",
")",
";",
"// removing all",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::... | Removes category from delivery configuration | [
"Removes",
"category",
"from",
"delivery",
"configuration"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DeliveryCategoriesAjax.php#L80-L93 | train |
OXID-eSales/oxideshop_ce | source/Core/DebugInfo.php | DebugInfo.formatTemplateData | public function formatTemplateData($viewData = [])
{
$log = '';
reset($viewData);
foreach ($viewData as $viewName => $viewDataObject) {
// show debbuging information
$log .= "TemplateData[$viewName] : <br />\n";
$log .= print_r($viewDataObject, 1);
}
return $log;
} | php | public function formatTemplateData($viewData = [])
{
$log = '';
reset($viewData);
foreach ($viewData as $viewName => $viewDataObject) {
// show debbuging information
$log .= "TemplateData[$viewName] : <br />\n";
$log .= print_r($viewDataObject, 1);
}
return $log;
} | [
"public",
"function",
"formatTemplateData",
"(",
"$",
"viewData",
"=",
"[",
"]",
")",
"{",
"$",
"log",
"=",
"''",
";",
"reset",
"(",
"$",
"viewData",
")",
";",
"foreach",
"(",
"$",
"viewData",
"as",
"$",
"viewName",
"=>",
"$",
"viewDataObject",
")",
... | format template data for debug view
@param array $viewData template data
@return string | [
"format",
"template",
"data",
"for",
"debug",
"view"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/DebugInfo.php#L21-L32 | train |
OXID-eSales/oxideshop_ce | source/Core/DebugInfo.php | DebugInfo.formatMemoryUsage | public function formatMemoryUsage()
{
$log = '';
if (function_exists('memory_get_usage')) {
$kb = ( int ) (memory_get_usage() / 1024);
$mb = round($kb / 1024, 3);
$log .= 'Memory usage: ' . $mb . ' MB';
if (function_exists('memory_get_peak_usage')) {
$peakKb = ( int ) (memory_get_peak_usage() / 1024);
$peakMb = round($peakKb / 1024, 3);
$log .= ' (peak: ' . $peakMb . ' MB)';
}
$log .= '<br />';
if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
$kb = ( int ) (memory_get_usage(true) / 1024);
$mb = round($kb / 1024, 3);
$log .= 'System memory usage: ' . $mb . ' MB';
if (function_exists('memory_get_peak_usage')) {
$peakKb = ( int ) (memory_get_peak_usage(true) / 1024);
$peakMb = round($peakKb / 1024, 3);
$log .= ' (peak: ' . $peakMb . ' MB)';
}
$log .= '<br />';
}
}
return $log;
} | php | public function formatMemoryUsage()
{
$log = '';
if (function_exists('memory_get_usage')) {
$kb = ( int ) (memory_get_usage() / 1024);
$mb = round($kb / 1024, 3);
$log .= 'Memory usage: ' . $mb . ' MB';
if (function_exists('memory_get_peak_usage')) {
$peakKb = ( int ) (memory_get_peak_usage() / 1024);
$peakMb = round($peakKb / 1024, 3);
$log .= ' (peak: ' . $peakMb . ' MB)';
}
$log .= '<br />';
if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
$kb = ( int ) (memory_get_usage(true) / 1024);
$mb = round($kb / 1024, 3);
$log .= 'System memory usage: ' . $mb . ' MB';
if (function_exists('memory_get_peak_usage')) {
$peakKb = ( int ) (memory_get_peak_usage(true) / 1024);
$peakMb = round($peakKb / 1024, 3);
$log .= ' (peak: ' . $peakMb . ' MB)';
}
$log .= '<br />';
}
}
return $log;
} | [
"public",
"function",
"formatMemoryUsage",
"(",
")",
"{",
"$",
"log",
"=",
"''",
";",
"if",
"(",
"function_exists",
"(",
"'memory_get_usage'",
")",
")",
"{",
"$",
"kb",
"=",
"(",
"int",
")",
"(",
"memory_get_usage",
"(",
")",
"/",
"1024",
")",
";",
"... | format memory usage
@return string | [
"format",
"memory",
"usage"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/DebugInfo.php#L39-L69 | train |
OXID-eSales/oxideshop_ce | source/Core/DebugInfo.php | DebugInfo.formatExecutionTime | public function formatExecutionTime($dTotalTime)
{
$log = 'Execution time:' . round($dTotalTime, 4) . '<br />';
global $aProfileTimes;
global $executionCounts;
if (is_array($aProfileTimes)) {
$log .= "----------------------------------------------------------<br>" . PHP_EOL;
arsort($aProfileTimes);
$log .= "<table cellspacing='10px' style='border: 1px solid #000'>";
foreach ($aProfileTimes as $key => $val) {
$log .= "<tr><td style='border-bottom: 1px dotted #000;min-width:300px;'>Profile $key: </td><td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($val, 5) . "s</td>";
if ($dTotalTime) {
$log .= "<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($val * 100 / $dTotalTime, 2) . "%</td>";
}
if ($executionCounts[$key]) {
$log .= " <td style='border-bottom: 1px dotted #000;min-width:50px;padding-right:30px;' align='right'>" . $executionCounts[$key] . "</td>"
. "<td style='border-bottom: 1px dotted #000;min-width:15px; '>*</td>"
. "<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($val / $executionCounts[$key], 5) . "s</td>" . PHP_EOL;
} else {
$log .= " <td colspan=3 style='border-bottom: 1px dotted #000;min-width:100px;'> not stopped correctly! </td>" . PHP_EOL;
}
$log .= '</tr>';
}
$log .= "</table>";
}
return $log;
} | php | public function formatExecutionTime($dTotalTime)
{
$log = 'Execution time:' . round($dTotalTime, 4) . '<br />';
global $aProfileTimes;
global $executionCounts;
if (is_array($aProfileTimes)) {
$log .= "----------------------------------------------------------<br>" . PHP_EOL;
arsort($aProfileTimes);
$log .= "<table cellspacing='10px' style='border: 1px solid #000'>";
foreach ($aProfileTimes as $key => $val) {
$log .= "<tr><td style='border-bottom: 1px dotted #000;min-width:300px;'>Profile $key: </td><td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($val, 5) . "s</td>";
if ($dTotalTime) {
$log .= "<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($val * 100 / $dTotalTime, 2) . "%</td>";
}
if ($executionCounts[$key]) {
$log .= " <td style='border-bottom: 1px dotted #000;min-width:50px;padding-right:30px;' align='right'>" . $executionCounts[$key] . "</td>"
. "<td style='border-bottom: 1px dotted #000;min-width:15px; '>*</td>"
. "<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($val / $executionCounts[$key], 5) . "s</td>" . PHP_EOL;
} else {
$log .= " <td colspan=3 style='border-bottom: 1px dotted #000;min-width:100px;'> not stopped correctly! </td>" . PHP_EOL;
}
$log .= '</tr>';
}
$log .= "</table>";
}
return $log;
} | [
"public",
"function",
"formatExecutionTime",
"(",
"$",
"dTotalTime",
")",
"{",
"$",
"log",
"=",
"'Execution time:'",
".",
"round",
"(",
"$",
"dTotalTime",
",",
"4",
")",
".",
"'<br />'",
";",
"global",
"$",
"aProfileTimes",
";",
"global",
"$",
"executionCoun... | format execution times
@param double $dTotalTime total time
@return string | [
"format",
"execution",
"times"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/DebugInfo.php#L78-L105 | train |
OXID-eSales/oxideshop_ce | source/Core/DebugInfo.php | DebugInfo.formatTimeStamp | public function formatTimeStamp()
{
$log = '';
$className = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView()->getClassName();
$log .= "<div id='" . $className . "_executed'>Executed: " . date('Y-m-d H:i:s') . "</div>";
$log .= "<div id='" . $className . "_timestamp'>Timestamp: " . microtime(true) . "</div>";
return $log;
} | php | public function formatTimeStamp()
{
$log = '';
$className = \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView()->getClassName();
$log .= "<div id='" . $className . "_executed'>Executed: " . date('Y-m-d H:i:s') . "</div>";
$log .= "<div id='" . $className . "_timestamp'>Timestamp: " . microtime(true) . "</div>";
return $log;
} | [
"public",
"function",
"formatTimeStamp",
"(",
")",
"{",
"$",
"log",
"=",
"''",
";",
"$",
"className",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getActiveView",
"(",
")",
"->",
"getClassNam... | Forms view name and timestamp to.
@return string | [
"Forms",
"view",
"name",
"and",
"timestamp",
"to",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/DebugInfo.php#L127-L135 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineVatIdCheck.php | OnlineVatIdCheck.validate | public function validate(\OxidEsales\Eshop\Application\Model\CompanyVatIn $oVatIn)
{
$oCheckVat = new stdClass();
$oCheckVat->countryCode = $oVatIn->getCountryCode();
$oCheckVat->vatNumber = $oVatIn->getNumbers();
$blResult = $this->_checkOnline($oCheckVat);
if (!$blResult) {
$this->setError('ID_NOT_VALID');
}
return $blResult;
} | php | public function validate(\OxidEsales\Eshop\Application\Model\CompanyVatIn $oVatIn)
{
$oCheckVat = new stdClass();
$oCheckVat->countryCode = $oVatIn->getCountryCode();
$oCheckVat->vatNumber = $oVatIn->getNumbers();
$blResult = $this->_checkOnline($oCheckVat);
if (!$blResult) {
$this->setError('ID_NOT_VALID');
}
return $blResult;
} | [
"public",
"function",
"validate",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"CompanyVatIn",
"$",
"oVatIn",
")",
"{",
"$",
"oCheckVat",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"oCheckVat",
"->",
"countryCode",
"="... | Validates VAT.
@param \OxidEsales\Eshop\Application\Model\CompanyVatIn $oVatIn Company VAT identification number object.
@return bool | [
"Validates",
"VAT",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineVatIdCheck.php#L67-L79 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineVatIdCheck.php | OnlineVatIdCheck.catchWarning | public function catchWarning($iErrNo, $sErrStr, $sErrFile, $iErrLine)
{
\OxidEsales\Eshop\Core\Registry::getLogger()->warning($sErrStr, [
'file' => $sErrFile,
'line' => $iErrLine,
'code' => $iErrNo
]);
} | php | public function catchWarning($iErrNo, $sErrStr, $sErrFile, $iErrLine)
{
\OxidEsales\Eshop\Core\Registry::getLogger()->warning($sErrStr, [
'file' => $sErrFile,
'line' => $iErrLine,
'code' => $iErrNo
]);
} | [
"public",
"function",
"catchWarning",
"(",
"$",
"iErrNo",
",",
"$",
"sErrStr",
",",
"$",
"sErrFile",
",",
"$",
"iErrLine",
")",
"{",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLogger",
"(",
")",
"->",
"warning",
"(",
"... | Catches soap warning which is usually thrown due to service problems.
Return true and allows to continue process
@param int $iErrNo error type number
@param string $sErrStr error message
@param string $sErrFile error file
@param int $iErrLine error line | [
"Catches",
"soap",
"warning",
"which",
"is",
"usually",
"thrown",
"due",
"to",
"service",
"problems",
".",
"Return",
"true",
"and",
"allows",
"to",
"continue",
"process"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineVatIdCheck.php#L90-L97 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineVatIdCheck.php | OnlineVatIdCheck._checkOnline | protected function _checkOnline($oCheckVat)
{
if ($this->_isServiceAvailable()) {
$iTryMoreCnt = self::BUSY_RETRY_CNT;
//T2009-07-02
//how long socket should wait for server RESPONSE
ini_set('default_socket_timeout', 5);
// setting local error handler to catch possible soap errors
set_error_handler([$this, 'catchWarning'], E_WARNING);
do {
try {
//connection_timeout = how long we should wait to CONNECT to wsdl server
$oSoapClient = new SoapClient($this->getWsdlUrl(), ["connection_timeout" => 5]);
$this->setError('');
$oRes = $oSoapClient->checkVat($oCheckVat);
$iTryMoreCnt = 0;
} catch (SoapFault $e) {
$this->setError($e->faultstring);
if ($this->getError() == "SERVER_BUSY") {
usleep(self::BUSY_RETRY_WAITUSEC);
} else {
$iTryMoreCnt = 0;
}
}
} while (0 < $iTryMoreCnt--);
// restoring previous error handler
restore_error_handler();
return (bool) $oRes->valid;
} else {
$this->setError("SERVICE_UNREACHABLE");
return false;
}
} | php | protected function _checkOnline($oCheckVat)
{
if ($this->_isServiceAvailable()) {
$iTryMoreCnt = self::BUSY_RETRY_CNT;
//T2009-07-02
//how long socket should wait for server RESPONSE
ini_set('default_socket_timeout', 5);
// setting local error handler to catch possible soap errors
set_error_handler([$this, 'catchWarning'], E_WARNING);
do {
try {
//connection_timeout = how long we should wait to CONNECT to wsdl server
$oSoapClient = new SoapClient($this->getWsdlUrl(), ["connection_timeout" => 5]);
$this->setError('');
$oRes = $oSoapClient->checkVat($oCheckVat);
$iTryMoreCnt = 0;
} catch (SoapFault $e) {
$this->setError($e->faultstring);
if ($this->getError() == "SERVER_BUSY") {
usleep(self::BUSY_RETRY_WAITUSEC);
} else {
$iTryMoreCnt = 0;
}
}
} while (0 < $iTryMoreCnt--);
// restoring previous error handler
restore_error_handler();
return (bool) $oRes->valid;
} else {
$this->setError("SERVICE_UNREACHABLE");
return false;
}
} | [
"protected",
"function",
"_checkOnline",
"(",
"$",
"oCheckVat",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_isServiceAvailable",
"(",
")",
")",
"{",
"$",
"iTryMoreCnt",
"=",
"self",
"::",
"BUSY_RETRY_CNT",
";",
"//T2009-07-02",
"//how long socket should wait for ser... | Checks online if USt.ID number is valid.
Returns true on success. On error sets error value.
@param object $oCheckVat vat object
@return bool | [
"Checks",
"online",
"if",
"USt",
".",
"ID",
"number",
"is",
"valid",
".",
"Returns",
"true",
"on",
"success",
".",
"On",
"error",
"sets",
"error",
"value",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineVatIdCheck.php#L144-L182 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineVatIdCheck.php | OnlineVatIdCheck.getWsdlUrl | public function getWsdlUrl()
{
// overriding wsdl url
if (($sWsdl = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("sVatIdCheckInterfaceWsdl"))) {
$this->_sWsdl = $sWsdl;
}
return $this->_sWsdl;
} | php | public function getWsdlUrl()
{
// overriding wsdl url
if (($sWsdl = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("sVatIdCheckInterfaceWsdl"))) {
$this->_sWsdl = $sWsdl;
}
return $this->_sWsdl;
} | [
"public",
"function",
"getWsdlUrl",
"(",
")",
"{",
"// overriding wsdl url",
"if",
"(",
"(",
"$",
"sWsdl",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"\"sVatIdCheckInterface... | Returns wsdl url
@return string | [
"Returns",
"wsdl",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineVatIdCheck.php#L189-L197 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/VoucherSerieExport.php | VoucherSerieExport.getDownloadUrl | public function getDownloadUrl()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// override cause of admin dir
$sUrl = $myConfig->getConfigParam('sShopURL') . $myConfig->getConfigParam('sAdminDir');
if ($myConfig->getConfigParam('sAdminSSLURL')) {
$sUrl = $myConfig->getConfigParam('sAdminSSLURL');
}
$sUrl = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($sUrl . '/index.php');
return $sUrl . '&cl=' . $this->sClassDo . '&fnc=download';
} | php | public function getDownloadUrl()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
// override cause of admin dir
$sUrl = $myConfig->getConfigParam('sShopURL') . $myConfig->getConfigParam('sAdminDir');
if ($myConfig->getConfigParam('sAdminSSLURL')) {
$sUrl = $myConfig->getConfigParam('sAdminSSLURL');
}
$sUrl = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->processUrl($sUrl . '/index.php');
return $sUrl . '&cl=' . $this->sClassDo . '&fnc=download';
} | [
"public",
"function",
"getDownloadUrl",
"(",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"// override cause of admin dir",
"$",
"sUrl",
"=",
"$",
"myConfig",
"->",
"getC... | Returns export file download url
@return string | [
"Returns",
"export",
"file",
"download",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/VoucherSerieExport.php#L64-L77 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/VoucherSerieExport.php | VoucherSerieExport._getExportFileName | protected function _getExportFileName()
{
$sSessionFileName = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("sExportFileName");
if (!$sSessionFileName) {
$sSessionFileName = md5($this->getSession()->getId() . \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId());
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sExportFileName", $sSessionFileName);
}
return $sSessionFileName;
} | php | protected function _getExportFileName()
{
$sSessionFileName = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("sExportFileName");
if (!$sSessionFileName) {
$sSessionFileName = md5($this->getSession()->getId() . \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId());
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sExportFileName", $sSessionFileName);
}
return $sSessionFileName;
} | [
"protected",
"function",
"_getExportFileName",
"(",
")",
"{",
"$",
"sSessionFileName",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getSession",
"(",
")",
"->",
"getVariable",
"(",
"\"sExportFileName\"",
")",
";",
"if",
"(",
... | Return export file name
@return string | [
"Return",
"export",
"file",
"name"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/VoucherSerieExport.php#L84-L93 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/VoucherSerieExport.php | VoucherSerieExport.download | public function download()
{
$oUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
$oUtils->setHeader("Pragma: public");
$oUtils->setHeader("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$oUtils->setHeader("Expires: 0");
$oUtils->setHeader("Content-Disposition: attachment; filename=vouchers.csv");
$oUtils->setHeader("Content-Type: application/csv");
$sFile = $this->_getExportFilePath();
if (file_exists($sFile) && is_readable($sFile)) {
readfile($sFile);
}
$oUtils->showMessageAndExit("");
} | php | public function download()
{
$oUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
$oUtils->setHeader("Pragma: public");
$oUtils->setHeader("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$oUtils->setHeader("Expires: 0");
$oUtils->setHeader("Content-Disposition: attachment; filename=vouchers.csv");
$oUtils->setHeader("Content-Type: application/csv");
$sFile = $this->_getExportFilePath();
if (file_exists($sFile) && is_readable($sFile)) {
readfile($sFile);
}
$oUtils->showMessageAndExit("");
} | [
"public",
"function",
"download",
"(",
")",
"{",
"$",
"oUtils",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtils",
"(",
")",
";",
"$",
"oUtils",
"->",
"setHeader",
"(",
"\"Pragma: public\"",
")",
";",
"$",
"oUtils",... | Performs Voucherserie export to export file. | [
"Performs",
"Voucherserie",
"export",
"to",
"export",
"file",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/VoucherSerieExport.php#L108-L121 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/VoucherSerieExport.php | VoucherSerieExport.exportVouchers | public function exportVouchers($iStart)
{
$iExported = false;
if ($oSerie = $this->_getVoucherSerie()) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$sSelect = "select oxvouchernr from oxvouchers where oxvoucherserieid = " . $oDb->quote($oSerie->getId());
$rs = $oDb->selectLimit($sSelect, $this->iExportPerTick, $iStart);
if (!$rs->EOF) {
$iExported = 0;
// writing header text
if ($iStart == 0) {
$this->write(\OxidEsales\Eshop\Core\Registry::getLang()->translateString("VOUCHERSERIE_MAIN_VOUCHERSTATISTICS", \OxidEsales\Eshop\Core\Registry::getLang()->getTplLanguage(), true));
}
}
// writing vouchers..
while (!$rs->EOF) {
$this->write(current($rs->fields));
$iExported++;
$rs->fetchRow();
}
}
return $iExported;
} | php | public function exportVouchers($iStart)
{
$iExported = false;
if ($oSerie = $this->_getVoucherSerie()) {
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$sSelect = "select oxvouchernr from oxvouchers where oxvoucherserieid = " . $oDb->quote($oSerie->getId());
$rs = $oDb->selectLimit($sSelect, $this->iExportPerTick, $iStart);
if (!$rs->EOF) {
$iExported = 0;
// writing header text
if ($iStart == 0) {
$this->write(\OxidEsales\Eshop\Core\Registry::getLang()->translateString("VOUCHERSERIE_MAIN_VOUCHERSTATISTICS", \OxidEsales\Eshop\Core\Registry::getLang()->getTplLanguage(), true));
}
}
// writing vouchers..
while (!$rs->EOF) {
$this->write(current($rs->fields));
$iExported++;
$rs->fetchRow();
}
}
return $iExported;
} | [
"public",
"function",
"exportVouchers",
"(",
"$",
"iStart",
")",
"{",
"$",
"iExported",
"=",
"false",
";",
"if",
"(",
"$",
"oSerie",
"=",
"$",
"this",
"->",
"_getVoucherSerie",
"(",
")",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"... | Writes voucher number information to export file and returns number of written records info
@param int $iStart start exporting from
@return int | [
"Writes",
"voucher",
"number",
"information",
"to",
"export",
"file",
"and",
"returns",
"number",
"of",
"written",
"records",
"info"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/VoucherSerieExport.php#L164-L192 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller.activate | public function activate(\OxidEsales\Eshop\Core\Module\Module $module)
{
$result = false;
if ($moduleId = $module->getId()) {
$this->_addExtensions($module);
$this->_removeFromDisabledList($moduleId);
if (version_compare($module->getMetaDataVersion(), '2.0', '<')) {
/** Support for the key 'files' was removed in MetaData version 2.0 */
$this->_addModuleFiles($module->getInfo("files"), $moduleId);
}
$this->_addTemplateBlocks($module->getInfo("blocks"), $moduleId);
$this->_addTemplateFiles($module->getInfo("templates"), $moduleId);
$settingsHandler = oxNew(SettingsHandler::class);
$settingsHandler->setModuleType('module')->run($module);
$this->_addModuleVersion($module->getInfo("version"), $moduleId);
$this->_addModuleExtensions($module->getExtensions(), $moduleId);
$this->_addModuleEvents($module->getInfo("events"), $moduleId);
if (version_compare($module->getMetaDataVersion(), '2.0', '>=')) {
try {
/** Support for the key 'controllers' was added in MetaData version 2.0 */
$this->addModuleControllers($module->getControllers(), $moduleId);
} catch (ModuleValidationException $exception) {
$this->deactivate($module);
$lang = Registry::getLang();
$message = sprintf($lang->translateString('ERROR_METADATA_CONTROLLERS_NOT_UNIQUE', null, true), $exception->getMessage());
$standardException = oxNew(StandardException::class);
$standardException->setMessage($message);
throw $standardException;
}
}
if (version_compare($module->getMetaDataVersion(), '2.1', '>=')) {
try {
$this->addModuleSmartyPluginDirectories($module);
} catch (\Exception $exception) {
$this->deactivate($module);
throw oxNew(StandardException::class, $exception->getMessage());
}
}
$this->activateShopAwareServices($module);
$this->resetCache();
$this->_callEvent('onActivate', $moduleId);
$result = true;
}
return $result;
} | php | public function activate(\OxidEsales\Eshop\Core\Module\Module $module)
{
$result = false;
if ($moduleId = $module->getId()) {
$this->_addExtensions($module);
$this->_removeFromDisabledList($moduleId);
if (version_compare($module->getMetaDataVersion(), '2.0', '<')) {
/** Support for the key 'files' was removed in MetaData version 2.0 */
$this->_addModuleFiles($module->getInfo("files"), $moduleId);
}
$this->_addTemplateBlocks($module->getInfo("blocks"), $moduleId);
$this->_addTemplateFiles($module->getInfo("templates"), $moduleId);
$settingsHandler = oxNew(SettingsHandler::class);
$settingsHandler->setModuleType('module')->run($module);
$this->_addModuleVersion($module->getInfo("version"), $moduleId);
$this->_addModuleExtensions($module->getExtensions(), $moduleId);
$this->_addModuleEvents($module->getInfo("events"), $moduleId);
if (version_compare($module->getMetaDataVersion(), '2.0', '>=')) {
try {
/** Support for the key 'controllers' was added in MetaData version 2.0 */
$this->addModuleControllers($module->getControllers(), $moduleId);
} catch (ModuleValidationException $exception) {
$this->deactivate($module);
$lang = Registry::getLang();
$message = sprintf($lang->translateString('ERROR_METADATA_CONTROLLERS_NOT_UNIQUE', null, true), $exception->getMessage());
$standardException = oxNew(StandardException::class);
$standardException->setMessage($message);
throw $standardException;
}
}
if (version_compare($module->getMetaDataVersion(), '2.1', '>=')) {
try {
$this->addModuleSmartyPluginDirectories($module);
} catch (\Exception $exception) {
$this->deactivate($module);
throw oxNew(StandardException::class, $exception->getMessage());
}
}
$this->activateShopAwareServices($module);
$this->resetCache();
$this->_callEvent('onActivate', $moduleId);
$result = true;
}
return $result;
} | [
"public",
"function",
"activate",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Module",
"\\",
"Module",
"$",
"module",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"$",
"moduleId",
"=",
"$",
"module",
"->",
"getId",
"(",
")"... | Activate extension by merging module class inheritance information with shop module array
@param \OxidEsales\Eshop\Core\Module\Module $module
@return bool | [
"Activate",
"extension",
"by",
"merging",
"module",
"class",
"inheritance",
"information",
"with",
"shop",
"module",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L81-L137 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller.deactivate | public function deactivate(\OxidEsales\Eshop\Core\Module\Module $module)
{
$result = false;
if ($moduleId = $module->getId()) {
$this->_callEvent('onDeactivate', $moduleId);
$this->_addToDisabledList($moduleId);
//removing recoverable options
$this->_deleteBlock($moduleId);
$this->_deleteTemplateFiles($moduleId);
$this->_deleteModuleFiles($moduleId);
$this->_deleteModuleEvents($moduleId);
$this->_deleteModuleVersions($moduleId);
$this->deleteModuleControllers($moduleId);
$this->deleteModuleSmartyPluginDirectories($moduleId);
$this->deactivateShopAwareServices($module);
$this->resetCache();
$result = true;
}
return $result;
} | php | public function deactivate(\OxidEsales\Eshop\Core\Module\Module $module)
{
$result = false;
if ($moduleId = $module->getId()) {
$this->_callEvent('onDeactivate', $moduleId);
$this->_addToDisabledList($moduleId);
//removing recoverable options
$this->_deleteBlock($moduleId);
$this->_deleteTemplateFiles($moduleId);
$this->_deleteModuleFiles($moduleId);
$this->_deleteModuleEvents($moduleId);
$this->_deleteModuleVersions($moduleId);
$this->deleteModuleControllers($moduleId);
$this->deleteModuleSmartyPluginDirectories($moduleId);
$this->deactivateShopAwareServices($module);
$this->resetCache();
$result = true;
}
return $result;
} | [
"public",
"function",
"deactivate",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Module",
"\\",
"Module",
"$",
"module",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"$",
"moduleId",
"=",
"$",
"module",
"->",
"getId",
"(",
"... | Deactivate extension by adding disable module class information to disabled module array
@param \OxidEsales\Eshop\Core\Module\Module $module
@return bool | [
"Deactivate",
"extension",
"by",
"adding",
"disable",
"module",
"class",
"information",
"to",
"disabled",
"module",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L166-L191 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._addToDisabledList | protected function _addToDisabledList($sModuleId)
{
$aDisabledModules = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aDisabledModules');
$aModules = array_merge($aDisabledModules, [$sModuleId]);
$aModules = array_unique($aModules);
$this->_saveToConfig('aDisabledModules', $aModules, 'arr');
} | php | protected function _addToDisabledList($sModuleId)
{
$aDisabledModules = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aDisabledModules');
$aModules = array_merge($aDisabledModules, [$sModuleId]);
$aModules = array_unique($aModules);
$this->_saveToConfig('aDisabledModules', $aModules, 'arr');
} | [
"protected",
"function",
"_addToDisabledList",
"(",
"$",
"sModuleId",
")",
"{",
"$",
"aDisabledModules",
"=",
"(",
"array",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'aD... | Add module to disable list
@param string $sModuleId Module id | [
"Add",
"module",
"to",
"disable",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L275-L283 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._deleteModule | protected function _deleteModule($sModuleId)
{
$aExt = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesWithExtendedClass();
$aUpdatedExt = $this->diffModuleArrays($aExt, $sModuleId);
$aUpdatedExt = $this->buildModuleChains($aUpdatedExt);
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModules', $aUpdatedExt);
} | php | protected function _deleteModule($sModuleId)
{
$aExt = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesWithExtendedClass();
$aUpdatedExt = $this->diffModuleArrays($aExt, $sModuleId);
$aUpdatedExt = $this->buildModuleChains($aUpdatedExt);
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModules', $aUpdatedExt);
} | [
"protected",
"function",
"_deleteModule",
"(",
"$",
"sModuleId",
")",
"{",
"$",
"aExt",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getModulesWithExtendedClass",
"(",
")",
";",
"$",
"aUpdatedExt... | Removes extension from modules array.
@deprecated on b-dev, This method is not used in code.
@param string $sModuleId Module id | [
"Removes",
"extension",
"from",
"modules",
"array",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L292-L300 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._deleteBlock | protected function _deleteBlock($sModuleId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$oDb->execute("DELETE FROM `oxtplblocks` WHERE `oxmodule` =" . $oDb->quote($sModuleId) . " AND `oxshopid` = " . $oDb->quote($sShopId));
} | php | protected function _deleteBlock($sModuleId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$oDb->execute("DELETE FROM `oxtplblocks` WHERE `oxmodule` =" . $oDb->quote($sModuleId) . " AND `oxshopid` = " . $oDb->quote($sShopId));
} | [
"protected",
"function",
"_deleteBlock",
"(",
"$",
"sModuleId",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sShopId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\... | Deactivates or activates oxBlocks of a module
@todo extract oxtplblocks query to ModuleTemplateBlockRepository
@param string $sModuleId Module id | [
"Deactivates",
"or",
"activates",
"oxBlocks",
"of",
"a",
"module"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L309-L314 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._deleteModuleFiles | protected function _deleteModuleFiles($sModuleId)
{
$aFiles = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleFiles');
unset($aFiles[$sModuleId]);
$this->_saveToConfig('aModuleFiles', $aFiles);
} | php | protected function _deleteModuleFiles($sModuleId)
{
$aFiles = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleFiles');
unset($aFiles[$sModuleId]);
$this->_saveToConfig('aModuleFiles', $aFiles);
} | [
"protected",
"function",
"_deleteModuleFiles",
"(",
"$",
"sModuleId",
")",
"{",
"$",
"aFiles",
"=",
"(",
"array",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'aModuleFiles... | Add module files
@param string $sModuleId Module id | [
"Add",
"module",
"files"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L334-L340 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._deleteModuleEvents | protected function _deleteModuleEvents($sModuleId)
{
$aEvents = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleEvents');
unset($aEvents[$sModuleId]);
$this->_saveToConfig('aModuleEvents', $aEvents);
} | php | protected function _deleteModuleEvents($sModuleId)
{
$aEvents = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleEvents');
unset($aEvents[$sModuleId]);
$this->_saveToConfig('aModuleEvents', $aEvents);
} | [
"protected",
"function",
"_deleteModuleEvents",
"(",
"$",
"sModuleId",
")",
"{",
"$",
"aEvents",
"=",
"(",
"array",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'aModuleEve... | Removes module events
@param string $sModuleId Module id | [
"Removes",
"module",
"events"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L347-L353 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._deleteModuleVersions | protected function _deleteModuleVersions($sModuleId)
{
$aVersions = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleVersions');
unset($aVersions[$sModuleId]);
$this->_saveToConfig('aModuleVersions', $aVersions);
} | php | protected function _deleteModuleVersions($sModuleId)
{
$aVersions = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleVersions');
unset($aVersions[$sModuleId]);
$this->_saveToConfig('aModuleVersions', $aVersions);
} | [
"protected",
"function",
"_deleteModuleVersions",
"(",
"$",
"sModuleId",
")",
"{",
"$",
"aVersions",
"=",
"(",
"array",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'aModul... | Removes module versions
@param string $sModuleId Module id | [
"Removes",
"module",
"versions"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L360-L366 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._removeFromDisabledList | protected function _removeFromDisabledList($sModuleId)
{
$aDisabledModules = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aDisabledModules');
if (isset($aDisabledModules) && is_array($aDisabledModules)) {
$aDisabledModules = array_diff($aDisabledModules, [$sModuleId]);
$this->_saveToConfig('aDisabledModules', $aDisabledModules, 'arr');
}
} | php | protected function _removeFromDisabledList($sModuleId)
{
$aDisabledModules = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aDisabledModules');
if (isset($aDisabledModules) && is_array($aDisabledModules)) {
$aDisabledModules = array_diff($aDisabledModules, [$sModuleId]);
$this->_saveToConfig('aDisabledModules', $aDisabledModules, 'arr');
}
} | [
"protected",
"function",
"_removeFromDisabledList",
"(",
"$",
"sModuleId",
")",
"{",
"$",
"aDisabledModules",
"=",
"(",
"array",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
... | Removes module from disabled module list
@param string $sModuleId Module id | [
"Removes",
"module",
"from",
"disabled",
"module",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L424-L432 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._addModuleFiles | protected function _addModuleFiles($aModuleFiles, $sModuleId)
{
$aFiles = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleFiles');
if (is_array($aModuleFiles)) {
$aFiles[$sModuleId] = array_change_key_case($aModuleFiles, CASE_LOWER);
}
$this->_saveToConfig('aModuleFiles', $aFiles);
} | php | protected function _addModuleFiles($aModuleFiles, $sModuleId)
{
$aFiles = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleFiles');
if (is_array($aModuleFiles)) {
$aFiles[$sModuleId] = array_change_key_case($aModuleFiles, CASE_LOWER);
}
$this->_saveToConfig('aModuleFiles', $aFiles);
} | [
"protected",
"function",
"_addModuleFiles",
"(",
"$",
"aModuleFiles",
",",
"$",
"sModuleId",
")",
"{",
"$",
"aFiles",
"=",
"(",
"array",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigPa... | Add module files to config for auto loader.
@param array $aModuleFiles Module files array
@param string $sModuleId Module id | [
"Add",
"module",
"files",
"to",
"config",
"for",
"auto",
"loader",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L506-L515 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._callEvent | protected function _callEvent($sEvent, $sModuleId)
{
$aModuleEvents = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleEvents');
if (isset($aModuleEvents[$sModuleId], $aModuleEvents[$sModuleId][$sEvent])) {
$mEvent = $aModuleEvents[$sModuleId][$sEvent];
if (is_callable($mEvent)) {
call_user_func($mEvent);
}
}
} | php | protected function _callEvent($sEvent, $sModuleId)
{
$aModuleEvents = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleEvents');
if (isset($aModuleEvents[$sModuleId], $aModuleEvents[$sModuleId][$sEvent])) {
$mEvent = $aModuleEvents[$sModuleId][$sEvent];
if (is_callable($mEvent)) {
call_user_func($mEvent);
}
}
} | [
"protected",
"function",
"_callEvent",
"(",
"$",
"sEvent",
",",
"$",
"sModuleId",
")",
"{",
"$",
"aModuleEvents",
"=",
"(",
"array",
")",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam"... | Call module event.
@param string $sEvent Event name
@param string $sModuleId Module Id | [
"Call",
"module",
"event",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L614-L625 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller._saveToConfig | protected function _saveToConfig($sVariableName, $sVariableValue, $sVariableType = 'aarr')
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$oConfig->saveShopConfVar($sVariableType, $sVariableName, $sVariableValue);
} | php | protected function _saveToConfig($sVariableName, $sVariableValue, $sVariableType = 'aarr')
{
$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$oConfig->saveShopConfVar($sVariableType, $sVariableName, $sVariableValue);
} | [
"protected",
"function",
"_saveToConfig",
"(",
"$",
"sVariableName",
",",
"$",
"sVariableValue",
",",
"$",
"sVariableType",
"=",
"'aarr'",
")",
"{",
"$",
"oConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(... | Save module parameters to shop config
@param string $sVariableName config name
@param string $sVariableValue config value
@param string $sVariableType config type | [
"Save",
"module",
"parameters",
"to",
"shop",
"config"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L649-L653 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller.validateModuleMetadataControllersOnActivation | protected function validateModuleMetadataControllersOnActivation($moduleControllers)
{
$moduleControllerMapProvider = $this->getModuleControllerMapProvider();
$shopControllerMapProvider = $this->getShopControllerMapProvider();
$moduleControllerMap = $moduleControllerMapProvider->getControllerMap();
$shopControllerMap = $shopControllerMapProvider->getControllerMap();
$existingMaps = array_merge($moduleControllerMap, $shopControllerMap);
/**
* Ensure, that controller keys are unique.
* As keys are always stored in lower case, we must test against lower case keys here as well
*/
$duplicatedKeys = array_intersect_key(array_change_key_case($moduleControllers, CASE_LOWER), $existingMaps);
if (!empty($duplicatedKeys)) {
throw new \OxidEsales\Eshop\Core\Exception\ModuleValidationException(implode(',', $duplicatedKeys));
}
/**
* Ensure, that controller values are unique.
*/
$duplicatedValues = array_intersect($moduleControllers, $existingMaps);
if (!empty($duplicatedValues)) {
throw new \OxidEsales\Eshop\Core\Exception\ModuleValidationException(implode(',', $duplicatedValues));
}
} | php | protected function validateModuleMetadataControllersOnActivation($moduleControllers)
{
$moduleControllerMapProvider = $this->getModuleControllerMapProvider();
$shopControllerMapProvider = $this->getShopControllerMapProvider();
$moduleControllerMap = $moduleControllerMapProvider->getControllerMap();
$shopControllerMap = $shopControllerMapProvider->getControllerMap();
$existingMaps = array_merge($moduleControllerMap, $shopControllerMap);
/**
* Ensure, that controller keys are unique.
* As keys are always stored in lower case, we must test against lower case keys here as well
*/
$duplicatedKeys = array_intersect_key(array_change_key_case($moduleControllers, CASE_LOWER), $existingMaps);
if (!empty($duplicatedKeys)) {
throw new \OxidEsales\Eshop\Core\Exception\ModuleValidationException(implode(',', $duplicatedKeys));
}
/**
* Ensure, that controller values are unique.
*/
$duplicatedValues = array_intersect($moduleControllers, $existingMaps);
if (!empty($duplicatedValues)) {
throw new \OxidEsales\Eshop\Core\Exception\ModuleValidationException(implode(',', $duplicatedValues));
}
} | [
"protected",
"function",
"validateModuleMetadataControllersOnActivation",
"(",
"$",
"moduleControllers",
")",
"{",
"$",
"moduleControllerMapProvider",
"=",
"$",
"this",
"->",
"getModuleControllerMapProvider",
"(",
")",
";",
"$",
"shopControllerMapProvider",
"=",
"$",
"thi... | Ensure integrity of the controllerMap before storing it.
Both keys and values must be unique with in the same shop or sub-shop.
@param array $moduleControllers
@throws ModuleValidationException | [
"Ensure",
"integrity",
"of",
"the",
"controllerMap",
"before",
"storing",
"it",
".",
"Both",
"keys",
"and",
"values",
"must",
"be",
"unique",
"with",
"in",
"the",
"same",
"shop",
"or",
"sub",
"-",
"shop",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L699-L725 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleInstaller.php | ModuleInstaller.validateMetadataExtendSection | protected function validateMetadataExtendSection(\OxidEsales\Eshop\Core\Module\Module $module)
{
$validator = $this->getModuleMetadataValidator();
$validator->checkModuleExtensionsForIncorrectNamespaceClasses($module);
} | php | protected function validateMetadataExtendSection(\OxidEsales\Eshop\Core\Module\Module $module)
{
$validator = $this->getModuleMetadataValidator();
$validator->checkModuleExtensionsForIncorrectNamespaceClasses($module);
} | [
"protected",
"function",
"validateMetadataExtendSection",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Module",
"\\",
"Module",
"$",
"module",
")",
"{",
"$",
"validator",
"=",
"$",
"this",
"->",
"getModuleMetadataValidator",
"(",
")",
";",
"$",... | Validate module metadata extend section.
Only Unified Namespace shop classes are free to patch.
@param \OxidEsales\Eshop\Core\Module\Module $module
@throws ModuleValidationException | [
"Validate",
"module",
"metadata",
"extend",
"section",
".",
"Only",
"Unified",
"Namespace",
"shop",
"classes",
"are",
"free",
"to",
"patch",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleInstaller.php#L735-L739 | train |
OXID-eSales/oxideshop_ce | source/Core/Form/UpdatableFieldsConstructor.php | UpdatableFieldsConstructor.getAllowedFieldsCleaner | public function getAllowedFieldsCleaner(AbstractUpdatableFields $updatableFields)
{
$helper = oxNew(FieldNameHelper::class);
$allowedFields = $helper->getFullFieldNames($updatableFields->getTableName(), $updatableFields->getUpdatableFields());
$updatableFields = oxNew(\OxidEsales\Eshop\Core\Form\FormFields::class, $allowedFields);
return oxNew(\OxidEsales\Eshop\Core\Form\FormFieldsCleaner::class, $updatableFields);
} | php | public function getAllowedFieldsCleaner(AbstractUpdatableFields $updatableFields)
{
$helper = oxNew(FieldNameHelper::class);
$allowedFields = $helper->getFullFieldNames($updatableFields->getTableName(), $updatableFields->getUpdatableFields());
$updatableFields = oxNew(\OxidEsales\Eshop\Core\Form\FormFields::class, $allowedFields);
return oxNew(\OxidEsales\Eshop\Core\Form\FormFieldsCleaner::class, $updatableFields);
} | [
"public",
"function",
"getAllowedFieldsCleaner",
"(",
"AbstractUpdatableFields",
"$",
"updatableFields",
")",
"{",
"$",
"helper",
"=",
"oxNew",
"(",
"FieldNameHelper",
"::",
"class",
")",
";",
"$",
"allowedFields",
"=",
"$",
"helper",
"->",
"getFullFieldNames",
"(... | Get cleaner for field list which are allowed to be submitted in a form.
@param AbstractUpdatableFields $updatableFields
@return FormFieldsCleaner | [
"Get",
"cleaner",
"for",
"field",
"list",
"which",
"are",
"allowed",
"to",
"be",
"submitted",
"in",
"a",
"form",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Form/UpdatableFieldsConstructor.php#L24-L32 | train |
OXID-eSales/oxideshop_ce | source/Core/SeoDecoder.php | SeoDecoder.parseStdUrl | public function parseStdUrl($sUrl)
{
$oStr = getStr();
$aRet = [];
$sUrl = $oStr->html_entity_decode($sUrl);
if (($iPos = strpos($sUrl, '?')) !== false) {
parse_str($oStr->substr($sUrl, $iPos + 1), $aRet);
}
return $aRet;
} | php | public function parseStdUrl($sUrl)
{
$oStr = getStr();
$aRet = [];
$sUrl = $oStr->html_entity_decode($sUrl);
if (($iPos = strpos($sUrl, '?')) !== false) {
parse_str($oStr->substr($sUrl, $iPos + 1), $aRet);
}
return $aRet;
} | [
"public",
"function",
"parseStdUrl",
"(",
"$",
"sUrl",
")",
"{",
"$",
"oStr",
"=",
"getStr",
"(",
")",
";",
"$",
"aRet",
"=",
"[",
"]",
";",
"$",
"sUrl",
"=",
"$",
"oStr",
"->",
"html_entity_decode",
"(",
"$",
"sUrl",
")",
";",
"if",
"(",
"(",
... | _parseStdUrl parses given url into array of params
@param string $sUrl given url
@access protected
@return array | [
"_parseStdUrl",
"parses",
"given",
"url",
"into",
"array",
"of",
"params"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoDecoder.php#L22-L33 | train |
OXID-eSales/oxideshop_ce | source/Core/SeoDecoder.php | SeoDecoder.decodeUrl | public function decodeUrl($seoUrl)
{
$stringObject = getStr();
$baseUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL();
if ($stringObject->strpos($seoUrl, $baseUrl) === 0) {
$seoUrl = $stringObject->substr($seoUrl, $stringObject->strlen($baseUrl));
}
$seoUrl = rawurldecode($seoUrl);
//extract page number from seo url
list($seoUrl, $pageNumber) = $this->extractPageNumberFromSeoUrl($seoUrl);
$shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$key = $this->_getIdent($seoUrl);
$urlParameters = false;
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$resultSet = $database->select("select oxstdurl, oxlang from oxseo where oxident=" . $database->quote($key) . " and oxshopid='$shopId' limit 1");
if (!$resultSet->EOF) {
// primary seo language changed ?
$urlParameters = $this->parseStdUrl($resultSet->fields['oxstdurl']);
$urlParameters['lang'] = $resultSet->fields['oxlang'];
}
if (is_array($urlParameters) && !is_null($pageNumber) && (1 < $pageNumber)) {
$urlParameters['pgNr'] = $pageNumber;
}
return $urlParameters;
} | php | public function decodeUrl($seoUrl)
{
$stringObject = getStr();
$baseUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL();
if ($stringObject->strpos($seoUrl, $baseUrl) === 0) {
$seoUrl = $stringObject->substr($seoUrl, $stringObject->strlen($baseUrl));
}
$seoUrl = rawurldecode($seoUrl);
//extract page number from seo url
list($seoUrl, $pageNumber) = $this->extractPageNumberFromSeoUrl($seoUrl);
$shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$key = $this->_getIdent($seoUrl);
$urlParameters = false;
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$resultSet = $database->select("select oxstdurl, oxlang from oxseo where oxident=" . $database->quote($key) . " and oxshopid='$shopId' limit 1");
if (!$resultSet->EOF) {
// primary seo language changed ?
$urlParameters = $this->parseStdUrl($resultSet->fields['oxstdurl']);
$urlParameters['lang'] = $resultSet->fields['oxlang'];
}
if (is_array($urlParameters) && !is_null($pageNumber) && (1 < $pageNumber)) {
$urlParameters['pgNr'] = $pageNumber;
}
return $urlParameters;
} | [
"public",
"function",
"decodeUrl",
"(",
"$",
"seoUrl",
")",
"{",
"$",
"stringObject",
"=",
"getStr",
"(",
")",
";",
"$",
"baseUrl",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getShopURL",
... | decodeUrl decodes given url into oxid eShop required parameters which are returned as array
@param string $seoUrl SEO url
@access public
@return array || false | [
"decodeUrl",
"decodes",
"given",
"url",
"into",
"oxid",
"eShop",
"required",
"parameters",
"which",
"are",
"returned",
"as",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoDecoder.php#L56-L84 | train |
OXID-eSales/oxideshop_ce | source/Core/SeoDecoder.php | SeoDecoder._decodeOldUrl | protected function _decodeOldUrl($seoUrl)
{
$stringObject = getStr();
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$baseUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL();
if ($stringObject->strpos($seoUrl, $baseUrl) === 0) {
$seoUrl = $stringObject->substr($seoUrl, $stringObject->strlen($baseUrl));
}
$shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$seoUrl = rawurldecode($seoUrl);
//extract page number from seo url
list($seoUrl, $pageNumber) = $this->extractPageNumberFromSeoUrl($seoUrl);
$key = $this->_getIdent($seoUrl, true);
$url = false;
$resultSet = $database->select("select oxobjectid, oxlang from oxseohistory where oxident = " . $database->quote($key) . " and oxshopid = '{$shopId}' limit 1");
if (!$resultSet->EOF) {
// updating hit info (oxtimestamp field will be updated automatically)
$database->execute("update oxseohistory set oxhits = oxhits + 1 where oxident = " . $database->quote($key) . " and oxshopid = '{$shopId}' limit 1");
// fetching new url
$url = $this->_getSeoUrl($resultSet->fields['oxobjectid'], $resultSet->fields['oxlang'], $shopId);
// appending with $_SERVER["QUERY_STRING"]
$url = $this->_addQueryString($url);
}
if ($url && !is_null($pageNumber)) {
$url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->appendUrl($url, ['pgNr' => $pageNumber]);
}
return $url;
} | php | protected function _decodeOldUrl($seoUrl)
{
$stringObject = getStr();
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$baseUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL();
if ($stringObject->strpos($seoUrl, $baseUrl) === 0) {
$seoUrl = $stringObject->substr($seoUrl, $stringObject->strlen($baseUrl));
}
$shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
$seoUrl = rawurldecode($seoUrl);
//extract page number from seo url
list($seoUrl, $pageNumber) = $this->extractPageNumberFromSeoUrl($seoUrl);
$key = $this->_getIdent($seoUrl, true);
$url = false;
$resultSet = $database->select("select oxobjectid, oxlang from oxseohistory where oxident = " . $database->quote($key) . " and oxshopid = '{$shopId}' limit 1");
if (!$resultSet->EOF) {
// updating hit info (oxtimestamp field will be updated automatically)
$database->execute("update oxseohistory set oxhits = oxhits + 1 where oxident = " . $database->quote($key) . " and oxshopid = '{$shopId}' limit 1");
// fetching new url
$url = $this->_getSeoUrl($resultSet->fields['oxobjectid'], $resultSet->fields['oxlang'], $shopId);
// appending with $_SERVER["QUERY_STRING"]
$url = $this->_addQueryString($url);
}
if ($url && !is_null($pageNumber)) {
$url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->appendUrl($url, ['pgNr' => $pageNumber]);
}
return $url;
} | [
"protected",
"function",
"_decodeOldUrl",
"(",
"$",
"seoUrl",
")",
"{",
"$",
"stringObject",
"=",
"getStr",
"(",
")",
";",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
"\\",
"OxidEsale... | Checks if url is stored in history table and if it was found - tries
to fetch new url from seo table
@param string $seoUrl SEO url
@access public
@return string || false | [
"Checks",
"if",
"url",
"is",
"stored",
"in",
"history",
"table",
"and",
"if",
"it",
"was",
"found",
"-",
"tries",
"to",
"fetch",
"new",
"url",
"from",
"seo",
"table"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoDecoder.php#L95-L128 | train |
OXID-eSales/oxideshop_ce | source/Core/SeoDecoder.php | SeoDecoder._getSeoUrl | protected function _getSeoUrl($sObjectId, $iLang, $iShopId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$aInfo = $oDb->getRow("select oxseourl, oxtype from oxseo where oxobjectid = " . $oDb->quote($sObjectId) . " and oxlang = " . $oDb->quote($iLang) . " and oxshopid = " . $oDb->quote($iShopId) . " order by oxparams limit 1");
if ('oxarticle' == $aInfo['oxtype']) {
$sMainCatId = $oDb->getOne("select oxcatnid from " . getViewName("oxobject2category") . " where oxobjectid = " . $oDb->quote($sObjectId) . " order by oxtime");
if ($sMainCatId) {
$sUrl = $oDb->getOne("select oxseourl from oxseo where oxobjectid = " . $oDb->quote($sObjectId) . " and oxlang = " . $oDb->quote($iLang) . " and oxshopid = " . $oDb->quote($iShopId) . " and oxparams = " . $oDb->quote($sMainCatId) . " order by oxexpired");
if ($sUrl) {
return $sUrl;
}
}
}
return $aInfo['oxseourl'];
} | php | protected function _getSeoUrl($sObjectId, $iLang, $iShopId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$aInfo = $oDb->getRow("select oxseourl, oxtype from oxseo where oxobjectid = " . $oDb->quote($sObjectId) . " and oxlang = " . $oDb->quote($iLang) . " and oxshopid = " . $oDb->quote($iShopId) . " order by oxparams limit 1");
if ('oxarticle' == $aInfo['oxtype']) {
$sMainCatId = $oDb->getOne("select oxcatnid from " . getViewName("oxobject2category") . " where oxobjectid = " . $oDb->quote($sObjectId) . " order by oxtime");
if ($sMainCatId) {
$sUrl = $oDb->getOne("select oxseourl from oxseo where oxobjectid = " . $oDb->quote($sObjectId) . " and oxlang = " . $oDb->quote($iLang) . " and oxshopid = " . $oDb->quote($iShopId) . " and oxparams = " . $oDb->quote($sMainCatId) . " order by oxexpired");
if ($sUrl) {
return $sUrl;
}
}
}
return $aInfo['oxseourl'];
} | [
"protected",
"function",
"_getSeoUrl",
"(",
"$",
"sObjectId",
",",
"$",
"iLang",
",",
"$",
"iShopId",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
"\\",
"OxidEsales",
"\\",
"Esh... | retrieve SEO url by its object id
normally used for getting the redirect url from seo history
@param string $sObjectId object id
@param int $iLang language to fetch
@param int $iShopId shop id
@return string | [
"retrieve",
"SEO",
"url",
"by",
"its",
"object",
"id",
"normally",
"used",
"for",
"getting",
"the",
"redirect",
"url",
"from",
"seo",
"history"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoDecoder.php#L160-L175 | train |
OXID-eSales/oxideshop_ce | source/Core/SeoDecoder.php | SeoDecoder.processSeoCall | public function processSeoCall($sRequest = null, $sPath = null)
{
// first - collect needed parameters
if (!$sRequest) {
if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI']) {
$sRequest = $_SERVER['REQUEST_URI'];
} else {
// try something else
$sRequest = $_SERVER['SCRIPT_URI'];
}
}
$sPath = $sPath ? $sPath : str_replace('oxseo.php', '', $_SERVER['SCRIPT_NAME']);
if (($sParams = $this->_getParams($sRequest, $sPath))) {
// in case SEO url is actual
if (is_array($aGet = $this->decodeUrl($sParams))) {
$_GET = array_merge($aGet, $_GET);
\OxidEsales\Eshop\Core\Registry::getLang()->resetBaseLanguage();
} elseif (($sRedirectUrl = $this->_decodeOldUrl($sParams))) {
// in case SEO url was changed - redirecting to new location
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL() . $sRedirectUrl, false, 301);
} elseif (($sRedirectUrl = $this->_decodeSimpleUrl($sParams))) {
// old type II seo urls
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL() . $sRedirectUrl, false, 301);
} else {
\OxidEsales\Eshop\Core\Registry::getSession()->start();
// unrecognized url
error_404_handler($sParams);
}
}
} | php | public function processSeoCall($sRequest = null, $sPath = null)
{
// first - collect needed parameters
if (!$sRequest) {
if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI']) {
$sRequest = $_SERVER['REQUEST_URI'];
} else {
// try something else
$sRequest = $_SERVER['SCRIPT_URI'];
}
}
$sPath = $sPath ? $sPath : str_replace('oxseo.php', '', $_SERVER['SCRIPT_NAME']);
if (($sParams = $this->_getParams($sRequest, $sPath))) {
// in case SEO url is actual
if (is_array($aGet = $this->decodeUrl($sParams))) {
$_GET = array_merge($aGet, $_GET);
\OxidEsales\Eshop\Core\Registry::getLang()->resetBaseLanguage();
} elseif (($sRedirectUrl = $this->_decodeOldUrl($sParams))) {
// in case SEO url was changed - redirecting to new location
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL() . $sRedirectUrl, false, 301);
} elseif (($sRedirectUrl = $this->_decodeSimpleUrl($sParams))) {
// old type II seo urls
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL() . $sRedirectUrl, false, 301);
} else {
\OxidEsales\Eshop\Core\Registry::getSession()->start();
// unrecognized url
error_404_handler($sParams);
}
}
} | [
"public",
"function",
"processSeoCall",
"(",
"$",
"sRequest",
"=",
"null",
",",
"$",
"sPath",
"=",
"null",
")",
"{",
"// first - collect needed parameters",
"if",
"(",
"!",
"$",
"sRequest",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_... | processSeoCall handles Server information and passes it to decoder
@param string $sRequest request
@param string $sPath path
@access public | [
"processSeoCall",
"handles",
"Server",
"information",
"and",
"passes",
"it",
"to",
"decoder"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoDecoder.php#L185-L215 | train |
OXID-eSales/oxideshop_ce | source/Core/SeoDecoder.php | SeoDecoder._decodeSimpleUrl | protected function _decodeSimpleUrl($sParams)
{
$sLastParam = trim($sParams, '/');
// active object id
$sUrl = null;
if ($sLastParam) {
$iLanguage = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
// article ?
if (strpos($sLastParam, '.htm') !== false) {
$sUrl = $this->_getObjectUrl($sLastParam, 'oxarticles', $iLanguage, 'oxarticle');
} else {
// category ?
if (!($sUrl = $this->_getObjectUrl($sLastParam, 'oxcategories', $iLanguage, 'oxcategory'))) {
// maybe manufacturer ?
if (!($sUrl = $this->_getObjectUrl($sLastParam, 'oxmanufacturers', $iLanguage, 'oxmanufacturer'))) {
// then maybe vendor ?
$sUrl = $this->_getObjectUrl($sLastParam, 'oxvendor', $iLanguage, 'oxvendor');
}
}
}
}
return $sUrl;
} | php | protected function _decodeSimpleUrl($sParams)
{
$sLastParam = trim($sParams, '/');
// active object id
$sUrl = null;
if ($sLastParam) {
$iLanguage = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
// article ?
if (strpos($sLastParam, '.htm') !== false) {
$sUrl = $this->_getObjectUrl($sLastParam, 'oxarticles', $iLanguage, 'oxarticle');
} else {
// category ?
if (!($sUrl = $this->_getObjectUrl($sLastParam, 'oxcategories', $iLanguage, 'oxcategory'))) {
// maybe manufacturer ?
if (!($sUrl = $this->_getObjectUrl($sLastParam, 'oxmanufacturers', $iLanguage, 'oxmanufacturer'))) {
// then maybe vendor ?
$sUrl = $this->_getObjectUrl($sLastParam, 'oxvendor', $iLanguage, 'oxvendor');
}
}
}
}
return $sUrl;
} | [
"protected",
"function",
"_decodeSimpleUrl",
"(",
"$",
"sParams",
")",
"{",
"$",
"sLastParam",
"=",
"trim",
"(",
"$",
"sParams",
",",
"'/'",
")",
";",
"// active object id",
"$",
"sUrl",
"=",
"null",
";",
"if",
"(",
"$",
"sLastParam",
")",
"{",
"$",
"i... | Tries to fetch SEO url according to type II seo url data. If no
specified data is found NULL will be returned
@param string $sParams request params (url chunk)
@return string | [
"Tries",
"to",
"fetch",
"SEO",
"url",
"according",
"to",
"type",
"II",
"seo",
"url",
"data",
".",
"If",
"no",
"specified",
"data",
"is",
"found",
"NULL",
"will",
"be",
"returned"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoDecoder.php#L225-L251 | train |
OXID-eSales/oxideshop_ce | source/Core/SeoDecoder.php | SeoDecoder._getParams | protected function _getParams($sRequest, $sPath)
{
$oStr = getStr();
$sParams = $oStr->preg_replace('/\?.*/', '', $sRequest);
$sPath = preg_quote($sPath, '/');
$sParams = $oStr->preg_replace("/^$sPath/", '', $sParams);
// this should not happen on most cases, because this redirect is handled by .htaccess
if ($sParams && !$oStr->preg_match('/\.html$/', $sParams) && !$oStr->preg_match('/\/$/', $sParams)) {
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL() . $sParams . '/', false);
}
return $sParams;
} | php | protected function _getParams($sRequest, $sPath)
{
$oStr = getStr();
$sParams = $oStr->preg_replace('/\?.*/', '', $sRequest);
$sPath = preg_quote($sPath, '/');
$sParams = $oStr->preg_replace("/^$sPath/", '', $sParams);
// this should not happen on most cases, because this redirect is handled by .htaccess
if ($sParams && !$oStr->preg_match('/\.html$/', $sParams) && !$oStr->preg_match('/\/$/', $sParams)) {
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL() . $sParams . '/', false);
}
return $sParams;
} | [
"protected",
"function",
"_getParams",
"(",
"$",
"sRequest",
",",
"$",
"sPath",
")",
"{",
"$",
"oStr",
"=",
"getStr",
"(",
")",
";",
"$",
"sParams",
"=",
"$",
"oStr",
"->",
"preg_replace",
"(",
"'/\\?.*/'",
",",
"''",
",",
"$",
"sRequest",
")",
";",
... | Extracts SEO paramteters and returns as array
@param string $sRequest request
@param string $sPath path
@return array $aParams extracted params | [
"Extracts",
"SEO",
"paramteters",
"and",
"returns",
"as",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SeoDecoder.php#L285-L299 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ContentMain.php | ContentMain.render | public function render()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
parent::render();
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
// categorie tree
$oCatTree = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
$oCatTree->loadList();
$oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
if (isset($soxId) && $soxId != "-1") {
// load object
$oContent->loadInLang($this->_iEditLang, $soxId);
$oOtherLang = $oContent->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) {
// echo "language entry doesn't exist! using: ".key($oOtherLang);
$oContent->loadInLang(key($oOtherLang), $soxId);
}
// remove already created languages
$aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang);
if (count($aLang)) {
$this->_aViewData["posslang"] = $aLang;
}
foreach ($oOtherLang as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang;
}
// mark selected
if ($oContent->oxcontents__oxcatid->value && isset($oCatTree[$oContent->oxcontents__oxcatid->value])) {
$oCatTree[$oContent->oxcontents__oxcatid->value]->selected = 1;
}
} else {
// create ident to make life easier
$sUId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId();
$oContent->oxcontents__oxloadid = new \OxidEsales\Eshop\Core\Field($sUId);
}
$this->_aViewData["edit"] = $oContent;
$this->_aViewData["link"] = "[{ oxgetseourl ident="" . $oContent->oxcontents__oxloadid->value . "" type="oxcontent" }]";
$this->_aViewData["cattree"] = $oCatTree;
// generate editor
$sCSS = "content.tpl.css";
if ($oContent->oxcontents__oxsnippet->value == '1') {
$sCSS = null;
}
$this->_aViewData["editor"] = $this->_generateTextEditor("100%", 300, $oContent, "oxcontents__oxcontent", $sCSS);
$this->_aViewData["afolder"] = $myConfig->getConfigParam('aCMSfolder');
return "content_main.tpl";
} | php | public function render()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
parent::render();
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
// categorie tree
$oCatTree = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
$oCatTree->loadList();
$oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
if (isset($soxId) && $soxId != "-1") {
// load object
$oContent->loadInLang($this->_iEditLang, $soxId);
$oOtherLang = $oContent->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) {
// echo "language entry doesn't exist! using: ".key($oOtherLang);
$oContent->loadInLang(key($oOtherLang), $soxId);
}
// remove already created languages
$aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang);
if (count($aLang)) {
$this->_aViewData["posslang"] = $aLang;
}
foreach ($oOtherLang as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang;
}
// mark selected
if ($oContent->oxcontents__oxcatid->value && isset($oCatTree[$oContent->oxcontents__oxcatid->value])) {
$oCatTree[$oContent->oxcontents__oxcatid->value]->selected = 1;
}
} else {
// create ident to make life easier
$sUId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId();
$oContent->oxcontents__oxloadid = new \OxidEsales\Eshop\Core\Field($sUId);
}
$this->_aViewData["edit"] = $oContent;
$this->_aViewData["link"] = "[{ oxgetseourl ident="" . $oContent->oxcontents__oxloadid->value . "" type="oxcontent" }]";
$this->_aViewData["cattree"] = $oCatTree;
// generate editor
$sCSS = "content.tpl.css";
if ($oContent->oxcontents__oxsnippet->value == '1') {
$sCSS = null;
}
$this->_aViewData["editor"] = $this->_generateTextEditor("100%", 300, $oContent, "oxcontents__oxcontent", $sCSS);
$this->_aViewData["afolder"] = $myConfig->getConfigParam('aCMSfolder');
return "content_main.tpl";
} | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"soxId",
"=",
"$",
"this",
"->",
... | Loads contents info, passes it to Smarty engine and
returns name of template file "content_main.tpl".
@return string | [
"Loads",
"contents",
"info",
"passes",
"it",
"to",
"Smarty",
"engine",
"and",
"returns",
"name",
"of",
"template",
"file",
"content_main",
".",
"tpl",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ContentMain.php#L27-L85 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ContentMain.php | ContentMain.save | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
if (isset($aParams['oxcontents__oxloadid'])) {
$aParams['oxcontents__oxloadid'] = $this->_prepareIdent($aParams['oxcontents__oxloadid']);
}
// check if loadid is unique
if ($this->_checkIdent($aParams['oxcontents__oxloadid'], $soxId)) {
// loadid already used, display error message
$this->_aViewData["blLoadError"] = true;
$oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
if ($soxId != '-1') {
$oContent->load($soxId);
}
$oContent->assign($aParams);
$this->_aViewData["edit"] = $oContent;
return;
}
// checkbox handling
if (!isset($aParams['oxcontents__oxactive'])) {
$aParams['oxcontents__oxactive'] = 0;
}
// special treatment
if ($aParams['oxcontents__oxtype'] == 0) {
$aParams['oxcontents__oxsnippet'] = 1;
} else {
$aParams['oxcontents__oxsnippet'] = 0;
}
//Updates object folder parameters
if ($aParams['oxcontents__oxfolder'] == 'CMSFOLDER_NONE') {
$aParams['oxcontents__oxfolder'] = '';
}
$oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
if ($soxId != "-1") {
$oContent->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxcontents__oxid'] = null;
}
//$aParams = $oContent->ConvertNameArray2Idx( $aParams);
$oContent->setLanguage(0);
$oContent->assign($aParams);
$oContent->setLanguage($this->_iEditLang);
$oContent->save();
// set oxid if inserted
$this->setEditObjectId($oContent->getId());
} | php | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
if (isset($aParams['oxcontents__oxloadid'])) {
$aParams['oxcontents__oxloadid'] = $this->_prepareIdent($aParams['oxcontents__oxloadid']);
}
// check if loadid is unique
if ($this->_checkIdent($aParams['oxcontents__oxloadid'], $soxId)) {
// loadid already used, display error message
$this->_aViewData["blLoadError"] = true;
$oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
if ($soxId != '-1') {
$oContent->load($soxId);
}
$oContent->assign($aParams);
$this->_aViewData["edit"] = $oContent;
return;
}
// checkbox handling
if (!isset($aParams['oxcontents__oxactive'])) {
$aParams['oxcontents__oxactive'] = 0;
}
// special treatment
if ($aParams['oxcontents__oxtype'] == 0) {
$aParams['oxcontents__oxsnippet'] = 1;
} else {
$aParams['oxcontents__oxsnippet'] = 0;
}
//Updates object folder parameters
if ($aParams['oxcontents__oxfolder'] == 'CMSFOLDER_NONE') {
$aParams['oxcontents__oxfolder'] = '';
}
$oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
if ($soxId != "-1") {
$oContent->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxcontents__oxid'] = null;
}
//$aParams = $oContent->ConvertNameArray2Idx( $aParams);
$oContent->setLanguage(0);
$oContent->assign($aParams);
$oContent->setLanguage($this->_iEditLang);
$oContent->save();
// set oxid if inserted
$this->setEditObjectId($oContent->getId());
} | [
"public",
"function",
"save",
"(",
")",
"{",
"parent",
"::",
"save",
"(",
")",
";",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"aParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
... | Saves content contents.
@return mixed | [
"Saves",
"content",
"contents",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ContentMain.php#L92-L152 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ContentMain.php | ContentMain._checkIdent | protected function _checkIdent($sIdent, $sOxId)
{
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$blAllow = false;
// null not allowed
if (!strlen($sIdent)) {
$blAllow = true;
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
} elseif ($masterDb->getOne("select oxid from oxcontents where oxloadid = " . $masterDb->quote($sIdent) . " and oxid != " . $masterDb->quote($sOxId) . " and oxshopid = '" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "'")) {
$blAllow = true;
}
return $blAllow;
} | php | protected function _checkIdent($sIdent, $sOxId)
{
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
$masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
$blAllow = false;
// null not allowed
if (!strlen($sIdent)) {
$blAllow = true;
// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
} elseif ($masterDb->getOne("select oxid from oxcontents where oxloadid = " . $masterDb->quote($sIdent) . " and oxid != " . $masterDb->quote($sOxId) . " and oxshopid = '" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "'")) {
$blAllow = true;
}
return $blAllow;
} | [
"protected",
"function",
"_checkIdent",
"(",
"$",
"sIdent",
",",
"$",
"sOxId",
")",
"{",
"// We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).",
"$",
"masterDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
... | Check if ident is unique
@param string $sIdent ident
@param string $sOxId Object id
@return null | [
"Check",
"if",
"ident",
"is",
"unique"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ContentMain.php#L214-L230 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleAttributeAjax.php | ArticleAttributeAjax.removeAttr | public function removeAttr()
{
$aChosenArt = $this->_getActionIds('oxobject2attribute.oxid');
$sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
$sO2AViewName = $this->_getViewName('oxobject2attribute');
$sQ = $this->_addFilter("delete $sO2AViewName.* " . $this->_getQuery());
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
} elseif (is_array($aChosenArt)) {
$sChosenArticles = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aChosenArt));
$sQ = "delete from oxobject2attribute where oxobject2attribute.oxid in ({$sChosenArticles}) ";
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
}
$this->onArticleAttributeRelationChange($sOxid);
} | php | public function removeAttr()
{
$aChosenArt = $this->_getActionIds('oxobject2attribute.oxid');
$sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
$sO2AViewName = $this->_getViewName('oxobject2attribute');
$sQ = $this->_addFilter("delete $sO2AViewName.* " . $this->_getQuery());
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
} elseif (is_array($aChosenArt)) {
$sChosenArticles = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aChosenArt));
$sQ = "delete from oxobject2attribute where oxobject2attribute.oxid in ({$sChosenArticles}) ";
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
}
$this->onArticleAttributeRelationChange($sOxid);
} | [
"public",
"function",
"removeAttr",
"(",
")",
"{",
"$",
"aChosenArt",
"=",
"$",
"this",
"->",
"_getActionIds",
"(",
"'oxobject2attribute.oxid'",
")",
";",
"$",
"sOxid",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig"... | Removes article attributes. | [
"Removes",
"article",
"attributes",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleAttributeAjax.php#L66-L81 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleAttributeAjax.php | ArticleAttributeAjax.addAttr | public function addAttr()
{
$aAddCat = $this->_getActionIds('oxattribute.oxid');
$soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
$sAttrViewName = $this->_getViewName('oxattribute');
$aAddCat = $this->_getAll($this->_addFilter("select $sAttrViewName.oxid " . $this->_getQuery()));
}
if ($soxId && $soxId != "-1" && is_array($aAddCat)) {
foreach ($aAddCat as $sAdd) {
$oNew = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
$oNew->init("oxobject2attribute");
$oNew->oxobject2attribute__oxobjectid = new \OxidEsales\Eshop\Core\Field($soxId);
$oNew->oxobject2attribute__oxattrid = new \OxidEsales\Eshop\Core\Field($sAdd);
$oNew->save();
}
$this->onArticleAttributeRelationChange($soxId);
}
} | php | public function addAttr()
{
$aAddCat = $this->_getActionIds('oxattribute.oxid');
$soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
$sAttrViewName = $this->_getViewName('oxattribute');
$aAddCat = $this->_getAll($this->_addFilter("select $sAttrViewName.oxid " . $this->_getQuery()));
}
if ($soxId && $soxId != "-1" && is_array($aAddCat)) {
foreach ($aAddCat as $sAdd) {
$oNew = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
$oNew->init("oxobject2attribute");
$oNew->oxobject2attribute__oxobjectid = new \OxidEsales\Eshop\Core\Field($soxId);
$oNew->oxobject2attribute__oxattrid = new \OxidEsales\Eshop\Core\Field($sAdd);
$oNew->save();
}
$this->onArticleAttributeRelationChange($soxId);
}
} | [
"public",
"function",
"addAttr",
"(",
")",
"{",
"$",
"aAddCat",
"=",
"$",
"this",
"->",
"_getActionIds",
"(",
"'oxattribute.oxid'",
")",
";",
"$",
"soxId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")... | Adds attributes to article. | [
"Adds",
"attributes",
"to",
"article",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleAttributeAjax.php#L86-L107 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleAttributeAjax.php | ArticleAttributeAjax.saveAttributeValue | public function saveAttributeValue()
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$this->resetContentCache();
$articleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid");
$attributeId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("attr_oxid");
$attributeValue = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("attr_value");
$article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($article->load($articleId)) {
if ($article->isDerived()) {
return;
}
$this->onAttributeValueChange($article);
if (isset($attributeId) && ("" != $attributeId)) {
$viewName = $this->_getViewName("oxobject2attribute");
$quotedArticleId = $database->quote($article->oxarticles__oxid->value);
$select = "select * from {$viewName} where {$viewName}.oxobjectid= {$quotedArticleId} and
{$viewName}.oxattrid= " . $database->quote($attributeId);
$objectToAttribute = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class);
$objectToAttribute->setLanguage(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editlanguage'));
$objectToAttribute->init("oxobject2attribute");
if ($objectToAttribute->assignRecord($select)) {
$objectToAttribute->oxobject2attribute__oxvalue->setValue($attributeValue);
$objectToAttribute->save();
}
}
}
} | php | public function saveAttributeValue()
{
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$this->resetContentCache();
$articleId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid");
$attributeId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("attr_oxid");
$attributeValue = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("attr_value");
$article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
if ($article->load($articleId)) {
if ($article->isDerived()) {
return;
}
$this->onAttributeValueChange($article);
if (isset($attributeId) && ("" != $attributeId)) {
$viewName = $this->_getViewName("oxobject2attribute");
$quotedArticleId = $database->quote($article->oxarticles__oxid->value);
$select = "select * from {$viewName} where {$viewName}.oxobjectid= {$quotedArticleId} and
{$viewName}.oxattrid= " . $database->quote($attributeId);
$objectToAttribute = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class);
$objectToAttribute->setLanguage(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editlanguage'));
$objectToAttribute->init("oxobject2attribute");
if ($objectToAttribute->assignRecord($select)) {
$objectToAttribute->oxobject2attribute__oxvalue->setValue($attributeValue);
$objectToAttribute->save();
}
}
}
} | [
"public",
"function",
"saveAttributeValue",
"(",
")",
"{",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"this",
"->",
"resetContentCache",
"(",
")",
";",
"$",
"articleId... | Saves attribute value
@return null | [
"Saves",
"attribute",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleAttributeAjax.php#L114-L145 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/OrderMain.php | OrderMain.save | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
if ($soxId != "-1") {
$oOrder->load($soxId);
} else {
$aParams['oxorder__oxid'] = null;
}
$needOrderRecalculate = false;
if (is_array($aParams)) {
foreach ($aParams as $parameter => $value) {
//parameter changes for not whitelisted parameters trigger order recalculation
$orderField = $oOrder->$parameter;
if (($value != $orderField->value) && !in_array($parameter, $this->fieldsTriggerNoOrderRecalculation)) {
$needOrderRecalculate = true;
continue;
}
}
}
//change payment
$sPayId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("setPayment");
if (!empty($sPayId) && ($sPayId != $oOrder->oxorder__oxpaymenttype->value)) {
$aParams['oxorder__oxpaymenttype'] = $sPayId;
$needOrderRecalculate = true;
}
$oOrder->assign($aParams);
$aDynvalues = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("dynvalue");
if (isset($aDynvalues)) {
$oPayment = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class);
$oPayment->load($oOrder->oxorder__oxpaymentid->value);
$oPayment->oxuserpayments__oxvalue->setValue(\OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesToText($aDynvalues));
$oPayment->save();
$needOrderRecalculate = true;
}
//change delivery set
$sDelSetId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("setDelSet");
if (!empty($sDelSetId) && ($sDelSetId != $oOrder->oxorder__oxdeltype->value)) {
$oOrder->oxorder__oxpaymenttype->setValue("oxempty");
$oOrder->setDelivery($sDelSetId);
$needOrderRecalculate = true;
} else {
// keeps old delivery cost
$oOrder->reloadDelivery(false);
}
if ($needOrderRecalculate) {
// keeps old discount
$oOrder->reloadDiscount(false);
$oOrder->recalculateOrder();
} else {
//nothing changed in order that requires a full recalculation
$oOrder->save();
}
// set oxid if inserted
$this->setEditObjectId($oOrder->getId());
} | php | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
if ($soxId != "-1") {
$oOrder->load($soxId);
} else {
$aParams['oxorder__oxid'] = null;
}
$needOrderRecalculate = false;
if (is_array($aParams)) {
foreach ($aParams as $parameter => $value) {
//parameter changes for not whitelisted parameters trigger order recalculation
$orderField = $oOrder->$parameter;
if (($value != $orderField->value) && !in_array($parameter, $this->fieldsTriggerNoOrderRecalculation)) {
$needOrderRecalculate = true;
continue;
}
}
}
//change payment
$sPayId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("setPayment");
if (!empty($sPayId) && ($sPayId != $oOrder->oxorder__oxpaymenttype->value)) {
$aParams['oxorder__oxpaymenttype'] = $sPayId;
$needOrderRecalculate = true;
}
$oOrder->assign($aParams);
$aDynvalues = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("dynvalue");
if (isset($aDynvalues)) {
$oPayment = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class);
$oPayment->load($oOrder->oxorder__oxpaymentid->value);
$oPayment->oxuserpayments__oxvalue->setValue(\OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesToText($aDynvalues));
$oPayment->save();
$needOrderRecalculate = true;
}
//change delivery set
$sDelSetId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("setDelSet");
if (!empty($sDelSetId) && ($sDelSetId != $oOrder->oxorder__oxdeltype->value)) {
$oOrder->oxorder__oxpaymenttype->setValue("oxempty");
$oOrder->setDelivery($sDelSetId);
$needOrderRecalculate = true;
} else {
// keeps old delivery cost
$oOrder->reloadDelivery(false);
}
if ($needOrderRecalculate) {
// keeps old discount
$oOrder->reloadDiscount(false);
$oOrder->recalculateOrder();
} else {
//nothing changed in order that requires a full recalculation
$oOrder->save();
}
// set oxid if inserted
$this->setEditObjectId($oOrder->getId());
} | [
"public",
"function",
"save",
"(",
")",
"{",
"parent",
"::",
"save",
"(",
")",
";",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"aParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
... | Saves main orders configuration parameters. | [
"Saves",
"main",
"orders",
"configuration",
"parameters",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderMain.php#L89-L154 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/OrderMain.php | OrderMain.sendDownloadLinks | public function sendDownloadLinks()
{
$soxId = $this->getEditObjectId();
$oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
if ($oOrder->load($soxId)) {
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
$oEmail->sendDownloadLinksMail($oOrder);
}
} | php | public function sendDownloadLinks()
{
$soxId = $this->getEditObjectId();
$oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
if ($oOrder->load($soxId)) {
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
$oEmail->sendDownloadLinksMail($oOrder);
}
} | [
"public",
"function",
"sendDownloadLinks",
"(",
")",
"{",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"oOrder",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Order",
"::"... | Sends download links. | [
"Sends",
"download",
"links",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderMain.php#L182-L190 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/OrderMain.php | OrderMain.resetOrder | public function resetOrder()
{
$oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
if ($oOrder->load($this->getEditObjectId())) {
$oOrder->oxorder__oxsenddate = new \OxidEsales\Eshop\Core\Field("0000-00-00 00:00:00");
$oOrder->save();
$this->onOrderReset();
}
} | php | public function resetOrder()
{
$oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
if ($oOrder->load($this->getEditObjectId())) {
$oOrder->oxorder__oxsenddate = new \OxidEsales\Eshop\Core\Field("0000-00-00 00:00:00");
$oOrder->save();
$this->onOrderReset();
}
} | [
"public",
"function",
"resetOrder",
"(",
")",
"{",
"$",
"oOrder",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Order",
"::",
"class",
")",
";",
"if",
"(",
"$",
"oOrder",
"->",
"load",
"(",
"$",
"thi... | Resets order shipping date. | [
"Resets",
"order",
"shipping",
"date",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderMain.php#L195-L204 | train |
OXID-eSales/oxideshop_ce | source/Internal/Console/Executor.php | Executor.execute | public function execute(InputInterface $input = null, OutputInterface $output = null)
{
$this->application->addCommands($this->servicesCommandsProvider->getCommands());
$this->application->run($input, $output);
} | php | public function execute(InputInterface $input = null, OutputInterface $output = null)
{
$this->application->addCommands($this->servicesCommandsProvider->getCommands());
$this->application->run($input, $output);
} | [
"public",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
"=",
"null",
",",
"OutputInterface",
"$",
"output",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"application",
"->",
"addCommands",
"(",
"$",
"this",
"->",
"servicesCommandsProvider",
"->",
... | Executes commands.
@param InputInterface|null $input
@param OutputInterface|null $output | [
"Executes",
"commands",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Console/Executor.php#L51-L55 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/SelectListMain.php | SelectListMain.changeField | public function changeField()
{
$sAddField = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddField");
if (empty($sAddField)) {
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("iErrorCode", ERR_REQUIREDMISSING);
return;
}
$aChangeFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aFields");
if (is_array($aChangeFields) && count($aChangeFields)) {
$oSelectlist = oxNew(\OxidEsales\Eshop\Application\Model\SelectList::class);
if ($oSelectlist->loadInLang($this->_iEditLang, $this->getEditObjectId())) {
$this->aFieldArray = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($oSelectlist->oxselectlist__oxvaldesc->getRawValue());
$sChangeFieldName = $this->parseFieldName($aChangeFields[0]);
foreach ($this->aFieldArray as $sKey => $oField) {
if ($oField->name == $sChangeFieldName) {
$this->aFieldArray[$sKey]->name = $sAddField;
$this->aFieldArray[$sKey]->price = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPriceMod");
$this->aFieldArray[$sKey]->priceUnit = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPriceModUnit");
if ($iPos = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPos")) {
if ($this->_rearrangeFields($this->aFieldArray[$sKey], $iPos - 1)) {
return;
}
}
break;
}
}
$this->save();
}
}
} | php | public function changeField()
{
$sAddField = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddField");
if (empty($sAddField)) {
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("iErrorCode", ERR_REQUIREDMISSING);
return;
}
$aChangeFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aFields");
if (is_array($aChangeFields) && count($aChangeFields)) {
$oSelectlist = oxNew(\OxidEsales\Eshop\Application\Model\SelectList::class);
if ($oSelectlist->loadInLang($this->_iEditLang, $this->getEditObjectId())) {
$this->aFieldArray = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($oSelectlist->oxselectlist__oxvaldesc->getRawValue());
$sChangeFieldName = $this->parseFieldName($aChangeFields[0]);
foreach ($this->aFieldArray as $sKey => $oField) {
if ($oField->name == $sChangeFieldName) {
$this->aFieldArray[$sKey]->name = $sAddField;
$this->aFieldArray[$sKey]->price = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPriceMod");
$this->aFieldArray[$sKey]->priceUnit = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPriceModUnit");
if ($iPos = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPos")) {
if ($this->_rearrangeFields($this->aFieldArray[$sKey], $iPos - 1)) {
return;
}
}
break;
}
}
$this->save();
}
}
} | [
"public",
"function",
"changeField",
"(",
")",
"{",
"$",
"sAddField",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"\"sAddField\"",
")",
";",
"if",
"(",
"empty",
"(",... | Modifies field from field array's first elem. and stores object
@return null | [
"Modifies",
"field",
"from",
"field",
"array",
"s",
"first",
"elem",
".",
"and",
"stores",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/SelectListMain.php#L279-L311 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/DeliveryMain.php | DeliveryMain.save | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$oDelivery = oxNew(\OxidEsales\Eshop\Application\Model\Delivery::class);
if ($soxId != "-1") {
$oDelivery->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxdelivery__oxid'] = null;
}
// checkbox handling
if (!isset($aParams['oxdelivery__oxactive'])) {
$aParams['oxdelivery__oxactive'] = 0;
}
if (!isset($aParams['oxdelivery__oxfixed'])) {
$aParams['oxdelivery__oxfixed'] = 0;
}
if (!isset($aParams['oxdelivery__oxfinalize'])) {
$aParams['oxdelivery__oxfinalize'] = 0;
}
if (!isset($aParams['oxdelivery__oxsort'])) {
$aParams['oxdelivery__oxsort'] = 9999;
}
//Disable editing for derived articles
if ($oDelivery->isDerived()) {
return;
}
$oDelivery->setLanguage(0);
$oDelivery->assign($aParams);
$oDelivery->setLanguage($this->_iEditLang);
$oDelivery = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->processFiles($oDelivery);
$oDelivery->save();
// set oxid if inserted
$this->setEditObjectId($oDelivery->getId());
} | php | public function save()
{
parent::save();
$soxId = $this->getEditObjectId();
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$oDelivery = oxNew(\OxidEsales\Eshop\Application\Model\Delivery::class);
if ($soxId != "-1") {
$oDelivery->loadInLang($this->_iEditLang, $soxId);
} else {
$aParams['oxdelivery__oxid'] = null;
}
// checkbox handling
if (!isset($aParams['oxdelivery__oxactive'])) {
$aParams['oxdelivery__oxactive'] = 0;
}
if (!isset($aParams['oxdelivery__oxfixed'])) {
$aParams['oxdelivery__oxfixed'] = 0;
}
if (!isset($aParams['oxdelivery__oxfinalize'])) {
$aParams['oxdelivery__oxfinalize'] = 0;
}
if (!isset($aParams['oxdelivery__oxsort'])) {
$aParams['oxdelivery__oxsort'] = 9999;
}
//Disable editing for derived articles
if ($oDelivery->isDerived()) {
return;
}
$oDelivery->setLanguage(0);
$oDelivery->assign($aParams);
$oDelivery->setLanguage($this->_iEditLang);
$oDelivery = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->processFiles($oDelivery);
$oDelivery->save();
// set oxid if inserted
$this->setEditObjectId($oDelivery->getId());
} | [
"public",
"function",
"save",
"(",
")",
"{",
"parent",
"::",
"save",
"(",
")",
";",
"$",
"soxId",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"$",
"aParams",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
... | Saves delivery information changes.
@return mixed | [
"Saves",
"delivery",
"information",
"changes",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DeliveryMain.php#L95-L140 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/DeliveryMain.php | DeliveryMain.getDeliveryTypes | public function getDeliveryTypes()
{
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$iLang = $oLang->getTplLanguage();
$aDelTypes = [];
$oType = new stdClass();
$oType->sType = "a"; // amount
$oType->sDesc = $oLang->translateString("amount", $iLang);
$aDelTypes['a'] = $oType;
$oType = new stdClass();
$oType->sType = "s"; // Size
$oType->sDesc = $oLang->translateString("size", $iLang);
$aDelTypes['s'] = $oType;
$oType = new stdClass();
$oType->sType = "w"; // Weight
$oType->sDesc = $oLang->translateString("weight", $iLang);
$aDelTypes['w'] = $oType;
$oType = new stdClass();
$oType->sType = "p"; // Price
$oType->sDesc = $oLang->translateString("price", $iLang);
$aDelTypes['p'] = $oType;
return $aDelTypes;
} | php | public function getDeliveryTypes()
{
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$iLang = $oLang->getTplLanguage();
$aDelTypes = [];
$oType = new stdClass();
$oType->sType = "a"; // amount
$oType->sDesc = $oLang->translateString("amount", $iLang);
$aDelTypes['a'] = $oType;
$oType = new stdClass();
$oType->sType = "s"; // Size
$oType->sDesc = $oLang->translateString("size", $iLang);
$aDelTypes['s'] = $oType;
$oType = new stdClass();
$oType->sType = "w"; // Weight
$oType->sDesc = $oLang->translateString("weight", $iLang);
$aDelTypes['w'] = $oType;
$oType = new stdClass();
$oType->sType = "p"; // Price
$oType->sDesc = $oLang->translateString("price", $iLang);
$aDelTypes['p'] = $oType;
return $aDelTypes;
} | [
"public",
"function",
"getDeliveryTypes",
"(",
")",
"{",
"$",
"oLang",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
";",
"$",
"iLang",
"=",
"$",
"oLang",
"->",
"getTplLanguage",
"(",
")",
";",
"$",
... | returns delivery types
@return array | [
"returns",
"delivery",
"types"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DeliveryMain.php#L188-L212 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/SuggestController.php | SuggestController.getProduct | public function getProduct()
{
if ($this->_oProduct === null) {
$this->_oProduct = false;
if ($sProductId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid')) {
$oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$oProduct->load($sProductId);
$this->_oProduct = $oProduct;
}
}
return $this->_oProduct;
} | php | public function getProduct()
{
if ($this->_oProduct === null) {
$this->_oProduct = false;
if ($sProductId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('anid')) {
$oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$oProduct->load($sProductId);
$this->_oProduct = $oProduct;
}
}
return $this->_oProduct;
} | [
"public",
"function",
"getProduct",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_oProduct",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_oProduct",
"=",
"false",
";",
"if",
"(",
"$",
"sProductId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Cor... | Template variable getter. Returns search product
@return object | [
"Template",
"variable",
"getter",
".",
"Returns",
"search",
"product"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/SuggestController.php#L153-L166 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/SuggestController.php | SuggestController.redirectToHomeIfDisabled | private function redirectToHomeIfDisabled()
{
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowSuggestArticle') !== true) {
Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl(), true, 301);
}
} | php | private function redirectToHomeIfDisabled()
{
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowSuggestArticle') !== true) {
Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl(), true, 301);
}
} | [
"private",
"function",
"redirectToHomeIfDisabled",
"(",
")",
"{",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'blAllowSuggestArticle'",
")",
"!==",
"true",
")",
"{",
... | In case functionality disabled, redirects to home page. | [
"In",
"case",
"functionality",
"disabled",
"redirects",
"to",
"home",
"page",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/SuggestController.php#L291-L296 | train |
OXID-eSales/oxideshop_ce | source/Core/SettingsHandler.php | SettingsHandler.run | public function run($module)
{
$moduleSettings = $module->getInfo('settings');
$isTheme = $this->isTheme($module->getId());
if (!$isTheme || ($isTheme && is_array($moduleSettings))) {
$this->addModuleSettings($moduleSettings, $module->getId());
}
} | php | public function run($module)
{
$moduleSettings = $module->getInfo('settings');
$isTheme = $this->isTheme($module->getId());
if (!$isTheme || ($isTheme && is_array($moduleSettings))) {
$this->addModuleSettings($moduleSettings, $module->getId());
}
} | [
"public",
"function",
"run",
"(",
"$",
"module",
")",
"{",
"$",
"moduleSettings",
"=",
"$",
"module",
"->",
"getInfo",
"(",
"'settings'",
")",
";",
"$",
"isTheme",
"=",
"$",
"this",
"->",
"isTheme",
"(",
"$",
"module",
"->",
"getId",
"(",
")",
")",
... | Get settings and module id and starts import process.
Run module settings import logic only if it has settings array
On empty settings array, it will remove the settings.
@param object $module Module or Theme Object | [
"Get",
"settings",
"and",
"module",
"id",
"and",
"starts",
"import",
"process",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SettingsHandler.php#L44-L51 | train |
OXID-eSales/oxideshop_ce | source/Core/SettingsHandler.php | SettingsHandler.isTheme | protected function isTheme($moduleId)
{
$moduleConfigId = $this->getModuleConfigId($moduleId);
$themeTypeCondition = "@^" . Config::OXMODULE_THEME_PREFIX . "@i";
return (bool)preg_match($themeTypeCondition, $moduleConfigId);
} | php | protected function isTheme($moduleId)
{
$moduleConfigId = $this->getModuleConfigId($moduleId);
$themeTypeCondition = "@^" . Config::OXMODULE_THEME_PREFIX . "@i";
return (bool)preg_match($themeTypeCondition, $moduleConfigId);
} | [
"protected",
"function",
"isTheme",
"(",
"$",
"moduleId",
")",
"{",
"$",
"moduleConfigId",
"=",
"$",
"this",
"->",
"getModuleConfigId",
"(",
"$",
"moduleId",
")",
";",
"$",
"themeTypeCondition",
"=",
"\"@^\"",
".",
"Config",
"::",
"OXMODULE_THEME_PREFIX",
".",... | Check if module is theme.
@param string $moduleId
@return bool | [
"Check",
"if",
"module",
"is",
"theme",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SettingsHandler.php#L113-L118 | train |
OXID-eSales/oxideshop_ce | source/Core/SettingsHandler.php | SettingsHandler.removeNotUsedSettings | protected function removeNotUsedSettings($moduleSettings, $moduleId)
{
$moduleConfigs = array_keys($this->getModuleConfigs($moduleId));
$moduleSettings = $this->parseModuleSettings($moduleSettings);
$configsToRemove = array_diff($moduleConfigs, $moduleSettings);
if (!empty($configsToRemove)) {
$this->removeModuleConfigs($moduleId, $configsToRemove);
}
} | php | protected function removeNotUsedSettings($moduleSettings, $moduleId)
{
$moduleConfigs = array_keys($this->getModuleConfigs($moduleId));
$moduleSettings = $this->parseModuleSettings($moduleSettings);
$configsToRemove = array_diff($moduleConfigs, $moduleSettings);
if (!empty($configsToRemove)) {
$this->removeModuleConfigs($moduleId, $configsToRemove);
}
} | [
"protected",
"function",
"removeNotUsedSettings",
"(",
"$",
"moduleSettings",
",",
"$",
"moduleId",
")",
"{",
"$",
"moduleConfigs",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"getModuleConfigs",
"(",
"$",
"moduleId",
")",
")",
";",
"$",
"moduleSettings",
"=",
... | Removes configs which are removed from module metadata
@param array $moduleSettings Module settings
@param string $moduleId Module id | [
"Removes",
"configs",
"which",
"are",
"removed",
"from",
"module",
"metadata"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SettingsHandler.php#L126-L135 | train |
OXID-eSales/oxideshop_ce | source/Core/SettingsHandler.php | SettingsHandler.getModuleConfigs | protected function getModuleConfigs($moduleId)
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$shopId = $config->getShopId();
$module = $this->getModuleConfigId($moduleId);
$decodeValueQuery = $config->getDecodeValueQuery();
$moduleConfigsQuery = "SELECT oxvarname, oxvartype, {$decodeValueQuery} as oxvardecodedvalue FROM oxconfig WHERE oxmodule = ? AND oxshopid = ?";
$dbConfigs = $db->getAll($moduleConfigsQuery, [$module, $shopId]);
$result = [];
foreach ($dbConfigs as $oneModuleConfig) {
$result[$oneModuleConfig['oxvarname']] = $config->decodeValue($oneModuleConfig['oxvartype'], $oneModuleConfig['oxvardecodedvalue']);
}
return $result;
} | php | protected function getModuleConfigs($moduleId)
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$shopId = $config->getShopId();
$module = $this->getModuleConfigId($moduleId);
$decodeValueQuery = $config->getDecodeValueQuery();
$moduleConfigsQuery = "SELECT oxvarname, oxvartype, {$decodeValueQuery} as oxvardecodedvalue FROM oxconfig WHERE oxmodule = ? AND oxshopid = ?";
$dbConfigs = $db->getAll($moduleConfigsQuery, [$module, $shopId]);
$result = [];
foreach ($dbConfigs as $oneModuleConfig) {
$result[$oneModuleConfig['oxvarname']] = $config->decodeValue($oneModuleConfig['oxvartype'], $oneModuleConfig['oxvardecodedvalue']);
}
return $result;
} | [
"protected",
"function",
"getModuleConfigs",
"(",
"$",
"moduleId",
")",
"{",
"$",
"db",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvid... | Returns module configuration from database
@param string $moduleId Module id
@return array key=>value | [
"Returns",
"module",
"configuration",
"from",
"database"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SettingsHandler.php#L144-L161 | train |
OXID-eSales/oxideshop_ce | source/Core/SettingsHandler.php | SettingsHandler.parseModuleSettings | protected function parseModuleSettings($moduleSettings)
{
$settings = [];
if (is_array($moduleSettings)) {
foreach ($moduleSettings as $setting) {
$settings[] = $setting['name'];
}
}
return $settings;
} | php | protected function parseModuleSettings($moduleSettings)
{
$settings = [];
if (is_array($moduleSettings)) {
foreach ($moduleSettings as $setting) {
$settings[] = $setting['name'];
}
}
return $settings;
} | [
"protected",
"function",
"parseModuleSettings",
"(",
"$",
"moduleSettings",
")",
"{",
"$",
"settings",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"moduleSettings",
")",
")",
"{",
"foreach",
"(",
"$",
"moduleSettings",
"as",
"$",
"setting",
")",
... | Parses module config variable names to array from module settings
@param array $moduleSettings Module settings
@return array | [
"Parses",
"module",
"config",
"variable",
"names",
"to",
"array",
"from",
"module",
"settings"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SettingsHandler.php#L170-L181 | train |
OXID-eSales/oxideshop_ce | source/Core/SettingsHandler.php | SettingsHandler.removeModuleConfigs | protected function removeModuleConfigs($moduleId, $configsToRemove)
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$quotedShopId = $db->quote(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
$quotedModuleId = $db->quote($this->getModuleConfigId($moduleId));
$quotedConfigsToRemove = array_map([$db, 'quote'], $configsToRemove);
$deleteSql = "DELETE
FROM `oxconfig`
WHERE oxmodule = $quotedModuleId AND
oxshopid = $quotedShopId AND
oxvarname IN (" . implode(", ", $quotedConfigsToRemove) . ")";
$db->execute($deleteSql);
} | php | protected function removeModuleConfigs($moduleId, $configsToRemove)
{
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$quotedShopId = $db->quote(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopId());
$quotedModuleId = $db->quote($this->getModuleConfigId($moduleId));
$quotedConfigsToRemove = array_map([$db, 'quote'], $configsToRemove);
$deleteSql = "DELETE
FROM `oxconfig`
WHERE oxmodule = $quotedModuleId AND
oxshopid = $quotedShopId AND
oxvarname IN (" . implode(", ", $quotedConfigsToRemove) . ")";
$db->execute($deleteSql);
} | [
"protected",
"function",
"removeModuleConfigs",
"(",
"$",
"moduleId",
",",
"$",
"configsToRemove",
")",
"{",
"$",
"db",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"quotedShopId",
"=",
... | Removes module configs from database
@param string $moduleId Module id
@param array $configsToRemove Configs to remove | [
"Removes",
"module",
"configs",
"from",
"database"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SettingsHandler.php#L189-L203 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/SeoEncoderContent.php | SeoEncoderContent.getContentUri | public function getContentUri($oCont, $iLang = null, $blRegenerate = false)
{
if (!isset($iLang)) {
$iLang = $oCont->getLanguage();
}
//load details link from DB
if ($blRegenerate || !($sSeoUrl = $this->_loadFromDb('oxContent', $oCont->getId(), $iLang))) {
if ($iLang != $oCont->getLanguage()) {
$sId = $oCont->getId();
$oCont = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
$oCont->loadInLang($iLang, $sId);
}
$sSeoUrl = '';
if ($oCont->getCategoryId() && $oCont->getType() === 2) {
$oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($oCat->loadInLang($iLang, $oCont->oxcontents__oxcatid->value)) {
$sParentId = $oCat->oxcategories__oxparentid->value;
if ($sParentId && $sParentId != 'oxrootid') {
$oParentCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($oParentCat->loadInLang($iLang, $oCat->oxcategories__oxparentid->value)) {
$sSeoUrl .= \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderCategory::class)->getCategoryUri($oParentCat);
}
}
}
}
$sSeoUrl .= $this->_prepareTitle($oCont->oxcontents__oxtitle->value, false, $oCont->getLanguage()) . '/';
$sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oCont->getId(), $iLang);
$this->_saveToDb('oxcontent', $oCont->getId(), $oCont->getBaseStdLink($iLang), $sSeoUrl, $iLang);
}
return $sSeoUrl;
} | php | public function getContentUri($oCont, $iLang = null, $blRegenerate = false)
{
if (!isset($iLang)) {
$iLang = $oCont->getLanguage();
}
//load details link from DB
if ($blRegenerate || !($sSeoUrl = $this->_loadFromDb('oxContent', $oCont->getId(), $iLang))) {
if ($iLang != $oCont->getLanguage()) {
$sId = $oCont->getId();
$oCont = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
$oCont->loadInLang($iLang, $sId);
}
$sSeoUrl = '';
if ($oCont->getCategoryId() && $oCont->getType() === 2) {
$oCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($oCat->loadInLang($iLang, $oCont->oxcontents__oxcatid->value)) {
$sParentId = $oCat->oxcategories__oxparentid->value;
if ($sParentId && $sParentId != 'oxrootid') {
$oParentCat = oxNew(\OxidEsales\Eshop\Application\Model\Category::class);
if ($oParentCat->loadInLang($iLang, $oCat->oxcategories__oxparentid->value)) {
$sSeoUrl .= \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderCategory::class)->getCategoryUri($oParentCat);
}
}
}
}
$sSeoUrl .= $this->_prepareTitle($oCont->oxcontents__oxtitle->value, false, $oCont->getLanguage()) . '/';
$sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oCont->getId(), $iLang);
$this->_saveToDb('oxcontent', $oCont->getId(), $oCont->getBaseStdLink($iLang), $sSeoUrl, $iLang);
}
return $sSeoUrl;
} | [
"public",
"function",
"getContentUri",
"(",
"$",
"oCont",
",",
"$",
"iLang",
"=",
"null",
",",
"$",
"blRegenerate",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"iLang",
")",
")",
"{",
"$",
"iLang",
"=",
"$",
"oCont",
"->",
"getLangua... | Returns SEO uri for content object. Includes parent category path info if
content is assigned to it
@param \OxidEsales\Eshop\Application\Model\Content $oCont content category object
@param int $iLang language
@param bool $blRegenerate if TRUE forces seo url regeneration
@return string | [
"Returns",
"SEO",
"uri",
"for",
"content",
"object",
".",
"Includes",
"parent",
"category",
"path",
"info",
"if",
"content",
"is",
"assigned",
"to",
"it"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderContent.php#L37-L71 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/SeoEncoderContent.php | SeoEncoderContent.getContentUrl | public function getContentUrl($oCont, $iLang = null)
{
if (!isset($iLang)) {
$iLang = $oCont->getLanguage();
}
return $this->_getFullUrl($this->getContentUri($oCont, $iLang), $iLang);
} | php | public function getContentUrl($oCont, $iLang = null)
{
if (!isset($iLang)) {
$iLang = $oCont->getLanguage();
}
return $this->_getFullUrl($this->getContentUri($oCont, $iLang), $iLang);
} | [
"public",
"function",
"getContentUrl",
"(",
"$",
"oCont",
",",
"$",
"iLang",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"iLang",
")",
")",
"{",
"$",
"iLang",
"=",
"$",
"oCont",
"->",
"getLanguage",
"(",
")",
";",
"}",
"return",
"$"... | encodeContentUrl encodes content link
@param \OxidEsales\Eshop\Application\Model\Content $oCont category object
@param int $iLang language
@return string|bool | [
"encodeContentUrl",
"encodes",
"content",
"link"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderContent.php#L81-L88 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/SeoEncoderContent.php | SeoEncoderContent.onDeleteContent | public function onDeleteContent($sId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sIdQuoted = $oDb->quote($sId);
$oDb->execute("delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcontent'");
$oDb->execute("delete from oxobject2seodata where oxobjectid = $sIdQuoted");
$oDb->execute("delete from oxseohistory where oxobjectid = $sIdQuoted");
} | php | public function onDeleteContent($sId)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sIdQuoted = $oDb->quote($sId);
$oDb->execute("delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxcontent'");
$oDb->execute("delete from oxobject2seodata where oxobjectid = $sIdQuoted");
$oDb->execute("delete from oxseohistory where oxobjectid = $sIdQuoted");
} | [
"public",
"function",
"onDeleteContent",
"(",
"$",
"sId",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"$",
"sIdQuoted",
"=",
"$",
"oDb",
"->",
"quote",
"(",
"$",
... | deletes content seo entries
@param string $sId content ids | [
"deletes",
"content",
"seo",
"entries"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderContent.php#L95-L102 | train |
OXID-eSales/oxideshop_ce | source/Core/Theme.php | Theme.load | public function load($sOXID)
{
$sFilePath = \OxidEsales\Eshop\Core\Registry::getConfig()->getViewsDir() . $sOXID . "/theme.php";
if (file_exists($sFilePath) && is_readable($sFilePath)) {
$aTheme = [];
include $sFilePath;
$this->_aTheme = $aTheme;
$this->_aTheme['id'] = $sOXID;
$this->_aTheme['active'] = ($this->getActiveThemeId() == $sOXID);
return true;
}
return false;
} | php | public function load($sOXID)
{
$sFilePath = \OxidEsales\Eshop\Core\Registry::getConfig()->getViewsDir() . $sOXID . "/theme.php";
if (file_exists($sFilePath) && is_readable($sFilePath)) {
$aTheme = [];
include $sFilePath;
$this->_aTheme = $aTheme;
$this->_aTheme['id'] = $sOXID;
$this->_aTheme['active'] = ($this->getActiveThemeId() == $sOXID);
return true;
}
return false;
} | [
"public",
"function",
"load",
"(",
"$",
"sOXID",
")",
"{",
"$",
"sFilePath",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getViewsDir",
"(",
")",
".",
"$",
"sOXID",
".",
"\"/theme.php\"",
"... | Load theme info
@param string $sOXID theme id
@return bool | [
"Load",
"theme",
"info"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Theme.php#L38-L52 | train |
OXID-eSales/oxideshop_ce | source/Core/Theme.php | Theme.activate | public function activate()
{
$sError = $this->checkForActivationErrors();
if ($sError) {
/** @var \OxidEsales\Eshop\Core\Exception\StandardException $oException */
$oException = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, $sError);
throw $oException;
}
$sParent = $this->getInfo('parentTheme');
if ($sParent) {
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("str", 'sTheme', $sParent);
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("str", 'sCustomTheme', $this->getId());
} else {
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("str", 'sTheme', $this->getId());
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("str", 'sCustomTheme', '');
}
$settingsHandler = oxNew(\OxidEsales\Eshop\Core\SettingsHandler::class);
$settingsHandler->setModuleType('theme')->run($this);
} | php | public function activate()
{
$sError = $this->checkForActivationErrors();
if ($sError) {
/** @var \OxidEsales\Eshop\Core\Exception\StandardException $oException */
$oException = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class, $sError);
throw $oException;
}
$sParent = $this->getInfo('parentTheme');
if ($sParent) {
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("str", 'sTheme', $sParent);
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("str", 'sCustomTheme', $this->getId());
} else {
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("str", 'sTheme', $this->getId());
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("str", 'sCustomTheme', '');
}
$settingsHandler = oxNew(\OxidEsales\Eshop\Core\SettingsHandler::class);
$settingsHandler->setModuleType('theme')->run($this);
} | [
"public",
"function",
"activate",
"(",
")",
"{",
"$",
"sError",
"=",
"$",
"this",
"->",
"checkForActivationErrors",
"(",
")",
";",
"if",
"(",
"$",
"sError",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Core\\Exception\\StandardException $oException */",
"$",
"oException",... | Set theme as active | [
"Set",
"theme",
"as",
"active"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Theme.php#L57-L75 | train |
OXID-eSales/oxideshop_ce | source/Core/Theme.php | Theme.getList | public function getList()
{
$this->_aThemeList = [];
$sOutDir = \OxidEsales\Eshop\Core\Registry::getConfig()->getViewsDir();
foreach (glob($sOutDir . "*", GLOB_ONLYDIR) as $sDir) {
$oTheme = oxNew(\OxidEsales\Eshop\Core\Theme::class);
if ($oTheme->load(basename($sDir))) {
$this->_aThemeList[$sDir] = $oTheme;
}
}
return $this->_aThemeList;
} | php | public function getList()
{
$this->_aThemeList = [];
$sOutDir = \OxidEsales\Eshop\Core\Registry::getConfig()->getViewsDir();
foreach (glob($sOutDir . "*", GLOB_ONLYDIR) as $sDir) {
$oTheme = oxNew(\OxidEsales\Eshop\Core\Theme::class);
if ($oTheme->load(basename($sDir))) {
$this->_aThemeList[$sDir] = $oTheme;
}
}
return $this->_aThemeList;
} | [
"public",
"function",
"getList",
"(",
")",
"{",
"$",
"this",
"->",
"_aThemeList",
"=",
"[",
"]",
";",
"$",
"sOutDir",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getViewsDir",
"(",
")",
... | Load theme info list
@return array | [
"Load",
"theme",
"info",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Theme.php#L82-L94 | train |
OXID-eSales/oxideshop_ce | source/Core/Theme.php | Theme.getInfo | public function getInfo($sName)
{
if (!isset($this->_aTheme[$sName])) {
return null;
}
return $this->_aTheme[$sName];
} | php | public function getInfo($sName)
{
if (!isset($this->_aTheme[$sName])) {
return null;
}
return $this->_aTheme[$sName];
} | [
"public",
"function",
"getInfo",
"(",
"$",
"sName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_aTheme",
"[",
"$",
"sName",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"_aTheme",
"[",
"$",
"sName"... | Return theme information
@param string $sName name of info item to retrieve
@return mixed | [
"Return",
"theme",
"information"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Theme.php#L103-L110 | train |
OXID-eSales/oxideshop_ce | source/Core/Theme.php | Theme.getActiveThemeId | public function getActiveThemeId()
{
$sCustTheme = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sCustomTheme');
if ($sCustTheme) {
return $sCustTheme;
}
return \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sTheme');
} | php | public function getActiveThemeId()
{
$sCustTheme = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sCustomTheme');
if ($sCustTheme) {
return $sCustTheme;
}
return \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sTheme');
} | [
"public",
"function",
"getActiveThemeId",
"(",
")",
"{",
"$",
"sCustTheme",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"'sCustomTheme'",
")",
";",
"if",
"(",
"$",
"sCust... | Return current active theme, or custom theme if specified
@return string | [
"Return",
"current",
"active",
"theme",
"or",
"custom",
"theme",
"if",
"specified"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Theme.php#L117-L125 | train |
OXID-eSales/oxideshop_ce | source/Core/Theme.php | Theme.getParent | public function getParent()
{
$sParent = $this->getInfo('parentTheme');
if (!$sParent) {
return null;
}
$oTheme = oxNew(\OxidEsales\Eshop\Core\Theme::class);
if ($oTheme->load($sParent)) {
return $oTheme;
}
return null;
} | php | public function getParent()
{
$sParent = $this->getInfo('parentTheme');
if (!$sParent) {
return null;
}
$oTheme = oxNew(\OxidEsales\Eshop\Core\Theme::class);
if ($oTheme->load($sParent)) {
return $oTheme;
}
return null;
} | [
"public",
"function",
"getParent",
"(",
")",
"{",
"$",
"sParent",
"=",
"$",
"this",
"->",
"getInfo",
"(",
"'parentTheme'",
")",
";",
"if",
"(",
"!",
"$",
"sParent",
")",
"{",
"return",
"null",
";",
"}",
"$",
"oTheme",
"=",
"oxNew",
"(",
"\\",
"Oxid... | Return loaded parent
@return \OxidEsales\Eshop\Core\Theme | [
"Return",
"loaded",
"parent"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Theme.php#L156-L168 | train |
OXID-eSales/oxideshop_ce | source/Setup/Session.php | Session._validateSession | protected function _validateSession()
{
if ($this->getIsNewSession() === true) {
$this->setSessionParam('setup_session', true);
} elseif ($this->getSessionParam('setup_session') !== true) {
$sNewSid = $this->_getNewSessionID();
session_write_close();
session_id($sNewSid);
session_start();
$this->setSessionParam('setup_session', true);
}
return session_id();
} | php | protected function _validateSession()
{
if ($this->getIsNewSession() === true) {
$this->setSessionParam('setup_session', true);
} elseif ($this->getSessionParam('setup_session') !== true) {
$sNewSid = $this->_getNewSessionID();
session_write_close();
session_id($sNewSid);
session_start();
$this->setSessionParam('setup_session', true);
}
return session_id();
} | [
"protected",
"function",
"_validateSession",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getIsNewSession",
"(",
")",
"===",
"true",
")",
"{",
"$",
"this",
"->",
"setSessionParam",
"(",
"'setup_session'",
",",
"true",
")",
";",
"}",
"elseif",
"(",
"$",
... | Validate if session is started by setup script, if not, generate new session.
@return string Session ID | [
"Validate",
"if",
"session",
"is",
"started",
"by",
"setup",
"script",
"if",
"not",
"generate",
"new",
"session",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Session.php#L83-L97 | train |
OXID-eSales/oxideshop_ce | source/Setup/Session.php | Session._initSessionData | protected function _initSessionData()
{
/** @var Utilities $oUtils */
$oUtils = $this->getInstance("Utilities");
//storing country value settings to session
$sCountryLang = $oUtils->getRequestVar("country_lang", "post");
if (isset($sCountryLang)) {
$this->setSessionParam('country_lang', $sCountryLang);
}
//storing shop language value settings to session
$sShopLang = $oUtils->getRequestVar("sShopLang", "post");
if (isset($sShopLang)) {
$this->setSessionParam('sShopLang', $sShopLang);
}
//storing if send information to OXID
$blSendInformation = $oUtils->getRequestVar("send_technical_information_to_oxid", "post");
if (isset($blSendInformation)) {
$this->setSessionParam('send_technical_information_to_oxid', $blSendInformation);
}
//storing check for updates settings to session
$blCheckForUpdates = $oUtils->getRequestVar("check_for_updates", "post");
if (isset($blCheckForUpdates)) {
$this->setSessionParam('check_for_updates', $blCheckForUpdates);
}
// store eula to session
$iEula = $oUtils->getRequestVar("iEula", "post");
if (isset($iEula)) {
$this->setSessionParam('eula', $iEula);
}
} | php | protected function _initSessionData()
{
/** @var Utilities $oUtils */
$oUtils = $this->getInstance("Utilities");
//storing country value settings to session
$sCountryLang = $oUtils->getRequestVar("country_lang", "post");
if (isset($sCountryLang)) {
$this->setSessionParam('country_lang', $sCountryLang);
}
//storing shop language value settings to session
$sShopLang = $oUtils->getRequestVar("sShopLang", "post");
if (isset($sShopLang)) {
$this->setSessionParam('sShopLang', $sShopLang);
}
//storing if send information to OXID
$blSendInformation = $oUtils->getRequestVar("send_technical_information_to_oxid", "post");
if (isset($blSendInformation)) {
$this->setSessionParam('send_technical_information_to_oxid', $blSendInformation);
}
//storing check for updates settings to session
$blCheckForUpdates = $oUtils->getRequestVar("check_for_updates", "post");
if (isset($blCheckForUpdates)) {
$this->setSessionParam('check_for_updates', $blCheckForUpdates);
}
// store eula to session
$iEula = $oUtils->getRequestVar("iEula", "post");
if (isset($iEula)) {
$this->setSessionParam('eula', $iEula);
}
} | [
"protected",
"function",
"_initSessionData",
"(",
")",
"{",
"/** @var Utilities $oUtils */",
"$",
"oUtils",
"=",
"$",
"this",
"->",
"getInstance",
"(",
"\"Utilities\"",
")",
";",
"//storing country value settings to session",
"$",
"sCountryLang",
"=",
"$",
"oUtils",
"... | Initializes setup session data array | [
"Initializes",
"setup",
"session",
"data",
"array"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Session.php#L136-L170 | train |
OXID-eSales/oxideshop_ce | source/Setup/Session.php | Session.getSessionParam | public function getSessionParam($sParamName)
{
$aSessionData = & $this->_getSessionData();
if (isset($aSessionData[$sParamName])) {
return $aSessionData[$sParamName];
}
} | php | public function getSessionParam($sParamName)
{
$aSessionData = & $this->_getSessionData();
if (isset($aSessionData[$sParamName])) {
return $aSessionData[$sParamName];
}
} | [
"public",
"function",
"getSessionParam",
"(",
"$",
"sParamName",
")",
"{",
"$",
"aSessionData",
"=",
"&",
"$",
"this",
"->",
"_getSessionData",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"aSessionData",
"[",
"$",
"sParamName",
"]",
")",
")",
"{",
"re... | Returns session parameter value
@param string $sParamName parameter name
@return mixed | [
"Returns",
"session",
"parameter",
"value"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Session.php#L205-L211 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ModuleSortList.php | ModuleSortList.save | public function save()
{
$aModule = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aModules");
$aModules = [];
if ($tmp = json_decode($aModule, true)) {
foreach ($tmp as $key => $value) {
$sanitizedKey = str_replace(self::BACKSLASH_REPLACEMENT, "\\", $key);
$aModules[$sanitizedKey] = $value;
}
$oModuleInstaller = oxNew(\OxidEsales\Eshop\Core\Module\ModuleInstaller::class);
$aModules = $oModuleInstaller->buildModuleChains($aModules);
}
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("aarr", "aModules", $aModules);
} | php | public function save()
{
$aModule = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aModules");
$aModules = [];
if ($tmp = json_decode($aModule, true)) {
foreach ($tmp as $key => $value) {
$sanitizedKey = str_replace(self::BACKSLASH_REPLACEMENT, "\\", $key);
$aModules[$sanitizedKey] = $value;
}
$oModuleInstaller = oxNew(\OxidEsales\Eshop\Core\Module\ModuleInstaller::class);
$aModules = $oModuleInstaller->buildModuleChains($aModules);
}
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar("aarr", "aModules", $aModules);
} | [
"public",
"function",
"save",
"(",
")",
"{",
"$",
"aModule",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"\"aModules\"",
")",
";",
"$",
"aModules",
"=",
"[",
"]",
... | Saves updated aModules config var | [
"Saves",
"updated",
"aModules",
"config",
"var"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ModuleSortList.php#L59-L74 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ModuleSortList.php | ModuleSortList.remove | public function remove()
{
//if user selected not to update modules, skipping all updates
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("noButton")) {
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blSkipDeletedExtChecking", true);
return;
}
$oModuleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
$oModuleList->cleanup();
} | php | public function remove()
{
//if user selected not to update modules, skipping all updates
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("noButton")) {
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blSkipDeletedExtChecking", true);
return;
}
$oModuleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
$oModuleList->cleanup();
} | [
"public",
"function",
"remove",
"(",
")",
"{",
"//if user selected not to update modules, skipping all updates",
"if",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getRequestParameter",
"(",
"\"noButton\""... | Removes extension metadata from eShop
@return null | [
"Removes",
"extension",
"metadata",
"from",
"eShop"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ModuleSortList.php#L81-L92 | train |
OXID-eSales/oxideshop_ce | source/Internal/Review/Dao/RatingDao.php | RatingDao.getRatingsByUserId | public function getRatingsByUserId($userId)
{
$queryBuilder = $this->queryBuilderFactory->create();
$queryBuilder
->select('r.*')
->from('oxratings', 'r')
->where('r.oxuserid = :userId')
->orderBy('r.oxtimestamp', 'DESC')
->setParameter('userId', $userId);
return $this->mapRatings($queryBuilder->execute()->fetchAll());
} | php | public function getRatingsByUserId($userId)
{
$queryBuilder = $this->queryBuilderFactory->create();
$queryBuilder
->select('r.*')
->from('oxratings', 'r')
->where('r.oxuserid = :userId')
->orderBy('r.oxtimestamp', 'DESC')
->setParameter('userId', $userId);
return $this->mapRatings($queryBuilder->execute()->fetchAll());
} | [
"public",
"function",
"getRatingsByUserId",
"(",
"$",
"userId",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"queryBuilderFactory",
"->",
"create",
"(",
")",
";",
"$",
"queryBuilder",
"->",
"select",
"(",
"'r.*'",
")",
"->",
"from",
"(",
"'oxrati... | Returns User Ratings.
@param string $userId
@return ArrayCollection | [
"Returns",
"User",
"Ratings",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Review/Dao/RatingDao.php#L48-L59 | train |
OXID-eSales/oxideshop_ce | source/Internal/Review/Dao/RatingDao.php | RatingDao.getRatingsByProductId | public function getRatingsByProductId($productId)
{
$queryBuilder = $this->queryBuilderFactory->create();
$queryBuilder
->select('r.*')
->from('oxratings', 'r')
->where('r.oxobjectid = :productId')
->andWhere('r.oxtype = :productType')
->orderBy('r.oxtimestamp', 'DESC')
->setParameters(
[
'productId' => $productId,
'productType' => 'oxarticle',
]
);
return $this->mapRatings($queryBuilder->execute()->fetchAll());
} | php | public function getRatingsByProductId($productId)
{
$queryBuilder = $this->queryBuilderFactory->create();
$queryBuilder
->select('r.*')
->from('oxratings', 'r')
->where('r.oxobjectid = :productId')
->andWhere('r.oxtype = :productType')
->orderBy('r.oxtimestamp', 'DESC')
->setParameters(
[
'productId' => $productId,
'productType' => 'oxarticle',
]
);
return $this->mapRatings($queryBuilder->execute()->fetchAll());
} | [
"public",
"function",
"getRatingsByProductId",
"(",
"$",
"productId",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"queryBuilderFactory",
"->",
"create",
"(",
")",
";",
"$",
"queryBuilder",
"->",
"select",
"(",
"'r.*'",
")",
"->",
"from",
"(",
"'... | Returns Ratings for a product.
@param string $productId
@return ArrayCollection | [
"Returns",
"Ratings",
"for",
"a",
"product",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Review/Dao/RatingDao.php#L81-L98 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.