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/Controller/FrontendController.php
FrontendController.generatePageNavigation
public function generatePageNavigation($positionCount = 0) { startProfile('generatePageNavigation'); $pageNavigation = new StdClass(); $pageNavigation->NrOfPages = $this->_iCntPages; $activePage = $this->getActPage(); $pageNavigation->actPage = $activePage + 1; $url = $this->generatePageNavigationUrl(); if ($positionCount == 0 || ($positionCount >= $pageNavigation->NrOfPages)) { $startNo = 2; $finishNo = $pageNavigation->NrOfPages; } else { $tmpVal = $positionCount - 3; $tmpVal2 = floor(($positionCount - 4) / 2); // actual page is at the start if ($pageNavigation->actPage <= $tmpVal) { $startNo = 2; $finishNo = $tmpVal + 1; // actual page is at the end } elseif ($pageNavigation->actPage >= $pageNavigation->NrOfPages - $tmpVal + 1) { $startNo = $pageNavigation->NrOfPages - $tmpVal; $finishNo = $pageNavigation->NrOfPages - 1; // actual page is in the middle } else { $startNo = $pageNavigation->actPage - $tmpVal2; $finishNo = $pageNavigation->actPage + $tmpVal2; } } if ($activePage > 0) { $pageNavigation->previousPage = $this->_addPageNrParam($url, $activePage - 1); } if ($activePage < $pageNavigation->NrOfPages - 1) { $pageNavigation->nextPage = $this->_addPageNrParam($url, $activePage + 1); } if ($pageNavigation->NrOfPages > 1) { for ($i = 1; $i < $pageNavigation->NrOfPages + 1; $i++) { if ($i == 1 || $i == $pageNavigation->NrOfPages || ($i >= $startNo && $i <= $finishNo)) { $page = new stdClass(); $page->url = $this->_addPageNrParam($url, $i - 1); $page->selected = ($i == $pageNavigation->actPage) ? 1 : 0; $pageNavigation->changePage[$i] = $page; } } // first/last one $pageNavigation->firstpage = $this->_addPageNrParam($url, 0); $pageNavigation->lastpage = $this->_addPageNrParam($url, $pageNavigation->NrOfPages - 1); } stopProfile('generatePageNavigation'); return $pageNavigation; }
php
public function generatePageNavigation($positionCount = 0) { startProfile('generatePageNavigation'); $pageNavigation = new StdClass(); $pageNavigation->NrOfPages = $this->_iCntPages; $activePage = $this->getActPage(); $pageNavigation->actPage = $activePage + 1; $url = $this->generatePageNavigationUrl(); if ($positionCount == 0 || ($positionCount >= $pageNavigation->NrOfPages)) { $startNo = 2; $finishNo = $pageNavigation->NrOfPages; } else { $tmpVal = $positionCount - 3; $tmpVal2 = floor(($positionCount - 4) / 2); // actual page is at the start if ($pageNavigation->actPage <= $tmpVal) { $startNo = 2; $finishNo = $tmpVal + 1; // actual page is at the end } elseif ($pageNavigation->actPage >= $pageNavigation->NrOfPages - $tmpVal + 1) { $startNo = $pageNavigation->NrOfPages - $tmpVal; $finishNo = $pageNavigation->NrOfPages - 1; // actual page is in the middle } else { $startNo = $pageNavigation->actPage - $tmpVal2; $finishNo = $pageNavigation->actPage + $tmpVal2; } } if ($activePage > 0) { $pageNavigation->previousPage = $this->_addPageNrParam($url, $activePage - 1); } if ($activePage < $pageNavigation->NrOfPages - 1) { $pageNavigation->nextPage = $this->_addPageNrParam($url, $activePage + 1); } if ($pageNavigation->NrOfPages > 1) { for ($i = 1; $i < $pageNavigation->NrOfPages + 1; $i++) { if ($i == 1 || $i == $pageNavigation->NrOfPages || ($i >= $startNo && $i <= $finishNo)) { $page = new stdClass(); $page->url = $this->_addPageNrParam($url, $i - 1); $page->selected = ($i == $pageNavigation->actPage) ? 1 : 0; $pageNavigation->changePage[$i] = $page; } } // first/last one $pageNavigation->firstpage = $this->_addPageNrParam($url, 0); $pageNavigation->lastpage = $this->_addPageNrParam($url, $pageNavigation->NrOfPages - 1); } stopProfile('generatePageNavigation'); return $pageNavigation; }
[ "public", "function", "generatePageNavigation", "(", "$", "positionCount", "=", "0", ")", "{", "startProfile", "(", "'generatePageNavigation'", ")", ";", "$", "pageNavigation", "=", "new", "StdClass", "(", ")", ";", "$", "pageNavigation", "->", "NrOfPages", "=",...
Generates variables for page navigation @param int $positionCount Paging positions count ( 0 - unlimited ) @return StdClass Object with page navigation data
[ "Generates", "variables", "for", "page", "navigation" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2044-L2103
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getActPage
public function getActPage() { if ($this->_iActPage === null) { $this->_iActPage = ( int ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr'); $this->_iActPage = ($this->_iActPage < 0) ? 0 : $this->_iActPage; } return $this->_iActPage; }
php
public function getActPage() { if ($this->_iActPage === null) { $this->_iActPage = ( int ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr'); $this->_iActPage = ($this->_iActPage < 0) ? 0 : $this->_iActPage; } return $this->_iActPage; }
[ "public", "function", "getActPage", "(", ")", "{", "if", "(", "$", "this", "->", "_iActPage", "===", "null", ")", "{", "$", "this", "->", "_iActPage", "=", "(", "int", ")", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "get...
Active page getter @return int
[ "Active", "page", "getter" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2165-L2173
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getActVendor
public function getActVendor() { // if active vendor is not set yet - trying to load it from request params // this may be useful when category component was unable to load active vendor // and we still need some object to mount navigation info if ($this->_oActVendor === null) { $this->_oActVendor = false; $vendorId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid'); $vendorId = $vendorId ? str_replace('v_', '', $vendorId) : $vendorId; $vendor = oxNew(\OxidEsales\Eshop\Application\Model\Vendor::class); if ($vendor->load($vendorId)) { $this->_oActVendor = $vendor; } } return $this->_oActVendor; }
php
public function getActVendor() { // if active vendor is not set yet - trying to load it from request params // this may be useful when category component was unable to load active vendor // and we still need some object to mount navigation info if ($this->_oActVendor === null) { $this->_oActVendor = false; $vendorId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid'); $vendorId = $vendorId ? str_replace('v_', '', $vendorId) : $vendorId; $vendor = oxNew(\OxidEsales\Eshop\Application\Model\Vendor::class); if ($vendor->load($vendorId)) { $this->_oActVendor = $vendor; } } return $this->_oActVendor; }
[ "public", "function", "getActVendor", "(", ")", "{", "// if active vendor is not set yet - trying to load it from request params", "// this may be useful when category component was unable to load active vendor", "// and we still need some object to mount navigation info", "if", "(", "$", "t...
Returns active vendor set by categories component; if vendor is not set by component - will create vendor object and will try to load by id passed by request @return \OxidEsales\Eshop\Application\Model\Vendor
[ "Returns", "active", "vendor", "set", "by", "categories", "component", ";", "if", "vendor", "is", "not", "set", "by", "component", "-", "will", "create", "vendor", "object", "and", "will", "try", "to", "load", "by", "id", "passed", "by", "request" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2182-L2198
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getActManufacturer
public function getActManufacturer() { // if active Manufacturer is not set yet - trying to load it from request params // this may be useful when category component was unable to load active Manufacturer // and we still need some object to mount navigation info if ($this->_oActManufacturer === null) { $this->_oActManufacturer = false; $manufacturerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('mnid'); $manufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class); if ($manufacturer->load($manufacturerId)) { $this->_oActManufacturer = $manufacturer; } } return $this->_oActManufacturer; }
php
public function getActManufacturer() { // if active Manufacturer is not set yet - trying to load it from request params // this may be useful when category component was unable to load active Manufacturer // and we still need some object to mount navigation info if ($this->_oActManufacturer === null) { $this->_oActManufacturer = false; $manufacturerId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('mnid'); $manufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class); if ($manufacturer->load($manufacturerId)) { $this->_oActManufacturer = $manufacturer; } } return $this->_oActManufacturer; }
[ "public", "function", "getActManufacturer", "(", ")", "{", "// if active Manufacturer is not set yet - trying to load it from request params", "// this may be useful when category component was unable to load active Manufacturer", "// and we still need some object to mount navigation info", "if", ...
Returns active Manufacturer set by categories component; if Manufacturer is not set by component - will create Manufacturer object and will try to load by id passed by request @return \OxidEsales\Eshop\Application\Model\Manufacturer
[ "Returns", "active", "Manufacturer", "set", "by", "categories", "component", ";", "if", "Manufacturer", "is", "not", "set", "by", "component", "-", "will", "create", "Manufacturer", "object", "and", "will", "try", "to", "load", "by", "id", "passed", "by", "r...
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2207-L2222
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getActSearch
public function getActSearch() { if ($this->_oActSearch === null) { $this->_oActSearch = new stdClass(); $url = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl(); $this->_oActSearch->link = "{$url}cl=search"; } return $this->_oActSearch; }
php
public function getActSearch() { if ($this->_oActSearch === null) { $this->_oActSearch = new stdClass(); $url = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl(); $this->_oActSearch->link = "{$url}cl=search"; } return $this->_oActSearch; }
[ "public", "function", "getActSearch", "(", ")", "{", "if", "(", "$", "this", "->", "_oActSearch", "===", "null", ")", "{", "$", "this", "->", "_oActSearch", "=", "new", "stdClass", "(", ")", ";", "$", "url", "=", "\\", "OxidEsales", "\\", "Eshop", "\...
Returns fake object which is used to mount navigation info @return stdClass
[ "Returns", "fake", "object", "which", "is", "used", "to", "mount", "navigation", "info" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2249-L2258
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getMinOrderPrice
public function getMinOrderPrice() { if ($this->_sMinOrderPrice === null && $this->isLowOrderPrice()) { $minOrderPrice = \OxidEsales\Eshop\Core\Price::getPriceInActCurrency(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iMinOrderPrice')); $this->_sMinOrderPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($minOrderPrice); } return $this->_sMinOrderPrice; }
php
public function getMinOrderPrice() { if ($this->_sMinOrderPrice === null && $this->isLowOrderPrice()) { $minOrderPrice = \OxidEsales\Eshop\Core\Price::getPriceInActCurrency(\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iMinOrderPrice')); $this->_sMinOrderPrice = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($minOrderPrice); } return $this->_sMinOrderPrice; }
[ "public", "function", "getMinOrderPrice", "(", ")", "{", "if", "(", "$", "this", "->", "_sMinOrderPrice", "===", "null", "&&", "$", "this", "->", "isLowOrderPrice", "(", ")", ")", "{", "$", "minOrderPrice", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "...
Template variable getter. Returns formatted min order price value @deprecated in v4.8/5.1 on 2013-10-14; use oxBasket method @return string
[ "Template", "variable", "getter", ".", "Returns", "formatted", "min", "order", "price", "value" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2383-L2391
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController._canRedirect
protected function _canRedirect() { foreach ($this->_aBlockRedirectParams as $param) { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($param) !== null) { return false; } } return true; }
php
protected function _canRedirect() { foreach ($this->_aBlockRedirectParams as $param) { if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter($param) !== null) { return false; } } return true; }
[ "protected", "function", "_canRedirect", "(", ")", "{", "foreach", "(", "$", "this", "->", "_aBlockRedirectParams", "as", "$", "param", ")", "{", "if", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "...
Checks if current request parameters does not block SEO redirection process @return bool
[ "Checks", "if", "current", "request", "parameters", "does", "not", "block", "SEO", "redirection", "process" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2408-L2417
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getVendorId
public function getVendorId() { if ($this->_sVendorId === null) { $this->_sVendorId = false; if (($vendor = $this->getActVendor())) { $this->_sVendorId = $vendor->getId(); } } return $this->_sVendorId; }
php
public function getVendorId() { if ($this->_sVendorId === null) { $this->_sVendorId = false; if (($vendor = $this->getActVendor())) { $this->_sVendorId = $vendor->getId(); } } return $this->_sVendorId; }
[ "public", "function", "getVendorId", "(", ")", "{", "if", "(", "$", "this", "->", "_sVendorId", "===", "null", ")", "{", "$", "this", "->", "_sVendorId", "=", "false", ";", "if", "(", "(", "$", "vendor", "=", "$", "this", "->", "getActVendor", "(", ...
Template variable getter. Returns vendor id @return string
[ "Template", "variable", "getter", ".", "Returns", "vendor", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2491-L2501
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getManufacturerId
public function getManufacturerId() { if ($this->_sManufacturerId === null) { $this->_sManufacturerId = false; if (($manufacturer = $this->getActManufacturer())) { $this->_sManufacturerId = $manufacturer->getId(); } } return $this->_sManufacturerId; }
php
public function getManufacturerId() { if ($this->_sManufacturerId === null) { $this->_sManufacturerId = false; if (($manufacturer = $this->getActManufacturer())) { $this->_sManufacturerId = $manufacturer->getId(); } } return $this->_sManufacturerId; }
[ "public", "function", "getManufacturerId", "(", ")", "{", "if", "(", "$", "this", "->", "_sManufacturerId", "===", "null", ")", "{", "$", "this", "->", "_sManufacturerId", "=", "false", ";", "if", "(", "(", "$", "manufacturer", "=", "$", "this", "->", ...
Template variable getter. Returns Manufacturer id @return string
[ "Template", "variable", "getter", ".", "Returns", "Manufacturer", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2508-L2518
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getContentByIdent
public function getContentByIdent($ident) { if (!isset($this->_aContents[$ident])) { $this->_aContents[$ident] = oxNew(\OxidEsales\Eshop\Application\Model\Content::class); $this->_aContents[$ident]->loadByIdent($ident); } return $this->_aContents[$ident]; }
php
public function getContentByIdent($ident) { if (!isset($this->_aContents[$ident])) { $this->_aContents[$ident] = oxNew(\OxidEsales\Eshop\Application\Model\Content::class); $this->_aContents[$ident]->loadByIdent($ident); } return $this->_aContents[$ident]; }
[ "public", "function", "getContentByIdent", "(", "$", "ident", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_aContents", "[", "$", "ident", "]", ")", ")", "{", "$", "this", "->", "_aContents", "[", "$", "ident", "]", "=", "oxNew", "("...
Loads and returns oxContent object requested by its ident @param string $ident content identifier @return \OxidEsales\Eshop\Application\Model\Content
[ "Loads", "and", "returns", "oxContent", "object", "requested", "by", "its", "ident" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2547-L2555
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getMustFillFields
public function getMustFillFields() { if ($this->_aMustFillFields === null) { $this->_aMustFillFields = false; // passing must-be-filled-fields info $mustFillFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aMustFillFields'); if (is_array($mustFillFields)) { $this->_aMustFillFields = array_flip($mustFillFields); } } return $this->_aMustFillFields; }
php
public function getMustFillFields() { if ($this->_aMustFillFields === null) { $this->_aMustFillFields = false; // passing must-be-filled-fields info $mustFillFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aMustFillFields'); if (is_array($mustFillFields)) { $this->_aMustFillFields = array_flip($mustFillFields); } } return $this->_aMustFillFields; }
[ "public", "function", "getMustFillFields", "(", ")", "{", "if", "(", "$", "this", "->", "_aMustFillFields", "===", "null", ")", "{", "$", "this", "->", "_aMustFillFields", "=", "false", ";", "// passing must-be-filled-fields info", "$", "mustFillFields", "=", "\...
Returns array of fields which must be filled during registration @return array | bool
[ "Returns", "array", "of", "fields", "which", "must", "be", "filled", "during", "registration" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2572-L2585
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getFormId
public function getFormId() { if ($this->_sFormId === null) { $this->_sFormId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId(); \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('sessionuformid', $this->_sFormId); } return $this->_sFormId; }
php
public function getFormId() { if ($this->_sFormId === null) { $this->_sFormId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId(); \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('sessionuformid', $this->_sFormId); } return $this->_sFormId; }
[ "public", "function", "getFormId", "(", ")", "{", "if", "(", "$", "this", "->", "_sFormId", "===", "null", ")", "{", "$", "this", "->", "_sFormId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getUtilsObject", "(", ")"...
Form id getter. This id used to prevent double review entry submit @return string
[ "Form", "id", "getter", ".", "This", "id", "used", "to", "prevent", "double", "review", "entry", "submit" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2604-L2612
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.canAcceptFormData
public function canAcceptFormData() { if ($this->_blCanAcceptFormData === null) { $this->_blCanAcceptFormData = false; $formId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("uformid"); $sessionFormId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("sessionuformid"); // testing if form and session ids matches if ($formId && $formId === $sessionFormId) { $this->_blCanAcceptFormData = true; } // regenerating form data $this->getFormId(); } return $this->_blCanAcceptFormData; }
php
public function canAcceptFormData() { if ($this->_blCanAcceptFormData === null) { $this->_blCanAcceptFormData = false; $formId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("uformid"); $sessionFormId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("sessionuformid"); // testing if form and session ids matches if ($formId && $formId === $sessionFormId) { $this->_blCanAcceptFormData = true; } // regenerating form data $this->getFormId(); } return $this->_blCanAcceptFormData; }
[ "public", "function", "canAcceptFormData", "(", ")", "{", "if", "(", "$", "this", "->", "_blCanAcceptFormData", "===", "null", ")", "{", "$", "this", "->", "_blCanAcceptFormData", "=", "false", ";", "$", "formId", "=", "\\", "OxidEsales", "\\", "Eshop", "\...
Checks if session form id matches with request form id @return bool
[ "Checks", "if", "session", "form", "id", "matches", "with", "request", "form", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2619-L2637
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getPromoFinishedList
public function getPromoFinishedList() { if (isset($this->_oPromoFinishedList)) { return $this->_oPromoFinishedList; } $this->_oPromoFinishedList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class); $this->_oPromoFinishedList->loadFinishedByCount(2); return $this->_oPromoFinishedList; }
php
public function getPromoFinishedList() { if (isset($this->_oPromoFinishedList)) { return $this->_oPromoFinishedList; } $this->_oPromoFinishedList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class); $this->_oPromoFinishedList->loadFinishedByCount(2); return $this->_oPromoFinishedList; }
[ "public", "function", "getPromoFinishedList", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_oPromoFinishedList", ")", ")", "{", "return", "$", "this", "->", "_oPromoFinishedList", ";", "}", "$", "this", "->", "_oPromoFinishedList", "=", "oxNew...
return last finished promotion list @return oxActionList
[ "return", "last", "finished", "promotion", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2644-L2653
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getPromoCurrentList
public function getPromoCurrentList() { if (isset($this->_oPromoCurrentList)) { return $this->_oPromoCurrentList; } $this->_oPromoCurrentList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class); $this->_oPromoCurrentList->loadCurrent(); return $this->_oPromoCurrentList; }
php
public function getPromoCurrentList() { if (isset($this->_oPromoCurrentList)) { return $this->_oPromoCurrentList; } $this->_oPromoCurrentList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class); $this->_oPromoCurrentList->loadCurrent(); return $this->_oPromoCurrentList; }
[ "public", "function", "getPromoCurrentList", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_oPromoCurrentList", ")", ")", "{", "return", "$", "this", "->", "_oPromoCurrentList", ";", "}", "$", "this", "->", "_oPromoCurrentList", "=", "oxNew", ...
return current promotion list @return oxActionList
[ "return", "current", "promotion", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2660-L2669
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getPromoFutureList
public function getPromoFutureList() { if (isset($this->_oPromoFutureList)) { return $this->_oPromoFutureList; } $this->_oPromoFutureList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class); $this->_oPromoFutureList->loadFutureByCount(2); return $this->_oPromoFutureList; }
php
public function getPromoFutureList() { if (isset($this->_oPromoFutureList)) { return $this->_oPromoFutureList; } $this->_oPromoFutureList = oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class); $this->_oPromoFutureList->loadFutureByCount(2); return $this->_oPromoFutureList; }
[ "public", "function", "getPromoFutureList", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_oPromoFutureList", ")", ")", "{", "return", "$", "this", "->", "_oPromoFutureList", ";", "}", "$", "this", "->", "_oPromoFutureList", "=", "oxNew", "("...
return future promotion list @return oxActionList
[ "return", "future", "promotion", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2676-L2685
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getShowPromotionList
public function getShowPromotionList() { if (isset($this->_blShowPromotions)) { return $this->_blShowPromotions; } $this->_blShowPromotions = false; if (oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class)->areAnyActivePromotions()) { $this->_blShowPromotions = (count($this->getPromoFinishedList()) + count($this->getPromoCurrentList()) + count($this->getPromoFutureList())) > 0; } return $this->_blShowPromotions; }
php
public function getShowPromotionList() { if (isset($this->_blShowPromotions)) { return $this->_blShowPromotions; } $this->_blShowPromotions = false; if (oxNew(\OxidEsales\Eshop\Application\Model\ActionList::class)->areAnyActivePromotions()) { $this->_blShowPromotions = (count($this->getPromoFinishedList()) + count($this->getPromoCurrentList()) + count($this->getPromoFutureList())) > 0; } return $this->_blShowPromotions; }
[ "public", "function", "getShowPromotionList", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_blShowPromotions", ")", ")", "{", "return", "$", "this", "->", "_blShowPromotions", ";", "}", "$", "this", "->", "_blShowPromotions", "=", "false", "...
should promotions list be shown? @return bool
[ "should", "promotions", "list", "be", "shown?" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2692-L2704
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.isEnabledPrivateSales
public function isEnabledPrivateSales() { if ($this->_blEnabledPrivateSales === null) { $this->_blEnabledPrivateSales = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blPsLoginEnabled'); if ($this->_blEnabledPrivateSales && ($canPreview = \OxidEsales\Eshop\Core\Registry::getUtils()->canPreview()) !== null) { $this->_blEnabledPrivateSales = !$canPreview; } } return $this->_blEnabledPrivateSales; }
php
public function isEnabledPrivateSales() { if ($this->_blEnabledPrivateSales === null) { $this->_blEnabledPrivateSales = (bool) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blPsLoginEnabled'); if ($this->_blEnabledPrivateSales && ($canPreview = \OxidEsales\Eshop\Core\Registry::getUtils()->canPreview()) !== null) { $this->_blEnabledPrivateSales = !$canPreview; } } return $this->_blEnabledPrivateSales; }
[ "public", "function", "isEnabledPrivateSales", "(", ")", "{", "if", "(", "$", "this", "->", "_blEnabledPrivateSales", "===", "null", ")", "{", "$", "this", "->", "_blEnabledPrivateSales", "=", "(", "bool", ")", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core"...
Checks if private sales is on @return bool
[ "Checks", "if", "private", "sales", "is", "on" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2711-L2721
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getInvoiceAddress
public function getInvoiceAddress() { if ($this->_aInvoiceAddress == null) { $invoiceAddress = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('invadr'); if ($invoiceAddress) { $this->_aInvoiceAddress = $invoiceAddress; } } return $this->_aInvoiceAddress; }
php
public function getInvoiceAddress() { if ($this->_aInvoiceAddress == null) { $invoiceAddress = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('invadr'); if ($invoiceAddress) { $this->_aInvoiceAddress = $invoiceAddress; } } return $this->_aInvoiceAddress; }
[ "public", "function", "getInvoiceAddress", "(", ")", "{", "if", "(", "$", "this", "->", "_aInvoiceAddress", "==", "null", ")", "{", "$", "invoiceAddress", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ...
Template variable getter. Returns user address @return array
[ "Template", "variable", "getter", ".", "Returns", "user", "address" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2768-L2778
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getDeliveryAddress
public function getDeliveryAddress() { if ($this->_aDeliveryAddress == null) { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); //do not show deladr if address was reloaded if (!$config->getRequestParameter('reloadaddress')) { $this->_aDeliveryAddress = $config->getRequestParameter('deladr'); } } return $this->_aDeliveryAddress; }
php
public function getDeliveryAddress() { if ($this->_aDeliveryAddress == null) { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); //do not show deladr if address was reloaded if (!$config->getRequestParameter('reloadaddress')) { $this->_aDeliveryAddress = $config->getRequestParameter('deladr'); } } return $this->_aDeliveryAddress; }
[ "public", "function", "getDeliveryAddress", "(", ")", "{", "if", "(", "$", "this", "->", "_aDeliveryAddress", "==", "null", ")", "{", "$", "config", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";",...
Template variable getter. Returns user delivery address @return array
[ "Template", "variable", "getter", ".", "Returns", "user", "delivery", "address" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2785-L2796
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getActiveUsername
public function getActiveUsername() { if ($this->_sActiveUsername == null) { $this->_sActiveUsername = false; $username = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('lgn_usr'); if ($username) { $this->_sActiveUsername = $username; } elseif ($user = $this->getUser()) { $this->_sActiveUsername = $user->oxuser__oxusername->value; } } return $this->_sActiveUsername; }
php
public function getActiveUsername() { if ($this->_sActiveUsername == null) { $this->_sActiveUsername = false; $username = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('lgn_usr'); if ($username) { $this->_sActiveUsername = $username; } elseif ($user = $this->getUser()) { $this->_sActiveUsername = $user->oxuser__oxusername->value; } } return $this->_sActiveUsername; }
[ "public", "function", "getActiveUsername", "(", ")", "{", "if", "(", "$", "this", "->", "_sActiveUsername", "==", "null", ")", "{", "$", "this", "->", "_sActiveUsername", "=", "false", ";", "$", "username", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "...
Template variable getter. Returns logged in user name @return string
[ "Template", "variable", "getter", ".", "Returns", "logged", "in", "user", "name" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2823-L2836
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getWishlistName
public function getWishlistName() { if ($this->getUser()) { $wishId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('wishid'); $userId = ($wishId) ? $wishId : \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('wishid'); if ($userId) { $wishUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($wishUser->load($userId)) { return $wishUser; } } } return false; }
php
public function getWishlistName() { if ($this->getUser()) { $wishId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('wishid'); $userId = ($wishId) ? $wishId : \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('wishid'); if ($userId) { $wishUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($wishUser->load($userId)) { return $wishUser; } } } return false; }
[ "public", "function", "getWishlistName", "(", ")", "{", "if", "(", "$", "this", "->", "getUser", "(", ")", ")", "{", "$", "wishId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestPa...
Template variable getter. Returns user name of searched wishlist @return string
[ "Template", "variable", "getter", ".", "Returns", "user", "name", "of", "searched", "wishlist" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L2985-L2999
train
OXID-eSales/oxideshop_ce
source/Application/Controller/FrontendController.php
FrontendController.getCompareItemsCnt
public function getCompareItemsCnt() { $compareController = oxNew(\OxidEsales\Eshop\Application\Controller\CompareController::class); return $compareController->getCompareItemsCnt(); }
php
public function getCompareItemsCnt() { $compareController = oxNew(\OxidEsales\Eshop\Application\Controller\CompareController::class); return $compareController->getCompareItemsCnt(); }
[ "public", "function", "getCompareItemsCnt", "(", ")", "{", "$", "compareController", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Controller", "\\", "CompareController", "::", "class", ")", ";", "return", "$", "compareControl...
Template variable getter. Returns article list count in comparison. @return integer
[ "Template", "variable", "getter", ".", "Returns", "article", "list", "count", "in", "comparison", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/FrontendController.php#L3016-L3021
train
OXID-eSales/oxideshop_ce
source/Application/Model/Newsletter.php
Newsletter._setParams
protected function _setParams($blPerfLoadAktion = false) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oShop = oxNew(\OxidEsales\Eshop\Application\Model\Shop::class); $oShop->load($myConfig->getShopId()); $oView = oxNew(\OxidEsales\Eshop\Application\Controller\FrontendController::class); $oShop = $oView->addGlobalParams($oShop); $oView->addTplParam('myshop', $oShop); $oView->addTplParam('shop', $oShop); $oView->addTplParam('oViewConf', $oShop); $oView->addTplParam('oView', $oView); $oView->addTplParam('mycurrency', $myConfig->getActShopCurrencyObject()); $oView->addTplParam('myuser', $this->_oUser); $this->_assignProducts($oView, $blPerfLoadAktion); $aInput[] = [$this->getId() . 'html', $this->oxnewsletter__oxtemplate->value]; $aInput[] = [$this->getId() . 'plain', $this->oxnewsletter__oxplaintemplate->value]; $aRes = \OxidEsales\Eshop\Core\Registry::getUtilsView()->parseThroughSmarty($aInput, null, $oView, true); $this->_sHtmlText = $aRes[0]; $this->_sPlainText = $aRes[1]; }
php
protected function _setParams($blPerfLoadAktion = false) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oShop = oxNew(\OxidEsales\Eshop\Application\Model\Shop::class); $oShop->load($myConfig->getShopId()); $oView = oxNew(\OxidEsales\Eshop\Application\Controller\FrontendController::class); $oShop = $oView->addGlobalParams($oShop); $oView->addTplParam('myshop', $oShop); $oView->addTplParam('shop', $oShop); $oView->addTplParam('oViewConf', $oShop); $oView->addTplParam('oView', $oView); $oView->addTplParam('mycurrency', $myConfig->getActShopCurrencyObject()); $oView->addTplParam('myuser', $this->_oUser); $this->_assignProducts($oView, $blPerfLoadAktion); $aInput[] = [$this->getId() . 'html', $this->oxnewsletter__oxtemplate->value]; $aInput[] = [$this->getId() . 'plain', $this->oxnewsletter__oxplaintemplate->value]; $aRes = \OxidEsales\Eshop\Core\Registry::getUtilsView()->parseThroughSmarty($aInput, null, $oView, true); $this->_sHtmlText = $aRes[0]; $this->_sPlainText = $aRes[1]; }
[ "protected", "function", "_setParams", "(", "$", "blPerfLoadAktion", "=", "false", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "oShop", "=", "oxNew", "(", "\\",...
Assigns to Smarty oxuser object, add newsletter products, adds products which fit to the last order of this user, generates HTML and plaintext format newsletters. @param bool $blPerfLoadAktion perform option load actions
[ "Assigns", "to", "Smarty", "oxuser", "object", "add", "newsletter", "products", "adds", "products", "which", "fit", "to", "the", "last", "order", "of", "this", "user", "generates", "HTML", "and", "plaintext", "format", "newsletters", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Newsletter.php#L180-L205
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator.validateBasketAmount
public function validateBasketAmount($amount) { $amount = str_replace(',', '.', $amount); if (!is_numeric($amount) || $amount < 0) { /** * @var \OxidEsales\Eshop\Core\Exception\ArticleInputException $exception */ $exception = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleInputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_INVALIDAMOUNT')); throw $exception; } if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowUnevenAmounts')) { $amount = round(( string ) $amount); } //negative amounts are not allowed //$dAmount = abs($dAmount); return $amount; }
php
public function validateBasketAmount($amount) { $amount = str_replace(',', '.', $amount); if (!is_numeric($amount) || $amount < 0) { /** * @var \OxidEsales\Eshop\Core\Exception\ArticleInputException $exception */ $exception = oxNew(\OxidEsales\Eshop\Core\Exception\ArticleInputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_INVALIDAMOUNT')); throw $exception; } if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blAllowUnevenAmounts')) { $amount = round(( string ) $amount); } //negative amounts are not allowed //$dAmount = abs($dAmount); return $amount; }
[ "public", "function", "validateBasketAmount", "(", "$", "amount", ")", "{", "$", "amount", "=", "str_replace", "(", "','", ",", "'.'", ",", "$", "amount", ")", ";", "if", "(", "!", "is_numeric", "(", "$", "amount", ")", "||", "$", "amount", "<", "0",...
Validates basket amount. @param float $amount Amount of article. @throws ArticleInputException If amount is not numeric or smaller 0. @return float
[ "Validates", "basket", "amount", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L95-L116
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator.checkPassword
public function checkPassword($user, $newPassword, $confirmationPassword, $shouldCheckPasswordLength = false) { // no password at all if ($shouldCheckPasswordLength && getStr()->strlen($newPassword) == 0) { $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_EMPTYPASS')); return $this->addValidationError("oxuser__oxpassword", $exception); } if ($shouldCheckPasswordLength && getStr()->strlen($newPassword) < $this->getPasswordLength()) { $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_TOO_SHORT')); return $this->addValidationError("oxuser__oxpassword", $exception); } // passwords do not match ? if ($newPassword != $confirmationPassword) { $exception = oxNew(\OxidEsales\Eshop\Core\Exception\UserException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH')); return $this->addValidationError("oxuser__oxpassword", $exception); } }
php
public function checkPassword($user, $newPassword, $confirmationPassword, $shouldCheckPasswordLength = false) { // no password at all if ($shouldCheckPasswordLength && getStr()->strlen($newPassword) == 0) { $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_EMPTYPASS')); return $this->addValidationError("oxuser__oxpassword", $exception); } if ($shouldCheckPasswordLength && getStr()->strlen($newPassword) < $this->getPasswordLength()) { $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_TOO_SHORT')); return $this->addValidationError("oxuser__oxpassword", $exception); } // passwords do not match ? if ($newPassword != $confirmationPassword) { $exception = oxNew(\OxidEsales\Eshop\Core\Exception\UserException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH')); return $this->addValidationError("oxuser__oxpassword", $exception); } }
[ "public", "function", "checkPassword", "(", "$", "user", ",", "$", "newPassword", ",", "$", "confirmationPassword", ",", "$", "shouldCheckPasswordLength", "=", "false", ")", "{", "// no password at all", "if", "(", "$", "shouldCheckPasswordLength", "&&", "getStr", ...
Checking if user password is fine. In case of error exception is thrown @param User $user Active user. @param string $newPassword New user password. @param string $confirmationPassword Retyped user password. @param bool $shouldCheckPasswordLength Option to check password length. @return Exception\StandardException|null
[ "Checking", "if", "user", "password", "is", "fine", ".", "In", "case", "of", "error", "exception", "is", "thrown" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L208-L232
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator.checkRequiredFields
public function checkRequiredFields($user, $billingAddress, $deliveryAddress) { /** @var \OxidEsales\Eshop\Application\Model\RequiredAddressFields $requiredAddressFields */ $requiredAddressFields = oxNew(\OxidEsales\Eshop\Application\Model\RequiredAddressFields::class); /** @var \OxidEsales\Eshop\Application\Model\RequiredFieldsValidator $fieldsValidator */ $fieldsValidator = oxNew(\OxidEsales\Eshop\Application\Model\RequiredFieldsValidator::class); /** @var User $user */ $user = oxNew(User::class); $billingAddress = $this->_setFields($user, $billingAddress); $fieldsValidator->setRequiredFields($requiredAddressFields->getBillingFields()); $fieldsValidator->validateFields($billingAddress); $invalidFields = $fieldsValidator->getInvalidFields(); if (!empty($deliveryAddress)) { /** @var \OxidEsales\Eshop\Application\Model\Address $deliveryAddress */ $deliveryAddress = $this->_setFields(oxNew(\OxidEsales\Eshop\Application\Model\Address::class), $deliveryAddress); $fieldsValidator->setRequiredFields($requiredAddressFields->getDeliveryFields()); $fieldsValidator->validateFields($deliveryAddress); $invalidFields = array_merge($invalidFields, $fieldsValidator->getInvalidFields()); } foreach ($invalidFields as $sField) { $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_NOTALLFIELDS')); $this->addValidationError($sField, $exception); } }
php
public function checkRequiredFields($user, $billingAddress, $deliveryAddress) { /** @var \OxidEsales\Eshop\Application\Model\RequiredAddressFields $requiredAddressFields */ $requiredAddressFields = oxNew(\OxidEsales\Eshop\Application\Model\RequiredAddressFields::class); /** @var \OxidEsales\Eshop\Application\Model\RequiredFieldsValidator $fieldsValidator */ $fieldsValidator = oxNew(\OxidEsales\Eshop\Application\Model\RequiredFieldsValidator::class); /** @var User $user */ $user = oxNew(User::class); $billingAddress = $this->_setFields($user, $billingAddress); $fieldsValidator->setRequiredFields($requiredAddressFields->getBillingFields()); $fieldsValidator->validateFields($billingAddress); $invalidFields = $fieldsValidator->getInvalidFields(); if (!empty($deliveryAddress)) { /** @var \OxidEsales\Eshop\Application\Model\Address $deliveryAddress */ $deliveryAddress = $this->_setFields(oxNew(\OxidEsales\Eshop\Application\Model\Address::class), $deliveryAddress); $fieldsValidator->setRequiredFields($requiredAddressFields->getDeliveryFields()); $fieldsValidator->validateFields($deliveryAddress); $invalidFields = array_merge($invalidFields, $fieldsValidator->getInvalidFields()); } foreach ($invalidFields as $sField) { $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_NOTALLFIELDS')); $this->addValidationError($sField, $exception); } }
[ "public", "function", "checkRequiredFields", "(", "$", "user", ",", "$", "billingAddress", ",", "$", "deliveryAddress", ")", "{", "/** @var \\OxidEsales\\Eshop\\Application\\Model\\RequiredAddressFields $requiredAddressFields */", "$", "requiredAddressFields", "=", "oxNew", "("...
Checking if all required fields were filled. In case of error exception is thrown @param User $user Active user. @param array $billingAddress Billing address. @param array $deliveryAddress Delivery address.
[ "Checking", "if", "all", "required", "fields", "were", "filled", ".", "In", "case", "of", "error", "exception", "is", "thrown" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L252-L281
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator._setFields
private function _setFields($object, $fields) { $fields = is_array($fields) ? $fields : []; foreach ($fields as $sKey => $sValue) { $object->$sKey = oxNew('oxField', $sValue); } return $object; }
php
private function _setFields($object, $fields) { $fields = is_array($fields) ? $fields : []; foreach ($fields as $sKey => $sValue) { $object->$sKey = oxNew('oxField', $sValue); } return $object; }
[ "private", "function", "_setFields", "(", "$", "object", ",", "$", "fields", ")", "{", "$", "fields", "=", "is_array", "(", "$", "fields", ")", "?", "$", "fields", ":", "[", "]", ";", "foreach", "(", "$", "fields", "as", "$", "sKey", "=>", "$", "...
Creates oxAddress object from given array. @param User|Address $object @param array $fields @return User|Address
[ "Creates", "oxAddress", "object", "from", "given", "array", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L291-L299
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator.checkVatId
public function checkVatId($user, $invAddress) { if ($this->_hasRequiredParametersForVatInCheck($invAddress)) { $country = $this->_getCountry($invAddress['oxuser__oxcountryid']); if ($country && $country->isInEU()) { $vatInValidator = $this->getCompanyVatInValidator($country); /** @var \OxidEsales\Eshop\Application\Model\CompanyVatIn $oVatIn */ $oVatIn = oxNew('oxCompanyVatIn', $invAddress['oxuser__oxustid']); if (!$vatInValidator->validate($oVatIn)) { /** @var \OxidEsales\Eshop\Core\Exception\InputException $exception */ $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('VAT_MESSAGE_' . $vatInValidator->getError())); return $this->addValidationError("oxuser__oxustid", $exception); } } } elseif ($invAddress['oxuser__oxustid'] && !$invAddress['oxuser__oxcompany']) { /** @var \OxidEsales\Eshop\Core\Exception\InputException $exception */ $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('VAT_MESSAGE_COMPANY_MISSING')); return $this->addValidationError("oxuser__oxcompany", $exception); } }
php
public function checkVatId($user, $invAddress) { if ($this->_hasRequiredParametersForVatInCheck($invAddress)) { $country = $this->_getCountry($invAddress['oxuser__oxcountryid']); if ($country && $country->isInEU()) { $vatInValidator = $this->getCompanyVatInValidator($country); /** @var \OxidEsales\Eshop\Application\Model\CompanyVatIn $oVatIn */ $oVatIn = oxNew('oxCompanyVatIn', $invAddress['oxuser__oxustid']); if (!$vatInValidator->validate($oVatIn)) { /** @var \OxidEsales\Eshop\Core\Exception\InputException $exception */ $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('VAT_MESSAGE_' . $vatInValidator->getError())); return $this->addValidationError("oxuser__oxustid", $exception); } } } elseif ($invAddress['oxuser__oxustid'] && !$invAddress['oxuser__oxcompany']) { /** @var \OxidEsales\Eshop\Core\Exception\InputException $exception */ $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class); $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('VAT_MESSAGE_COMPANY_MISSING')); return $this->addValidationError("oxuser__oxcompany", $exception); } }
[ "public", "function", "checkVatId", "(", "$", "user", ",", "$", "invAddress", ")", "{", "if", "(", "$", "this", "->", "_hasRequiredParametersForVatInCheck", "(", "$", "invAddress", ")", ")", "{", "$", "country", "=", "$", "this", "->", "_getCountry", "(", ...
Checks if user passed VAT id is valid. Exception is thrown if id is not valid. @param User $user Active user. @param array $invAddress User input array. @return null
[ "Checks", "if", "user", "passed", "VAT", "id", "is", "valid", ".", "Exception", "is", "thrown", "if", "id", "is", "not", "valid", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L342-L368
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator._getCountry
protected function _getCountry($countryId) { $country = oxNew(\OxidEsales\Eshop\Application\Model\Country::class); $country->load($countryId); return $country; }
php
protected function _getCountry($countryId) { $country = oxNew(\OxidEsales\Eshop\Application\Model\Country::class); $country->load($countryId); return $country; }
[ "protected", "function", "_getCountry", "(", "$", "countryId", ")", "{", "$", "country", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "Country", "::", "class", ")", ";", "$", "country", "->", "load", "("...
Load and return Country object. @param string $countryId @return \OxidEsales\Eshop\Application\Model\Country
[ "Load", "and", "return", "Country", "object", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L378-L384
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator.validatePaymentInputData
public function validatePaymentInputData($paymentId, & $dynamicValue) { $validationResult = true; switch ($paymentId) { case 'oxidcreditcard': $validationResult = false; $idAllCreditCardInformationSet = $this->_isAllBankInformationSet($this->_aRequiredCCFields, $dynamicValue); $doesCreditCardTypeExist = in_array($dynamicValue['kktype'], $this->_aPossibleCCType); if ($idAllCreditCardInformationSet && $doesCreditCardTypeExist) { $cardValidator = oxNew(\OxidEsales\Eshop\Core\CreditCardValidator::class); $validationResult = $cardValidator->isValidCard( $dynamicValue['kknumber'], $dynamicValue['kktype'], $dynamicValue['kkmonth'] . substr($dynamicValue['kkyear'], 2, 2) ); } break; case "oxiddebitnote": $validationResult = false; if ($this->_isAllBankInformationSet($this->_aRequiredDCFields, $dynamicValue)) { $validationResult = $this->_validateDebitNote($dynamicValue); } break; } return $validationResult; }
php
public function validatePaymentInputData($paymentId, & $dynamicValue) { $validationResult = true; switch ($paymentId) { case 'oxidcreditcard': $validationResult = false; $idAllCreditCardInformationSet = $this->_isAllBankInformationSet($this->_aRequiredCCFields, $dynamicValue); $doesCreditCardTypeExist = in_array($dynamicValue['kktype'], $this->_aPossibleCCType); if ($idAllCreditCardInformationSet && $doesCreditCardTypeExist) { $cardValidator = oxNew(\OxidEsales\Eshop\Core\CreditCardValidator::class); $validationResult = $cardValidator->isValidCard( $dynamicValue['kknumber'], $dynamicValue['kktype'], $dynamicValue['kkmonth'] . substr($dynamicValue['kkyear'], 2, 2) ); } break; case "oxiddebitnote": $validationResult = false; if ($this->_isAllBankInformationSet($this->_aRequiredDCFields, $dynamicValue)) { $validationResult = $this->_validateDebitNote($dynamicValue); } break; } return $validationResult; }
[ "public", "function", "validatePaymentInputData", "(", "$", "paymentId", ",", "&", "$", "dynamicValue", ")", "{", "$", "validationResult", "=", "true", ";", "switch", "(", "$", "paymentId", ")", "{", "case", "'oxidcreditcard'", ":", "$", "validationResult", "=...
Validates payment input data for credit card and debit note. @param string $paymentId The payment id of current payment. @param array $dynamicValue Values of payment. @return bool
[ "Validates", "payment", "input", "data", "for", "credit", "card", "and", "debit", "note", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L417-L449
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator._validateDebitNote
protected function _validateDebitNote($debitInformation) { $debitInformation = $this->_cleanDebitInformation($debitInformation); $bankCode = $debitInformation['lsblz']; $accountNumber = $debitInformation['lsktonr']; $sepaValidator = oxNew(SepaValidator::class); if ($sepaValidator->isValidBIC($bankCode)) { $validateResult = true; if (!$sepaValidator->isValidIBAN($accountNumber)) { $validateResult = self::INVALID_ACCOUNT_NUMBER; } } else { $validateResult = self::INVALID_BANK_CODE; if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blSkipDebitOldBankInfo')) { $validateResult = $this->_validateOldDebitInfo($debitInformation); } } return $validateResult; }
php
protected function _validateDebitNote($debitInformation) { $debitInformation = $this->_cleanDebitInformation($debitInformation); $bankCode = $debitInformation['lsblz']; $accountNumber = $debitInformation['lsktonr']; $sepaValidator = oxNew(SepaValidator::class); if ($sepaValidator->isValidBIC($bankCode)) { $validateResult = true; if (!$sepaValidator->isValidIBAN($accountNumber)) { $validateResult = self::INVALID_ACCOUNT_NUMBER; } } else { $validateResult = self::INVALID_BANK_CODE; if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blSkipDebitOldBankInfo')) { $validateResult = $this->_validateOldDebitInfo($debitInformation); } } return $validateResult; }
[ "protected", "function", "_validateDebitNote", "(", "$", "debitInformation", ")", "{", "$", "debitInformation", "=", "$", "this", "->", "_cleanDebitInformation", "(", "$", "debitInformation", ")", ";", "$", "bankCode", "=", "$", "debitInformation", "[", "'lsblz'",...
Validates debit note. @param array $debitInformation Debit information @return bool|int
[ "Validates", "debit", "note", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L472-L492
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator._validateOldDebitInfo
protected function _validateOldDebitInfo($debitInfo) { $stringHelper = getStr(); $debitInfo = $this->_fixAccountNumber($debitInfo); $validationResult = true; if (!$stringHelper->preg_match("/^\d{5,8}$/", $debitInfo['lsblz'])) { // Bank code is invalid $validationResult = self::INVALID_BANK_CODE; } if (true === $validationResult && !$stringHelper->preg_match("/^\d{10,12}$/", $debitInfo['lsktonr'])) { // Account number is invalid $validationResult = self::INVALID_ACCOUNT_NUMBER; } return $validationResult; }
php
protected function _validateOldDebitInfo($debitInfo) { $stringHelper = getStr(); $debitInfo = $this->_fixAccountNumber($debitInfo); $validationResult = true; if (!$stringHelper->preg_match("/^\d{5,8}$/", $debitInfo['lsblz'])) { // Bank code is invalid $validationResult = self::INVALID_BANK_CODE; } if (true === $validationResult && !$stringHelper->preg_match("/^\d{10,12}$/", $debitInfo['lsktonr'])) { // Account number is invalid $validationResult = self::INVALID_ACCOUNT_NUMBER; } return $validationResult; }
[ "protected", "function", "_validateOldDebitInfo", "(", "$", "debitInfo", ")", "{", "$", "stringHelper", "=", "getStr", "(", ")", ";", "$", "debitInfo", "=", "$", "this", "->", "_fixAccountNumber", "(", "$", "debitInfo", ")", ";", "$", "validationResult", "="...
Validates old debit info. @param array $debitInfo Debit info @return bool|int
[ "Validates", "old", "debit", "info", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L501-L520
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator._fixAccountNumber
protected function _fixAccountNumber($debitInfo) { $oStr = getStr(); if ($oStr->strlen($debitInfo['lsktonr']) < 10) { $sNewNum = str_repeat( '0', 10 - $oStr->strlen($debitInfo['lsktonr']) ) . $debitInfo['lsktonr']; $debitInfo['lsktonr'] = $sNewNum; } return $debitInfo; }
php
protected function _fixAccountNumber($debitInfo) { $oStr = getStr(); if ($oStr->strlen($debitInfo['lsktonr']) < 10) { $sNewNum = str_repeat( '0', 10 - $oStr->strlen($debitInfo['lsktonr']) ) . $debitInfo['lsktonr']; $debitInfo['lsktonr'] = $sNewNum; } return $debitInfo; }
[ "protected", "function", "_fixAccountNumber", "(", "$", "debitInfo", ")", "{", "$", "oStr", "=", "getStr", "(", ")", ";", "if", "(", "$", "oStr", "->", "strlen", "(", "$", "debitInfo", "[", "'lsktonr'", "]", ")", "<", "10", ")", "{", "$", "sNewNum", ...
If account number is shorter than 10, add zeros in front of number. @param array $debitInfo Debit info. @return array
[ "If", "account", "number", "is", "shorter", "than", "10", "add", "zeros", "in", "front", "of", "number", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L529-L542
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator._isAllBankInformationSet
protected function _isAllBankInformationSet($requiredFields, $bankInformation) { $isSet = true; foreach ($requiredFields as $fieldName) { if (!isset($bankInformation[$fieldName]) || !trim($bankInformation[$fieldName])) { $isSet = false; break; } } return $isSet; }
php
protected function _isAllBankInformationSet($requiredFields, $bankInformation) { $isSet = true; foreach ($requiredFields as $fieldName) { if (!isset($bankInformation[$fieldName]) || !trim($bankInformation[$fieldName])) { $isSet = false; break; } } return $isSet; }
[ "protected", "function", "_isAllBankInformationSet", "(", "$", "requiredFields", ",", "$", "bankInformation", ")", "{", "$", "isSet", "=", "true", ";", "foreach", "(", "$", "requiredFields", "as", "$", "fieldName", ")", "{", "if", "(", "!", "isset", "(", "...
Checks if all bank information is set. @param array $requiredFields fields must be set. @param array $bankInformation actual information. @return bool
[ "Checks", "if", "all", "bank", "information", "is", "set", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L552-L563
train
OXID-eSales/oxideshop_ce
source/Core/InputValidator.php
InputValidator.getCompanyVatInValidator
public function getCompanyVatInValidator($country) { if (is_null($this->_oCompanyVatInValidator)) { /** @var \OxidEsales\Eshop\Core\CompanyVatInValidator $vatInValidator */ $vatInValidator = oxNew('oxCompanyVatInValidator', $country); /** @var \OxidEsales\Eshop\Core\CompanyVatInCountryChecker $validator */ $validator = oxNew(\OxidEsales\Eshop\Core\CompanyVatInCountryChecker::class); $vatInValidator->addChecker($validator); /** @var \OxidEsales\Eshop\Core\OnlineVatIdCheck $onlineValidator */ if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("blVatIdCheckDisabled")) { $onlineValidator = oxNew(\OxidEsales\Eshop\Core\OnlineVatIdCheck::class); $vatInValidator->addChecker($onlineValidator); } $this->setCompanyVatInValidator($vatInValidator); } return $this->_oCompanyVatInValidator; }
php
public function getCompanyVatInValidator($country) { if (is_null($this->_oCompanyVatInValidator)) { /** @var \OxidEsales\Eshop\Core\CompanyVatInValidator $vatInValidator */ $vatInValidator = oxNew('oxCompanyVatInValidator', $country); /** @var \OxidEsales\Eshop\Core\CompanyVatInCountryChecker $validator */ $validator = oxNew(\OxidEsales\Eshop\Core\CompanyVatInCountryChecker::class); $vatInValidator->addChecker($validator); /** @var \OxidEsales\Eshop\Core\OnlineVatIdCheck $onlineValidator */ if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("blVatIdCheckDisabled")) { $onlineValidator = oxNew(\OxidEsales\Eshop\Core\OnlineVatIdCheck::class); $vatInValidator->addChecker($onlineValidator); } $this->setCompanyVatInValidator($vatInValidator); } return $this->_oCompanyVatInValidator; }
[ "public", "function", "getCompanyVatInValidator", "(", "$", "country", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "_oCompanyVatInValidator", ")", ")", "{", "/** @var \\OxidEsales\\Eshop\\Core\\CompanyVatInValidator $vatInValidator */", "$", "vatInValidator", ...
Return VAT IN validator. @param \OxidEsales\Eshop\Application\Model\Country $country Country according which VAT id should be checked. @return \OxidEsales\Eshop\Core\CompanyVatInValidator
[ "Return", "VAT", "IN", "validator", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/InputValidator.php#L609-L630
train
OXID-eSales/oxideshop_ce
source/Core/ShopIdCalculator.php
ShopIdCalculator._getShopUrlMap
protected function _getShopUrlMap() { //get from static cache if (isset(self::$urlMap)) { return self::$urlMap; } //get from file cache $aMap = $this->getVariablesCache()->getFromCache("urlMap"); if (!is_null($aMap)) { self::$urlMap = $aMap; return $aMap; } $aMap = []; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sConfKey = $this->_getConfKey(); $sSelect = "SELECT oxshopid, oxvarname, DECODE( oxvarvalue , " . $oDb->quote($sConfKey) . " ) as oxvarvalue " . "FROM oxconfig WHERE oxvarname in ('aLanguageURLs','sMallShopURL','sMallSSLShopURL')"; // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); $oRs = $masterDb->select($sSelect, false); if ($oRs && $oRs->count() > 0) { while (!$oRs->EOF) { $iShp = (int) $oRs->fields[0]; $sVar = $oRs->fields[1]; $sURL = $oRs->fields[2]; if ($sVar == 'aLanguageURLs') { $aUrls = unserialize($sURL); if (is_array($aUrls) && count($aUrls)) { $aUrls = array_filter($aUrls); $aUrls = array_fill_keys($aUrls, $iShp); $aMap = array_merge($aMap, $aUrls); } } elseif ($sURL) { $aMap[$sURL] = $iShp; } $oRs->fetchRow(); } } //save to cache $this->getVariablesCache()->setToCache("urlMap", $aMap); self::$urlMap = $aMap; return $aMap; }
php
protected function _getShopUrlMap() { //get from static cache if (isset(self::$urlMap)) { return self::$urlMap; } //get from file cache $aMap = $this->getVariablesCache()->getFromCache("urlMap"); if (!is_null($aMap)) { self::$urlMap = $aMap; return $aMap; } $aMap = []; $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sConfKey = $this->_getConfKey(); $sSelect = "SELECT oxshopid, oxvarname, DECODE( oxvarvalue , " . $oDb->quote($sConfKey) . " ) as oxvarvalue " . "FROM oxconfig WHERE oxvarname in ('aLanguageURLs','sMallShopURL','sMallSSLShopURL')"; // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); $oRs = $masterDb->select($sSelect, false); if ($oRs && $oRs->count() > 0) { while (!$oRs->EOF) { $iShp = (int) $oRs->fields[0]; $sVar = $oRs->fields[1]; $sURL = $oRs->fields[2]; if ($sVar == 'aLanguageURLs') { $aUrls = unserialize($sURL); if (is_array($aUrls) && count($aUrls)) { $aUrls = array_filter($aUrls); $aUrls = array_fill_keys($aUrls, $iShp); $aMap = array_merge($aMap, $aUrls); } } elseif ($sURL) { $aMap[$sURL] = $iShp; } $oRs->fetchRow(); } } //save to cache $this->getVariablesCache()->setToCache("urlMap", $aMap); self::$urlMap = $aMap; return $aMap; }
[ "protected", "function", "_getShopUrlMap", "(", ")", "{", "//get from static cache", "if", "(", "isset", "(", "self", "::", "$", "urlMap", ")", ")", "{", "return", "self", "::", "$", "urlMap", ";", "}", "//get from file cache", "$", "aMap", "=", "$", "this...
Returns shop url to id map from config. @return array
[ "Returns", "shop", "url", "to", "id", "map", "from", "config", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopIdCalculator.php#L65-L118
train
OXID-eSales/oxideshop_ce
source/Application/Model/UserPayment.php
UserPayment.load
public function load($sOxId) { $sSelect = 'select oxid, oxuserid, oxpaymentsid, DECODE( oxvalue, "' . $this->getPaymentKey() . '" ) as oxvalue from oxuserpayments where oxid = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOxId); return $this->assignRecord($sSelect); }
php
public function load($sOxId) { $sSelect = 'select oxid, oxuserid, oxpaymentsid, DECODE( oxvalue, "' . $this->getPaymentKey() . '" ) as oxvalue from oxuserpayments where oxid = ' . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOxId); return $this->assignRecord($sSelect); }
[ "public", "function", "load", "(", "$", "sOxId", ")", "{", "$", "sSelect", "=", "'select oxid, oxuserid, oxpaymentsid, DECODE( oxvalue, \"'", ".", "$", "this", "->", "getPaymentKey", "(", ")", ".", "'\" ) as oxvalue\n from oxuserpayments where oxid = '", ...
Loads user payment object @param string $sOxId oxuserpayment id @return mixed
[ "Loads", "user", "payment", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/UserPayment.php#L118-L124
train
OXID-eSales/oxideshop_ce
source/Application/Model/UserPayment.php
UserPayment._insert
protected function _insert() { // we do not store credit card information // check and in case skip it if (!$this->getStoreCreditCardInfo() && $this->oxuserpayments__oxpaymentsid->value == 'oxidcreditcard') { return true; } //encode sensitive data if ($sValue = $this->oxuserpayments__oxvalue->value) { // Function is called from inside a transaction in Category::save (see ESDEV-3804 and ESDEV-3822). // No need to explicitly force master here. $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sEncodedValue = $database->getOne("select encode( " . $database->quote($sValue) . ", '" . $this->getPaymentKey() . "' )"); $this->oxuserpayments__oxvalue->setValue($sEncodedValue); } $blRet = parent::_insert(); //restore, as encoding was needed only for saving if ($sEncodedValue) { $this->oxuserpayments__oxvalue->setValue($sValue); } return $blRet; }
php
protected function _insert() { // we do not store credit card information // check and in case skip it if (!$this->getStoreCreditCardInfo() && $this->oxuserpayments__oxpaymentsid->value == 'oxidcreditcard') { return true; } //encode sensitive data if ($sValue = $this->oxuserpayments__oxvalue->value) { // Function is called from inside a transaction in Category::save (see ESDEV-3804 and ESDEV-3822). // No need to explicitly force master here. $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sEncodedValue = $database->getOne("select encode( " . $database->quote($sValue) . ", '" . $this->getPaymentKey() . "' )"); $this->oxuserpayments__oxvalue->setValue($sEncodedValue); } $blRet = parent::_insert(); //restore, as encoding was needed only for saving if ($sEncodedValue) { $this->oxuserpayments__oxvalue->setValue($sValue); } return $blRet; }
[ "protected", "function", "_insert", "(", ")", "{", "// we do not store credit card information", "// check and in case skip it", "if", "(", "!", "$", "this", "->", "getStoreCreditCardInfo", "(", ")", "&&", "$", "this", "->", "oxuserpayments__oxpaymentsid", "->", "value"...
Inserts payment information to DB. Returns insert status. @return bool
[ "Inserts", "payment", "information", "to", "DB", ".", "Returns", "insert", "status", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/UserPayment.php#L132-L157
train
OXID-eSales/oxideshop_ce
source/Application/Model/UserPayment.php
UserPayment._update
protected function _update() { //encode sensitive data if ($sValue = $this->oxuserpayments__oxvalue->value) { // Function is called from inside a transaction in Category::save (see ESDEV-3804 and ESDEV-3822). // No need to explicitly force master here. $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sEncodedValue = $database->getOne("select encode( " . $database->quote($sValue) . ", '" . $this->getPaymentKey() . "' )"); $this->oxuserpayments__oxvalue->setValue($sEncodedValue); } $blRet = parent::_update(); //restore, as encoding was needed only for saving if ($sEncodedValue) { $this->oxuserpayments__oxvalue->setValue($sValue); } return $blRet; }
php
protected function _update() { //encode sensitive data if ($sValue = $this->oxuserpayments__oxvalue->value) { // Function is called from inside a transaction in Category::save (see ESDEV-3804 and ESDEV-3822). // No need to explicitly force master here. $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sEncodedValue = $database->getOne("select encode( " . $database->quote($sValue) . ", '" . $this->getPaymentKey() . "' )"); $this->oxuserpayments__oxvalue->setValue($sEncodedValue); } $blRet = parent::_update(); //restore, as encoding was needed only for saving if ($sEncodedValue) { $this->oxuserpayments__oxvalue->setValue($sValue); } return $blRet; }
[ "protected", "function", "_update", "(", ")", "{", "//encode sensitive data", "if", "(", "$", "sValue", "=", "$", "this", "->", "oxuserpayments__oxvalue", "->", "value", ")", "{", "// Function is called from inside a transaction in Category::save (see ESDEV-3804 and ESDEV-382...
Updates payment record in DB. Returns update status. @return bool
[ "Updates", "payment", "record", "in", "DB", ".", "Returns", "update", "status", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/UserPayment.php#L164-L185
train
OXID-eSales/oxideshop_ce
source/Application/Model/UserPayment.php
UserPayment.getPaymentByPaymentType
public function getPaymentByPaymentType($oUser = null, $sPaymentType = null) { $blGet = false; if ($oUser && $sPaymentType != null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = 'select oxpaymentid from oxorder where oxpaymenttype=' . $oDb->quote($sPaymentType) . ' and oxuserid=' . $oDb->quote($oUser->getId()) . ' order by oxorderdate desc'; if (($sOxId = $oDb->getOne($sQ))) { $blGet = $this->load($sOxId); } } return $blGet; }
php
public function getPaymentByPaymentType($oUser = null, $sPaymentType = null) { $blGet = false; if ($oUser && $sPaymentType != null) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = 'select oxpaymentid from oxorder where oxpaymenttype=' . $oDb->quote($sPaymentType) . ' and oxuserid=' . $oDb->quote($oUser->getId()) . ' order by oxorderdate desc'; if (($sOxId = $oDb->getOne($sQ))) { $blGet = $this->load($sOxId); } } return $blGet; }
[ "public", "function", "getPaymentByPaymentType", "(", "$", "oUser", "=", "null", ",", "$", "sPaymentType", "=", "null", ")", "{", "$", "blGet", "=", "false", ";", "if", "(", "$", "oUser", "&&", "$", "sPaymentType", "!=", "null", ")", "{", "$", "oDb", ...
Get user payment by payment id @param \OxidEsales\Eshop\Application\Model\User $oUser user object @param string $sPaymentType payment type @return bool
[ "Get", "user", "payment", "by", "payment", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/UserPayment.php#L215-L228
train
OXID-eSales/oxideshop_ce
source/Setup/Setup.php
Setup.getCurrentStep
public function getCurrentStep() { if ($this->_iCurrStep === null) { if (($this->_iCurrStep = $this->getInstance("Utilities")->getRequestVar("istep")) === null) { $this->_iCurrStep = $this->getStep('STEP_SYSTEMREQ'); } $this->_iCurrStep = (int) $this->_iCurrStep; } return $this->_iCurrStep; }
php
public function getCurrentStep() { if ($this->_iCurrStep === null) { if (($this->_iCurrStep = $this->getInstance("Utilities")->getRequestVar("istep")) === null) { $this->_iCurrStep = $this->getStep('STEP_SYSTEMREQ'); } $this->_iCurrStep = (int) $this->_iCurrStep; } return $this->_iCurrStep; }
[ "public", "function", "getCurrentStep", "(", ")", "{", "if", "(", "$", "this", "->", "_iCurrStep", "===", "null", ")", "{", "if", "(", "(", "$", "this", "->", "_iCurrStep", "=", "$", "this", "->", "getInstance", "(", "\"Utilities\"", ")", "->", "getReq...
Returns current setup step index @return int
[ "Returns", "current", "setup", "step", "index" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Setup.php#L100-L110
train
OXID-eSales/oxideshop_ce
source/Setup/Setup.php
Setup.alreadySetUp
public function alreadySetUp() { $blSetUp = false; $sConfig = join("", file(getShopBasePath() . "config.inc.php")); if (strpos($sConfig, "<dbHost>") === false) { $blSetUp = true; } return $blSetUp; }
php
public function alreadySetUp() { $blSetUp = false; $sConfig = join("", file(getShopBasePath() . "config.inc.php")); if (strpos($sConfig, "<dbHost>") === false) { $blSetUp = true; } return $blSetUp; }
[ "public", "function", "alreadySetUp", "(", ")", "{", "$", "blSetUp", "=", "false", ";", "$", "sConfig", "=", "join", "(", "\"\"", ",", "file", "(", "getShopBasePath", "(", ")", ".", "\"config.inc.php\"", ")", ")", ";", "if", "(", "strpos", "(", "$", ...
Checks if config file is alleady filled with data @return bool
[ "Checks", "if", "config", "file", "is", "alleady", "filled", "with", "data" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Setup.php#L137-L146
train
OXID-eSales/oxideshop_ce
source/Setup/Setup.php
Setup.deleteSetupDirectory
public function deleteSetupDirectory() { $blDeleteSetupDirectory = true; $sConfig = join("", file(getShopBasePath() . "config.inc.php")); if (strpos($sConfig, "this->blDelSetupDir = false;") !== false) { $blDeleteSetupDirectory = false; } return $blDeleteSetupDirectory; }
php
public function deleteSetupDirectory() { $blDeleteSetupDirectory = true; $sConfig = join("", file(getShopBasePath() . "config.inc.php")); if (strpos($sConfig, "this->blDelSetupDir = false;") !== false) { $blDeleteSetupDirectory = false; } return $blDeleteSetupDirectory; }
[ "public", "function", "deleteSetupDirectory", "(", ")", "{", "$", "blDeleteSetupDirectory", "=", "true", ";", "$", "sConfig", "=", "join", "(", "\"\"", ",", "file", "(", "getShopBasePath", "(", ")", ".", "\"config.inc.php\"", ")", ")", ";", "if", "(", "str...
Decides if leave or delete Setup directory dependent from configuration. @return bool
[ "Decides", "if", "leave", "or", "delete", "Setup", "directory", "dependent", "from", "configuration", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Setup.php#L153-L163
train
OXID-eSales/oxideshop_ce
source/Setup/Setup.php
Setup.getStep
public function getStep($sStepId) { $steps = $this->getSteps(); return isset($steps[$sStepId]) ? $steps[$sStepId] : null; }
php
public function getStep($sStepId) { $steps = $this->getSteps(); return isset($steps[$sStepId]) ? $steps[$sStepId] : null; }
[ "public", "function", "getStep", "(", "$", "sStepId", ")", "{", "$", "steps", "=", "$", "this", "->", "getSteps", "(", ")", ";", "return", "isset", "(", "$", "steps", "[", "$", "sStepId", "]", ")", "?", "$", "steps", "[", "$", "sStepId", "]", ":"...
Returns setup step index @param string $sStepId setup step identifier @return int
[ "Returns", "setup", "step", "index" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Setup.php#L192-L196
train
OXID-eSales/oxideshop_ce
source/Core/Str.php
Str.getStr
public static function getStr() { if (!isset(self::$_oHandler)) { //let's init now non-static instance of oxStr to get the instance of str handler self::$_oHandler = oxNew(\OxidEsales\Eshop\Core\Str::class)->_getStrHandler(); } return self::$_oHandler; }
php
public static function getStr() { if (!isset(self::$_oHandler)) { //let's init now non-static instance of oxStr to get the instance of str handler self::$_oHandler = oxNew(\OxidEsales\Eshop\Core\Str::class)->_getStrHandler(); } return self::$_oHandler; }
[ "public", "static", "function", "getStr", "(", ")", "{", "if", "(", "!", "isset", "(", "self", "::", "$", "_oHandler", ")", ")", "{", "//let's init now non-static instance of oxStr to get the instance of str handler", "self", "::", "$", "_oHandler", "=", "oxNew", ...
Static method initializing new string handler or returning the existing one. @return StrRegular|StrMb
[ "Static", "method", "initializing", "new", "string", "handler", "or", "returning", "the", "existing", "one", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Str.php#L39-L47
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/DiscountMain.php
DiscountMain.getItemDiscountProductTitle
public function getItemDiscountProductTitle() { $sTitle = false; $sOxId = $this->getEditObjectId(); if (isset($sOxId) && $sOxId != "-1") { $sViewName = getViewName("oxarticles", $this->_iEditLang); // Reading from slave is ok here (see ESDEV-3804 and ESDEV-3822). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "select concat( $sViewName.oxartnum, ' ', $sViewName.oxtitle ) from oxdiscount left join $sViewName on $sViewName.oxid=oxdiscount.oxitmartid where oxdiscount.oxitmartid != '' and oxdiscount.oxid=" . $database->quote($sOxId); $sTitle = $database->getOne($sQ); } return $sTitle ? $sTitle : " -- "; }
php
public function getItemDiscountProductTitle() { $sTitle = false; $sOxId = $this->getEditObjectId(); if (isset($sOxId) && $sOxId != "-1") { $sViewName = getViewName("oxarticles", $this->_iEditLang); // Reading from slave is ok here (see ESDEV-3804 and ESDEV-3822). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "select concat( $sViewName.oxartnum, ' ', $sViewName.oxtitle ) from oxdiscount left join $sViewName on $sViewName.oxid=oxdiscount.oxitmartid where oxdiscount.oxitmartid != '' and oxdiscount.oxid=" . $database->quote($sOxId); $sTitle = $database->getOne($sQ); } return $sTitle ? $sTitle : " -- "; }
[ "public", "function", "getItemDiscountProductTitle", "(", ")", "{", "$", "sTitle", "=", "false", ";", "$", "sOxId", "=", "$", "this", "->", "getEditObjectId", "(", ")", ";", "if", "(", "isset", "(", "$", "sOxId", ")", "&&", "$", "sOxId", "!=", "\"-1\""...
Returns item discount product title @return string
[ "Returns", "item", "discount", "product", "title" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DiscountMain.php#L89-L104
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/DiscountMain.php
DiscountMain.save
public function save() { parent::save(); $sOxId = $this->getEditObjectId(); $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $oDiscount = oxNew(\OxidEsales\Eshop\Application\Model\Discount::class); if ($sOxId != "-1") { $oDiscount->load($sOxId); } else { $aParams['oxdiscount__oxid'] = null; } // checkbox handling if (!isset($aParams['oxdiscount__oxactive'])) { $aParams['oxdiscount__oxactive'] = 0; } //disabling derived items if ($oDiscount->isDerived()) { return; } //$aParams = $oAttr->ConvertNameArray2Idx( $aParams); $oDiscount->setLanguage(0); $oDiscount->assign($aParams); $oDiscount->setLanguage($this->_iEditLang); $oDiscount = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->processFiles($oDiscount); try { $oDiscount->save(); } catch (\oxInputException $exception) { $newException = oxNew(\OxidEsales\Eshop\Core\Exception\ExceptionToDisplay::class); $newException->setMessage($exception->getMessage()); $this->addTplParam('discount_title', $aParams['oxdiscount__oxtitle']); if (false !== strpos($exception->getMessage(), 'DISCOUNT_ERROR_OXSORT')) { $messageArgument = \OxidEsales\Eshop\Core\Registry::getLang()->translateString('DISCOUNT_MAIN_SORT', \OxidEsales\Eshop\Core\Registry::getLang()->getTplLanguage(), true); $newException->setMessageArgs($messageArgument); } \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($newException); return; } // set oxid if inserted $this->setEditObjectId($oDiscount->getId()); }
php
public function save() { parent::save(); $sOxId = $this->getEditObjectId(); $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $oDiscount = oxNew(\OxidEsales\Eshop\Application\Model\Discount::class); if ($sOxId != "-1") { $oDiscount->load($sOxId); } else { $aParams['oxdiscount__oxid'] = null; } // checkbox handling if (!isset($aParams['oxdiscount__oxactive'])) { $aParams['oxdiscount__oxactive'] = 0; } //disabling derived items if ($oDiscount->isDerived()) { return; } //$aParams = $oAttr->ConvertNameArray2Idx( $aParams); $oDiscount->setLanguage(0); $oDiscount->assign($aParams); $oDiscount->setLanguage($this->_iEditLang); $oDiscount = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->processFiles($oDiscount); try { $oDiscount->save(); } catch (\oxInputException $exception) { $newException = oxNew(\OxidEsales\Eshop\Core\Exception\ExceptionToDisplay::class); $newException->setMessage($exception->getMessage()); $this->addTplParam('discount_title', $aParams['oxdiscount__oxtitle']); if (false !== strpos($exception->getMessage(), 'DISCOUNT_ERROR_OXSORT')) { $messageArgument = \OxidEsales\Eshop\Core\Registry::getLang()->translateString('DISCOUNT_MAIN_SORT', \OxidEsales\Eshop\Core\Registry::getLang()->getTplLanguage(), true); $newException->setMessageArgs($messageArgument); } \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($newException); return; } // set oxid if inserted $this->setEditObjectId($oDiscount->getId()); }
[ "public", "function", "save", "(", ")", "{", "parent", "::", "save", "(", ")", ";", "$", "sOxId", "=", "$", "this", "->", "getEditObjectId", "(", ")", ";", "$", "aParams", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", ...
Saves changed selected discount parameters. @return mixed
[ "Saves", "changed", "selected", "discount", "parameters", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DiscountMain.php#L111-L159
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/DiscountMain.php
DiscountMain.saveinnlang
public function saveinnlang() { parent::save(); $sOxId = $this->getEditObjectId(); $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $oAttr = oxNew(\OxidEsales\Eshop\Application\Model\Discount::class); if ($sOxId != "-1") { $oAttr->load($sOxId); } else { $aParams['oxdiscount__oxid'] = null; } // checkbox handling if (!isset($aParams['oxdiscount__oxactive'])) { $aParams['oxdiscount__oxactive'] = 0; } //disabling derived items if ($oAttr->isDerived()) { return; } //$aParams = $oAttr->ConvertNameArray2Idx( $aParams); $oAttr->setLanguage(0); $oAttr->assign($aParams); $oAttr->setLanguage($this->_iEditLang); $oAttr = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->processFiles($oAttr); $oAttr->save(); // set oxid if inserted $this->setEditObjectId($oAttr->getId()); }
php
public function saveinnlang() { parent::save(); $sOxId = $this->getEditObjectId(); $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval"); $oAttr = oxNew(\OxidEsales\Eshop\Application\Model\Discount::class); if ($sOxId != "-1") { $oAttr->load($sOxId); } else { $aParams['oxdiscount__oxid'] = null; } // checkbox handling if (!isset($aParams['oxdiscount__oxactive'])) { $aParams['oxdiscount__oxactive'] = 0; } //disabling derived items if ($oAttr->isDerived()) { return; } //$aParams = $oAttr->ConvertNameArray2Idx( $aParams); $oAttr->setLanguage(0); $oAttr->assign($aParams); $oAttr->setLanguage($this->_iEditLang); $oAttr = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->processFiles($oAttr); $oAttr->save(); // set oxid if inserted $this->setEditObjectId($oAttr->getId()); }
[ "public", "function", "saveinnlang", "(", ")", "{", "parent", "::", "save", "(", ")", ";", "$", "sOxId", "=", "$", "this", "->", "getEditObjectId", "(", ")", ";", "$", "aParams", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", ...
Saves changed selected discount parameters in different language. @return null
[ "Saves", "changed", "selected", "discount", "parameters", "in", "different", "language", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DiscountMain.php#L166-L198
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderManufacturer.php
SeoEncoderManufacturer.getManufacturerPageUrl
public function getManufacturerPageUrl($manufacturer, $pageNumber, $languageId = null, $isFixed = null) { if (!isset($languageId)) { $languageId = $manufacturer->getLanguage(); } $stdUrl = $manufacturer->getBaseStdLink($languageId); $parameters = null; $stdUrl = $this->_trimUrl($stdUrl, $languageId); $seoUrl = $this->getManufacturerUri($manufacturer, $languageId); if ($isFixed === null) { $isFixed = $this->_isFixed('oxmanufacturer', $manufacturer->getId(), $languageId); } return $this->assembleFullPageUrl($manufacturer, 'oxmanufacturer', $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed); }
php
public function getManufacturerPageUrl($manufacturer, $pageNumber, $languageId = null, $isFixed = null) { if (!isset($languageId)) { $languageId = $manufacturer->getLanguage(); } $stdUrl = $manufacturer->getBaseStdLink($languageId); $parameters = null; $stdUrl = $this->_trimUrl($stdUrl, $languageId); $seoUrl = $this->getManufacturerUri($manufacturer, $languageId); if ($isFixed === null) { $isFixed = $this->_isFixed('oxmanufacturer', $manufacturer->getId(), $languageId); } return $this->assembleFullPageUrl($manufacturer, 'oxmanufacturer', $stdUrl, $seoUrl, $pageNumber, $parameters, $languageId, $isFixed); }
[ "public", "function", "getManufacturerPageUrl", "(", "$", "manufacturer", ",", "$", "pageNumber", ",", "$", "languageId", "=", "null", ",", "$", "isFixed", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "languageId", ")", ")", "{", "$", "lan...
Returns Manufacturer SEO url for specified page @param \OxidEsales\Eshop\Application\Model\Manufacturer $manufacturer Manufacturer object @param int $pageNumber Number of the page which should be prepared. @param int $languageId Language id. @param bool $isFixed Fixed url marker (default is null). @return string
[ "Returns", "Manufacturer", "SEO", "url", "for", "specified", "page" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderManufacturer.php#L85-L101
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderManufacturer.php
SeoEncoderManufacturer.getManufacturerUrl
public function getManufacturerUrl($oManufacturer, $iLang = null) { if (!isset($iLang)) { $iLang = $oManufacturer->getLanguage(); } return $this->_getFullUrl($this->getManufacturerUri($oManufacturer, $iLang), $iLang); }
php
public function getManufacturerUrl($oManufacturer, $iLang = null) { if (!isset($iLang)) { $iLang = $oManufacturer->getLanguage(); } return $this->_getFullUrl($this->getManufacturerUri($oManufacturer, $iLang), $iLang); }
[ "public", "function", "getManufacturerUrl", "(", "$", "oManufacturer", ",", "$", "iLang", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "iLang", ")", ")", "{", "$", "iLang", "=", "$", "oManufacturer", "->", "getLanguage", "(", ")", ";", "...
Encodes manufacturer category URLs into SEO format @param \OxidEsales\Eshop\Application\Model\Manufacturer $oManufacturer Manufacturer object @param int $iLang language @return string
[ "Encodes", "manufacturer", "category", "URLs", "into", "SEO", "format" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderManufacturer.php#L111-L118
train
OXID-eSales/oxideshop_ce
source/Application/Model/SeoEncoderManufacturer.php
SeoEncoderManufacturer.onDeleteManufacturer
public function onDeleteManufacturer($oManufacturer) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sIdQuoted = $oDb->quote($oManufacturer->getId()); $oDb->execute("delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxmanufacturer'"); $oDb->execute("delete from oxobject2seodata where oxobjectid = $sIdQuoted"); $oDb->execute("delete from oxseohistory where oxobjectid = $sIdQuoted"); }
php
public function onDeleteManufacturer($oManufacturer) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sIdQuoted = $oDb->quote($oManufacturer->getId()); $oDb->execute("delete from oxseo where oxobjectid = $sIdQuoted and oxtype = 'oxmanufacturer'"); $oDb->execute("delete from oxobject2seodata where oxobjectid = $sIdQuoted"); $oDb->execute("delete from oxseohistory where oxobjectid = $sIdQuoted"); }
[ "public", "function", "onDeleteManufacturer", "(", "$", "oManufacturer", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "sIdQuoted", "=", "$", "oDb", "->", "quote", ...
Deletes manufacturer seo entry @param \OxidEsales\Eshop\Application\Model\Manufacturer $oManufacturer Manufacturer object
[ "Deletes", "manufacturer", "seo", "entry" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SeoEncoderManufacturer.php#L125-L132
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/ArticleSelectionAjax.php
ArticleSelectionAjax.addSel
public function addSel() { $aAddSel = $this->_getActionIds('oxselectlist.oxid'); $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid'); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $sSLViewName = $this->_getViewName('oxselectlist'); $aAddSel = $this->_getAll($this->_addFilter("select $sSLViewName.oxid " . $this->_getQuery())); } if ($soxId && $soxId != "-1" && is_array($aAddSel)) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); foreach ($aAddSel as $sAdd) { $oNew = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $oNew->init("oxobject2selectlist"); $sObjectIdField = 'oxobject2selectlist__oxobjectid'; $sSelectetionIdField = 'oxobject2selectlist__oxselnid'; $sOxSortField = 'oxobject2selectlist__oxsort'; $oNew->$sObjectIdField = new \OxidEsales\Eshop\Core\Field($soxId); $oNew->$sSelectetionIdField = new \OxidEsales\Eshop\Core\Field($sAdd); $sSql = "select max(oxsort) + 1 from oxobject2selectlist where oxobjectid = {$database->quote($soxId)} "; $oNew->$sOxSortField = new \OxidEsales\Eshop\Core\Field(( int ) $database->getOne($sSql)); $oNew->save(); } $this->onArticleSelectionListChange($soxId); } }
php
public function addSel() { $aAddSel = $this->_getActionIds('oxselectlist.oxid'); $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid'); // adding if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) { $sSLViewName = $this->_getViewName('oxselectlist'); $aAddSel = $this->_getAll($this->_addFilter("select $sSLViewName.oxid " . $this->_getQuery())); } if ($soxId && $soxId != "-1" && is_array($aAddSel)) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(); foreach ($aAddSel as $sAdd) { $oNew = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $oNew->init("oxobject2selectlist"); $sObjectIdField = 'oxobject2selectlist__oxobjectid'; $sSelectetionIdField = 'oxobject2selectlist__oxselnid'; $sOxSortField = 'oxobject2selectlist__oxsort'; $oNew->$sObjectIdField = new \OxidEsales\Eshop\Core\Field($soxId); $oNew->$sSelectetionIdField = new \OxidEsales\Eshop\Core\Field($sAdd); $sSql = "select max(oxsort) + 1 from oxobject2selectlist where oxobjectid = {$database->quote($soxId)} "; $oNew->$sOxSortField = new \OxidEsales\Eshop\Core\Field(( int ) $database->getOne($sSql)); $oNew->save(); } $this->onArticleSelectionListChange($soxId); } }
[ "public", "function", "addSel", "(", ")", "{", "$", "aAddSel", "=", "$", "this", "->", "_getActionIds", "(", "'oxselectlist.oxid'", ")", ";", "$", "soxId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")...
Adds selection lists to article. @throws Exception
[ "Adds", "selection", "lists", "to", "article", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleSelectionAjax.php#L100-L132
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/Article.php
Article.import
public function import($data) { if (isset($data['OXID'])) { $this->checkIdField($data['OXID']); } return parent::import($data); }
php
public function import($data) { if (isset($data['OXID'])) { $this->checkIdField($data['OXID']); } return parent::import($data); }
[ "public", "function", "import", "(", "$", "data", ")", "{", "if", "(", "isset", "(", "$", "data", "[", "'OXID'", "]", ")", ")", "{", "$", "this", "->", "checkIdField", "(", "$", "data", "[", "'OXID'", "]", ")", ";", "}", "return", "parent", "::",...
Imports article. Returns import status. @param array $data DB row array. @return string $oxid Id on success, bool FALSE on failure.
[ "Imports", "article", ".", "Returns", "import", "status", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/Article.php#L27-L34
train
OXID-eSales/oxideshop_ce
source/Core/GenericImport/ImportObject/Article.php
Article.postSaveObject
protected function postSaveObject($shopObject, $data) { $articleId = $shopObject->getId(); $shopObject->onChange(null, $articleId, $articleId); return $articleId; }
php
protected function postSaveObject($shopObject, $data) { $articleId = $shopObject->getId(); $shopObject->onChange(null, $articleId, $articleId); return $articleId; }
[ "protected", "function", "postSaveObject", "(", "$", "shopObject", ",", "$", "data", ")", "{", "$", "articleId", "=", "$", "shopObject", "->", "getId", "(", ")", ";", "$", "shopObject", "->", "onChange", "(", "null", ",", "$", "articleId", ",", "$", "a...
Post saving hook. can finish transactions if needed or ajust related data. @param \OxidEsales\Eshop\Application\Model\Article $shopObject Shop object. @param array $data Data to save. @return mixed data to return
[ "Post", "saving", "hook", ".", "can", "finish", "transactions", "if", "needed", "or", "ajust", "related", "data", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/GenericImport/ImportObject/Article.php#L66-L72
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/OrderArticle.php
OrderArticle.getMainProduct
public function getMainProduct() { if ($this->_oMainSearchProduct === null && ($sArtNum = $this->getSearchProductArtNr())) { $this->_oMainSearchProduct = false; $sArtId = null; //get article id $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $sTable = getViewName("oxarticles"); $sQ = "select oxid, oxparentid from $sTable where oxartnum = " . $oDb->quote($sArtNum) . " limit 1"; $rs = $oDb->select($sQ); if ($rs != false && $rs->count() > 0) { $sArtId = $rs->fields['OXPARENTID'] ? $rs->fields['OXPARENTID'] : $rs->fields['OXID']; $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if ($oProduct->load($sArtId)) { $this->_oMainSearchProduct = $oProduct; } } } return $this->_oMainSearchProduct; }
php
public function getMainProduct() { if ($this->_oMainSearchProduct === null && ($sArtNum = $this->getSearchProductArtNr())) { $this->_oMainSearchProduct = false; $sArtId = null; //get article id $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $sTable = getViewName("oxarticles"); $sQ = "select oxid, oxparentid from $sTable where oxartnum = " . $oDb->quote($sArtNum) . " limit 1"; $rs = $oDb->select($sQ); if ($rs != false && $rs->count() > 0) { $sArtId = $rs->fields['OXPARENTID'] ? $rs->fields['OXPARENTID'] : $rs->fields['OXID']; $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if ($oProduct->load($sArtId)) { $this->_oMainSearchProduct = $oProduct; } } } return $this->_oMainSearchProduct; }
[ "public", "function", "getMainProduct", "(", ")", "{", "if", "(", "$", "this", "->", "_oMainSearchProduct", "===", "null", "&&", "(", "$", "sArtNum", "=", "$", "this", "->", "getSearchProductArtNr", "(", ")", ")", ")", "{", "$", "this", "->", "_oMainSear...
Returns product found by search. If product is variant - returns parent object @return object
[ "Returns", "product", "found", "by", "search", ".", "If", "product", "is", "variant", "-", "returns", "parent", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderArticle.php#L122-L145
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/OrderArticle.php
OrderArticle.getProductList
public function getProductList() { if ($this->_oSearchProductList === null) { $this->_oSearchProductList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); // main search product is found? if ($oMainSearchProduct = $this->getMainProduct()) { // storing self to first list position $this->_oSearchProductList->offsetSet($oMainSearchProduct->getId(), $oMainSearchProduct); // adding variants.. foreach ($oMainSearchProduct->getVariants() as $oVariant) { $this->_oSearchProductList->offsetSet($oVariant->getId(), $oVariant); } } } return $this->_oSearchProductList; }
php
public function getProductList() { if ($this->_oSearchProductList === null) { $this->_oSearchProductList = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class); // main search product is found? if ($oMainSearchProduct = $this->getMainProduct()) { // storing self to first list position $this->_oSearchProductList->offsetSet($oMainSearchProduct->getId(), $oMainSearchProduct); // adding variants.. foreach ($oMainSearchProduct->getVariants() as $oVariant) { $this->_oSearchProductList->offsetSet($oVariant->getId(), $oVariant); } } } return $this->_oSearchProductList; }
[ "public", "function", "getProductList", "(", ")", "{", "if", "(", "$", "this", "->", "_oSearchProductList", "===", "null", ")", "{", "$", "this", "->", "_oSearchProductList", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Model"...
Returns product list containing searchable product or its parent and its variants @return oxlist
[ "Returns", "product", "list", "containing", "searchable", "product", "or", "its", "parent", "and", "its", "variants" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderArticle.php#L152-L170
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/OrderArticle.php
OrderArticle.addThisArticle
public function addThisArticle() { $sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid'); $dAmount = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('am'); $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if ($sOxid && $dAmount && $oProduct->load($sOxid)) { $sOrderId = $this->getEditObjectId(); $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); if ($sOrderId && $oOrder->load($sOrderId)) { $oOrderArticle = oxNew(\OxidEsales\Eshop\Application\Model\OrderArticle::class); $oOrderArticle->oxorderarticles__oxartid = new \OxidEsales\Eshop\Core\Field($oProduct->getId()); $oOrderArticle->oxorderarticles__oxartnum = new \OxidEsales\Eshop\Core\Field($oProduct->oxarticles__oxartnum->value); $oOrderArticle->oxorderarticles__oxamount = new \OxidEsales\Eshop\Core\Field($dAmount); $oOrderArticle->oxorderarticles__oxselvariant = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sel')); $oOrder->recalculateOrder([$oOrderArticle]); } } }
php
public function addThisArticle() { $sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aid'); $dAmount = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('am'); $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); if ($sOxid && $dAmount && $oProduct->load($sOxid)) { $sOrderId = $this->getEditObjectId(); $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); if ($sOrderId && $oOrder->load($sOrderId)) { $oOrderArticle = oxNew(\OxidEsales\Eshop\Application\Model\OrderArticle::class); $oOrderArticle->oxorderarticles__oxartid = new \OxidEsales\Eshop\Core\Field($oProduct->getId()); $oOrderArticle->oxorderarticles__oxartnum = new \OxidEsales\Eshop\Core\Field($oProduct->oxarticles__oxartnum->value); $oOrderArticle->oxorderarticles__oxamount = new \OxidEsales\Eshop\Core\Field($dAmount); $oOrderArticle->oxorderarticles__oxselvariant = new \OxidEsales\Eshop\Core\Field(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sel')); $oOrder->recalculateOrder([$oOrderArticle]); } } }
[ "public", "function", "addThisArticle", "(", ")", "{", "$", "sOxid", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestParameter", "(", "'aid'", ")", ";", "$", "dAmount", "=", "\\", "Oxi...
Adds article to order list.
[ "Adds", "article", "to", "order", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderArticle.php#L175-L193
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/OrderArticle.php
OrderArticle.deleteThisArticle
public function deleteThisArticle() { // get article id $sOrderArtId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sArtID'); $sOrderId = $this->getEditObjectId(); $oOrderArticle = oxNew(\OxidEsales\Eshop\Application\Model\OrderArticle::class); $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); // order and order article exits? if ($oOrderArticle->load($sOrderArtId) && $oOrder->load($sOrderId)) { // deleting record $oOrderArticle->delete(); // recalculating order $oOrder->recalculateOrder(); } }
php
public function deleteThisArticle() { // get article id $sOrderArtId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sArtID'); $sOrderId = $this->getEditObjectId(); $oOrderArticle = oxNew(\OxidEsales\Eshop\Application\Model\OrderArticle::class); $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); // order and order article exits? if ($oOrderArticle->load($sOrderArtId) && $oOrder->load($sOrderId)) { // deleting record $oOrderArticle->delete(); // recalculating order $oOrder->recalculateOrder(); } }
[ "public", "function", "deleteThisArticle", "(", ")", "{", "// get article id", "$", "sOrderArtId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestParameter", "(", "'sArtID'", ")", ";", "$",...
Removes article from order list.
[ "Removes", "article", "from", "order", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderArticle.php#L198-L215
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/OrderArticle.php
OrderArticle.storno
public function storno() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $sOrderArtId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sArtID'); $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\OrderArticle::class); $oArticle->load($sOrderArtId); if ($oArticle->oxorderarticles__oxstorno->value == 1) { $oArticle->oxorderarticles__oxstorno->setValue(0); $sStockSign = -1; } else { $oArticle->oxorderarticles__oxstorno->setValue(1); $sStockSign = 1; } // stock information if ($myConfig->getConfigParam('blUseStock')) { $oArticle->updateArticleStock($oArticle->oxorderarticles__oxamount->value * $sStockSign, $myConfig->getConfigParam('blAllowNegativeStock')); } $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "update oxorderarticles set oxstorno = " . $oDb->quote($oArticle->oxorderarticles__oxstorno->value) . " where oxid = " . $oDb->quote($sOrderArtId); $oDb->execute($sQ); //get article id $sQ = "select oxartid from oxorderarticles where oxid = " . $oDb->quote($sOrderArtId); // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). if (($sArtId = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster()->getOne($sQ))) { $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); if ($oOrder->load($this->getEditObjectId())) { $oOrder->recalculateOrder(); } } }
php
public function storno() { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $sOrderArtId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sArtID'); $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\OrderArticle::class); $oArticle->load($sOrderArtId); if ($oArticle->oxorderarticles__oxstorno->value == 1) { $oArticle->oxorderarticles__oxstorno->setValue(0); $sStockSign = -1; } else { $oArticle->oxorderarticles__oxstorno->setValue(1); $sStockSign = 1; } // stock information if ($myConfig->getConfigParam('blUseStock')) { $oArticle->updateArticleStock($oArticle->oxorderarticles__oxamount->value * $sStockSign, $myConfig->getConfigParam('blAllowNegativeStock')); } $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sQ = "update oxorderarticles set oxstorno = " . $oDb->quote($oArticle->oxorderarticles__oxstorno->value) . " where oxid = " . $oDb->quote($sOrderArtId); $oDb->execute($sQ); //get article id $sQ = "select oxartid from oxorderarticles where oxid = " . $oDb->quote($sOrderArtId); // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). if (($sArtId = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster()->getOne($sQ))) { $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); if ($oOrder->load($this->getEditObjectId())) { $oOrder->recalculateOrder(); } } }
[ "public", "function", "storno", "(", ")", "{", "$", "myConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "sOrderArtId", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "R...
Cancels order item
[ "Cancels", "order", "item" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderArticle.php#L220-L254
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/OrderArticle.php
OrderArticle.updateOrder
public function updateOrder() { $aOrderArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aOrderArticles'); $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); if (is_array($aOrderArticles) && $oOrder->load($this->getEditObjectId())) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oOrderArticles = $oOrder->getOrderArticles(true); $blUseStock = $myConfig->getConfigParam('blUseStock'); foreach ($oOrderArticles as $oOrderArticle) { $sItemId = $oOrderArticle->getId(); if (isset($aOrderArticles[$sItemId])) { // update stock if ($blUseStock) { $oOrderArticle->setNewAmount($aOrderArticles[$sItemId]['oxamount']); } else { $oOrderArticle->assign($aOrderArticles[$sItemId]); $oOrderArticle->save(); } } } // recalculating order $oOrder->recalculateOrder(); } }
php
public function updateOrder() { $aOrderArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aOrderArticles'); $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class); if (is_array($aOrderArticles) && $oOrder->load($this->getEditObjectId())) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $oOrderArticles = $oOrder->getOrderArticles(true); $blUseStock = $myConfig->getConfigParam('blUseStock'); foreach ($oOrderArticles as $oOrderArticle) { $sItemId = $oOrderArticle->getId(); if (isset($aOrderArticles[$sItemId])) { // update stock if ($blUseStock) { $oOrderArticle->setNewAmount($aOrderArticles[$sItemId]['oxamount']); } else { $oOrderArticle->assign($aOrderArticles[$sItemId]); $oOrderArticle->save(); } } } // recalculating order $oOrder->recalculateOrder(); } }
[ "public", "function", "updateOrder", "(", ")", "{", "$", "aOrderArticles", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getRequestParameter", "(", "'aOrderArticles'", ")", ";", "$", "oOrder", "="...
Updates order articles stock and recalculates order
[ "Updates", "order", "articles", "stock", "and", "recalculates", "order" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/OrderArticle.php#L259-L285
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/PriceAlarmSend.php
PriceAlarmSend.countActivePriceAlerts
protected function countActivePriceAlerts() { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $shopId = $config->getShopId(); $activeAlarmsQuery = "SELECT oxprice, oxartid FROM oxpricealarm WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '$shopId'"; $result = $database->select($activeAlarmsQuery); $count = 0; while ($result != false && !$result->EOF) { $alarmPrice = $result->fields['oxprice']; $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $article->load($result->fields['oxartid']); if ($article->getPrice()->getBruttoPrice() <= $alarmPrice) { $count++; } $result->fetchRow(); } return $count; }
php
protected function countActivePriceAlerts() { $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $shopId = $config->getShopId(); $activeAlarmsQuery = "SELECT oxprice, oxartid FROM oxpricealarm WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '$shopId'"; $result = $database->select($activeAlarmsQuery); $count = 0; while ($result != false && !$result->EOF) { $alarmPrice = $result->fields['oxprice']; $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $article->load($result->fields['oxartid']); if ($article->getPrice()->getBruttoPrice() <= $alarmPrice) { $count++; } $result->fetchRow(); } return $count; }
[ "protected", "function", "countActivePriceAlerts", "(", ")", "{", "$", "database", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", ":...
Counts active price alerts and returns this number. @return int
[ "Counts", "active", "price", "alerts", "and", "returns", "this", "number", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/PriceAlarmSend.php#L81-L103
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/PriceAlarmSend.php
PriceAlarmSend.sendPriceChangeNotifications
protected function sendPriceChangeNotifications($start, $limit) { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $shopId = $config->getShopId(); $alarmsQuery = "SELECT oxid, oxemail, oxartid, oxprice FROM oxpricealarm WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '$shopId'"; $result = $database->selectLimit($alarmsQuery, $limit, $start); while ($result != false && !$result->EOF) { $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $article->load($result->fields['oxartid']); if ($article->getPrice()->getBruttoPrice() <= $result->fields['oxprice']) { $this->sendeMail( $result->fields['oxemail'], $result->fields['oxartid'], $result->fields['oxid'], $result->fields['oxprice'] ); } $result->fetchRow(); } }
php
protected function sendPriceChangeNotifications($start, $limit) { $config = \OxidEsales\Eshop\Core\Registry::getConfig(); $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $shopId = $config->getShopId(); $alarmsQuery = "SELECT oxid, oxemail, oxartid, oxprice FROM oxpricealarm WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '$shopId'"; $result = $database->selectLimit($alarmsQuery, $limit, $start); while ($result != false && !$result->EOF) { $article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class); $article->load($result->fields['oxartid']); if ($article->getPrice()->getBruttoPrice() <= $result->fields['oxprice']) { $this->sendeMail( $result->fields['oxemail'], $result->fields['oxartid'], $result->fields['oxid'], $result->fields['oxprice'] ); } $result->fetchRow(); } }
[ "protected", "function", "sendPriceChangeNotifications", "(", "$", "start", ",", "$", "limit", ")", "{", "$", "config", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "$", "database", "=", "\\", ...
Sends price alert notifications about changed article prices. @param int $start How much price alerts was already sent. @param int $limit How much price alerts to send.
[ "Sends", "price", "alert", "notifications", "about", "changed", "article", "prices", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/PriceAlarmSend.php#L111-L134
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/PriceAlarmSend.php
PriceAlarmSend.sendeMail
public function sendeMail($emailAddress, $productID, $priceAlarmId, $bidPrice) { $alarm = oxNew(\OxidEsales\Eshop\Application\Model\PriceAlarm::class); $alarm->load($priceAlarmId); $language = \OxidEsales\Eshop\Core\Registry::getLang(); $languageId = (int) $alarm->oxpricealarm__oxlang->value; $oldLanguageId = $language->getTplLanguage(); $language->setTplLanguage($languageId); $email = oxNew(\OxidEsales\Eshop\Core\Email::class); $success = (int) $email->sendPricealarmToCustomer($emailAddress, $alarm); $language->setTplLanguage($oldLanguageId); if ($success) { $alarm->oxpricealarm__oxsended = new \OxidEsales\Eshop\Core\Field(date("Y-m-d H:i:s")); $alarm->save(); } }
php
public function sendeMail($emailAddress, $productID, $priceAlarmId, $bidPrice) { $alarm = oxNew(\OxidEsales\Eshop\Application\Model\PriceAlarm::class); $alarm->load($priceAlarmId); $language = \OxidEsales\Eshop\Core\Registry::getLang(); $languageId = (int) $alarm->oxpricealarm__oxlang->value; $oldLanguageId = $language->getTplLanguage(); $language->setTplLanguage($languageId); $email = oxNew(\OxidEsales\Eshop\Core\Email::class); $success = (int) $email->sendPricealarmToCustomer($emailAddress, $alarm); $language->setTplLanguage($oldLanguageId); if ($success) { $alarm->oxpricealarm__oxsended = new \OxidEsales\Eshop\Core\Field(date("Y-m-d H:i:s")); $alarm->save(); } }
[ "public", "function", "sendeMail", "(", "$", "emailAddress", ",", "$", "productID", ",", "$", "priceAlarmId", ",", "$", "bidPrice", ")", "{", "$", "alarm", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "P...
Creates and sends email with price alarm information. @param string $emailAddress Email address @param string $productID Product id @param string $priceAlarmId Price alarm id @param string $bidPrice Bid price
[ "Creates", "and", "sends", "email", "with", "price", "alarm", "information", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/PriceAlarmSend.php#L144-L164
train
OXID-eSales/oxideshop_ce
source/Application/Model/SelectList.php
SelectList.getFieldList
public function getFieldList($dVat = null) { if ($this->_aFieldList == null && $this->oxselectlist__oxvaldesc->value) { $this->_aFieldList = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($this->oxselectlist__oxvaldesc->value, $dVat); foreach ($this->_aFieldList as $sKey => $oField) { $this->_aFieldList[$sKey]->name = getStr()->strip_tags($this->_aFieldList[$sKey]->name); } } return $this->_aFieldList; }
php
public function getFieldList($dVat = null) { if ($this->_aFieldList == null && $this->oxselectlist__oxvaldesc->value) { $this->_aFieldList = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($this->oxselectlist__oxvaldesc->value, $dVat); foreach ($this->_aFieldList as $sKey => $oField) { $this->_aFieldList[$sKey]->name = getStr()->strip_tags($this->_aFieldList[$sKey]->name); } } return $this->_aFieldList; }
[ "public", "function", "getFieldList", "(", "$", "dVat", "=", "null", ")", "{", "if", "(", "$", "this", "->", "_aFieldList", "==", "null", "&&", "$", "this", "->", "oxselectlist__oxvaldesc", "->", "value", ")", "{", "$", "this", "->", "_aFieldList", "=", ...
Returns select list value list. @param double $dVat VAT value @return array
[ "Returns", "select", "list", "value", "list", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SelectList.php#L69-L79
train
OXID-eSales/oxideshop_ce
source/Application/Model/SelectList.php
SelectList.getSelections
public function getSelections() { if ($this->_aList === null && $this->oxselectlist__oxvaldesc->value) { $this->_aList = false; $aList = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($this->oxselectlist__oxvaldesc->getRawValue(), $this->getVat()); foreach ($aList as $sKey => $oField) { if ($oField->name) { $this->_aList[$sKey] = oxNew(\OxidEsales\Eshop\Application\Model\Selection::class, getStr()->strip_tags($oField->name), $sKey, false, $this->_aList === false ? true : false); } } } return $this->_aList; }
php
public function getSelections() { if ($this->_aList === null && $this->oxselectlist__oxvaldesc->value) { $this->_aList = false; $aList = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($this->oxselectlist__oxvaldesc->getRawValue(), $this->getVat()); foreach ($aList as $sKey => $oField) { if ($oField->name) { $this->_aList[$sKey] = oxNew(\OxidEsales\Eshop\Application\Model\Selection::class, getStr()->strip_tags($oField->name), $sKey, false, $this->_aList === false ? true : false); } } } return $this->_aList; }
[ "public", "function", "getSelections", "(", ")", "{", "if", "(", "$", "this", "->", "_aList", "===", "null", "&&", "$", "this", "->", "oxselectlist__oxvaldesc", "->", "value", ")", "{", "$", "this", "->", "_aList", "=", "false", ";", "$", "aList", "=",...
Returns array of oxSelection's @return array
[ "Returns", "array", "of", "oxSelection", "s" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SelectList.php#L141-L154
train
OXID-eSales/oxideshop_ce
source/Application/Model/SelectList.php
SelectList.getActiveSelection
public function getActiveSelection() { if ($this->_oActiveSelection === null) { if (($aSelections = $this->getSelections())) { // first is allways active $this->_oActiveSelection = reset($aSelections); } } return $this->_oActiveSelection; }
php
public function getActiveSelection() { if ($this->_oActiveSelection === null) { if (($aSelections = $this->getSelections())) { // first is allways active $this->_oActiveSelection = reset($aSelections); } } return $this->_oActiveSelection; }
[ "public", "function", "getActiveSelection", "(", ")", "{", "if", "(", "$", "this", "->", "_oActiveSelection", "===", "null", ")", "{", "if", "(", "(", "$", "aSelections", "=", "$", "this", "->", "getSelections", "(", ")", ")", ")", "{", "// first is allw...
Returns active selection object @return oxSelection
[ "Returns", "active", "selection", "object" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SelectList.php#L161-L171
train
OXID-eSales/oxideshop_ce
source/Application/Model/SelectList.php
SelectList.setActiveSelectionByIndex
public function setActiveSelectionByIndex($iIdx) { if (($aSelections = $this->getSelections())) { $iSelIdx = 0; foreach ($aSelections as $oSelection) { $oSelection->setActiveState($iSelIdx == $iIdx); if ($iSelIdx == $iIdx) { $this->_oActiveSelection = $oSelection; } $iSelIdx++; } } }
php
public function setActiveSelectionByIndex($iIdx) { if (($aSelections = $this->getSelections())) { $iSelIdx = 0; foreach ($aSelections as $oSelection) { $oSelection->setActiveState($iSelIdx == $iIdx); if ($iSelIdx == $iIdx) { $this->_oActiveSelection = $oSelection; } $iSelIdx++; } } }
[ "public", "function", "setActiveSelectionByIndex", "(", "$", "iIdx", ")", "{", "if", "(", "(", "$", "aSelections", "=", "$", "this", "->", "getSelections", "(", ")", ")", ")", "{", "$", "iSelIdx", "=", "0", ";", "foreach", "(", "$", "aSelections", "as"...
Activates given by index selection @param int $iIdx selection index
[ "Activates", "given", "by", "index", "selection" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/SelectList.php#L178-L190
train
OXID-eSales/oxideshop_ce
source/Core/Price.php
Price.getBruttoPrice
public function getBruttoPrice() { if ($this->isNettoMode()) { return $this->getNettoPrice() + $this->getVatValue(); } else { return \OxidEsales\Eshop\Core\Registry::getUtils()->fRound($this->_dBrutto); } }
php
public function getBruttoPrice() { if ($this->isNettoMode()) { return $this->getNettoPrice() + $this->getVatValue(); } else { return \OxidEsales\Eshop\Core\Registry::getUtils()->fRound($this->_dBrutto); } }
[ "public", "function", "getBruttoPrice", "(", ")", "{", "if", "(", "$", "this", "->", "isNettoMode", "(", ")", ")", "{", "return", "$", "this", "->", "getNettoPrice", "(", ")", "+", "$", "this", "->", "getVatValue", "(", ")", ";", "}", "else", "{", ...
Returns brutto price @return double
[ "Returns", "brutto", "price" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Price.php#L183-L190
train
OXID-eSales/oxideshop_ce
source/Core/Price.php
Price.getVatValue
public function getVatValue() { if ($this->isNettoMode()) { $dVatValue = $this->getNettoPrice() * $this->getVat() / 100; } else { $dVatValue = $this->getBruttoPrice() * $this->getVat() / (100 + $this->getVat()); } return \OxidEsales\Eshop\Core\Registry::getUtils()->fRound($dVatValue); }
php
public function getVatValue() { if ($this->isNettoMode()) { $dVatValue = $this->getNettoPrice() * $this->getVat() / 100; } else { $dVatValue = $this->getBruttoPrice() * $this->getVat() / (100 + $this->getVat()); } return \OxidEsales\Eshop\Core\Registry::getUtils()->fRound($dVatValue); }
[ "public", "function", "getVatValue", "(", ")", "{", "if", "(", "$", "this", "->", "isNettoMode", "(", ")", ")", "{", "$", "dVatValue", "=", "$", "this", "->", "getNettoPrice", "(", ")", "*", "$", "this", "->", "getVat", "(", ")", "/", "100", ";", ...
Returns absolute VAT value @return double
[ "Returns", "absolute", "VAT", "value" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Price.php#L211-L220
train
OXID-eSales/oxideshop_ce
source/Core/Price.php
Price.subtractPercent
public function subtractPercent($dValue) { $dPrice = $this->getPrice(); $this->setPrice($dPrice - self::percent($dPrice, $dValue)); }
php
public function subtractPercent($dValue) { $dPrice = $this->getPrice(); $this->setPrice($dPrice - self::percent($dPrice, $dValue)); }
[ "public", "function", "subtractPercent", "(", "$", "dValue", ")", "{", "$", "dPrice", "=", "$", "this", "->", "getPrice", "(", ")", ";", "$", "this", "->", "setPrice", "(", "$", "dPrice", "-", "self", "::", "percent", "(", "$", "dPrice", ",", "$", ...
Subtracts given percent from price depending on price entering mode, and recalculates price @param double $dValue percent to subtract from price
[ "Subtracts", "given", "percent", "from", "price", "depending", "on", "price", "entering", "mode", "and", "recalculates", "price" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Price.php#L228-L232
train
OXID-eSales/oxideshop_ce
source/Core/Price.php
Price.addPrice
public function addPrice(\OxidEsales\Eshop\Core\Price $oPrice) { if ($this->isNettoMode()) { $this->add($oPrice->getNettoPrice()); } else { $this->add($oPrice->getBruttoPrice()); } }
php
public function addPrice(\OxidEsales\Eshop\Core\Price $oPrice) { if ($this->isNettoMode()) { $this->add($oPrice->getNettoPrice()); } else { $this->add($oPrice->getBruttoPrice()); } }
[ "public", "function", "addPrice", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Price", "$", "oPrice", ")", "{", "if", "(", "$", "this", "->", "isNettoMode", "(", ")", ")", "{", "$", "this", "->", "add", "(", "$", "oPrice", "->", "ge...
Adds another oxPrice object and recalculates current method. @param \OxidEsales\Eshop\Core\Price $oPrice object
[ "Adds", "another", "oxPrice", "object", "and", "recalculates", "current", "method", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Price.php#L250-L257
train
OXID-eSales/oxideshop_ce
source/Core/Price.php
Price.getPriceInActCurrency
public static function getPriceInActCurrency($dPrice) { $oCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject(); return (( double ) $dPrice) * $oCur->rate; }
php
public static function getPriceInActCurrency($dPrice) { $oCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject(); return (( double ) $dPrice) * $oCur->rate; }
[ "public", "static", "function", "getPriceInActCurrency", "(", "$", "dPrice", ")", "{", "$", "oCur", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getActShopCurrencyObject", "(", ")", ";", "return"...
Returns price multiplied by current currency @param string $dPrice price value @return double
[ "Returns", "price", "multiplied", "by", "current", "currency" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Price.php#L391-L396
train
OXID-eSales/oxideshop_ce
source/Application/Controller/Admin/DiscountArticlesAjax.php
DiscountArticlesAjax.addArticleToDiscount
protected function addArticleToDiscount($discountListId, $articleId) { $object2Discount = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $object2Discount->init('oxobject2discount'); $object2Discount->oxobject2discount__oxdiscountid = new \OxidEsales\Eshop\Core\Field($discountListId); $object2Discount->oxobject2discount__oxobjectid = new \OxidEsales\Eshop\Core\Field($articleId); $object2Discount->oxobject2discount__oxtype = new \OxidEsales\Eshop\Core\Field("oxarticles"); $object2Discount->save(); }
php
protected function addArticleToDiscount($discountListId, $articleId) { $object2Discount = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $object2Discount->init('oxobject2discount'); $object2Discount->oxobject2discount__oxdiscountid = new \OxidEsales\Eshop\Core\Field($discountListId); $object2Discount->oxobject2discount__oxobjectid = new \OxidEsales\Eshop\Core\Field($articleId); $object2Discount->oxobject2discount__oxtype = new \OxidEsales\Eshop\Core\Field("oxarticles"); $object2Discount->save(); }
[ "protected", "function", "addArticleToDiscount", "(", "$", "discountListId", ",", "$", "articleId", ")", "{", "$", "object2Discount", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Model", "\\", "BaseModel", "::", "class", ")", ";...
Adds article to discount list @param string $discountListId @param string $articleId
[ "Adds", "article", "to", "discount", "list" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DiscountArticlesAjax.php#L148-L157
train
OXID-eSales/oxideshop_ce
source/Application/Model/Attribute.php
Attribute.delete
public function delete($sOXID = null) { if (!$sOXID) { $sOXID = $this->getId(); } if (!$this->canDeleteAttribute($sOXID)) { return false; } // remove attributes from articles also $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sOxidQuoted = $oDb->quote($sOXID); $sDelete = "delete from oxobject2attribute where oxattrid = " . $sOxidQuoted; $oDb->execute($sDelete); // #657 ADDITIONAL removes attribute connection to category $sDelete = "delete from oxcategory2attribute where oxattrid = " . $sOxidQuoted; $oDb->execute($sDelete); return parent::delete($sOXID); }
php
public function delete($sOXID = null) { if (!$sOXID) { $sOXID = $this->getId(); } if (!$this->canDeleteAttribute($sOXID)) { return false; } // remove attributes from articles also $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sOxidQuoted = $oDb->quote($sOXID); $sDelete = "delete from oxobject2attribute where oxattrid = " . $sOxidQuoted; $oDb->execute($sDelete); // #657 ADDITIONAL removes attribute connection to category $sDelete = "delete from oxcategory2attribute where oxattrid = " . $sOxidQuoted; $oDb->execute($sDelete); return parent::delete($sOXID); }
[ "public", "function", "delete", "(", "$", "sOXID", "=", "null", ")", "{", "if", "(", "!", "$", "sOXID", ")", "{", "$", "sOXID", "=", "$", "this", "->", "getId", "(", ")", ";", "}", "if", "(", "!", "$", "this", "->", "canDeleteAttribute", "(", "...
Removes attributes from articles, returns true on success. @param string $sOXID Object ID @return bool
[ "Removes", "attributes", "from", "articles", "returns", "true", "on", "success", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Attribute.php#L64-L85
train
OXID-eSales/oxideshop_ce
source/Application/Model/Attribute.php
Attribute.assignVarToAttribute
public function assignVarToAttribute($aMDVariants, $aSelTitle) { $myLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aConfLanguages = $myLang->getLanguageIds(); $sAttrId = $this->_getAttrId($aSelTitle[0]); if (!$sAttrId) { $sAttrId = $this->_createAttribute($aSelTitle); } foreach ($aMDVariants as $sVarId => $oValue) { if (strpos($sVarId, "mdvar_") === 0) { foreach ($oValue as $sId) { $sVarId = substr($sVarId, 6); $oNewAssign = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $oNewAssign->init("oxobject2attribute"); $sNewId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID(); if ($oNewAssign->load($sId)) { $oNewAssign->oxobject2attribute__oxobjectid = new \OxidEsales\Eshop\Core\Field($sVarId); $oNewAssign->setId($sNewId); $oNewAssign->save(); } } } else { $oNewAssign = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class); $oNewAssign->setEnableMultilang(false); $oNewAssign->init("oxobject2attribute"); $oNewAssign->oxobject2attribute__oxobjectid = new \OxidEsales\Eshop\Core\Field($sVarId); $oNewAssign->oxobject2attribute__oxattrid = new \OxidEsales\Eshop\Core\Field($sAttrId); foreach ($aConfLanguages as $sKey => $sLang) { $sPrefix = $myLang->getLanguageTag($sKey); $oNewAssign->{'oxobject2attribute__oxvalue' . $sPrefix} = new \OxidEsales\Eshop\Core\Field($oValue[$sKey]->name); } $oNewAssign->save(); } } }
php
public function assignVarToAttribute($aMDVariants, $aSelTitle) { $myLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aConfLanguages = $myLang->getLanguageIds(); $sAttrId = $this->_getAttrId($aSelTitle[0]); if (!$sAttrId) { $sAttrId = $this->_createAttribute($aSelTitle); } foreach ($aMDVariants as $sVarId => $oValue) { if (strpos($sVarId, "mdvar_") === 0) { foreach ($oValue as $sId) { $sVarId = substr($sVarId, 6); $oNewAssign = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class); $oNewAssign->init("oxobject2attribute"); $sNewId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID(); if ($oNewAssign->load($sId)) { $oNewAssign->oxobject2attribute__oxobjectid = new \OxidEsales\Eshop\Core\Field($sVarId); $oNewAssign->setId($sNewId); $oNewAssign->save(); } } } else { $oNewAssign = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class); $oNewAssign->setEnableMultilang(false); $oNewAssign->init("oxobject2attribute"); $oNewAssign->oxobject2attribute__oxobjectid = new \OxidEsales\Eshop\Core\Field($sVarId); $oNewAssign->oxobject2attribute__oxattrid = new \OxidEsales\Eshop\Core\Field($sAttrId); foreach ($aConfLanguages as $sKey => $sLang) { $sPrefix = $myLang->getLanguageTag($sKey); $oNewAssign->{'oxobject2attribute__oxvalue' . $sPrefix} = new \OxidEsales\Eshop\Core\Field($oValue[$sKey]->name); } $oNewAssign->save(); } } }
[ "public", "function", "assignVarToAttribute", "(", "$", "aMDVariants", ",", "$", "aSelTitle", ")", "{", "$", "myLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", ";", "$", "aConfLanguages", "=", "$", ...
Assigns attribute to variant @param array $aMDVariants article ids with selectionlist values @param array $aSelTitle selection list titles
[ "Assigns", "attribute", "to", "variant" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Attribute.php#L93-L127
train
OXID-eSales/oxideshop_ce
source/Application/Model/Attribute.php
Attribute._getAttrId
protected function _getAttrId($sSelTitle) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDB(); $sAttViewName = getViewName('oxattribute'); return $oDb->getOne("select oxid from $sAttViewName where LOWER(oxtitle) = " . $oDb->quote(getStr()->strtolower($sSelTitle))); }
php
protected function _getAttrId($sSelTitle) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDB(); $sAttViewName = getViewName('oxattribute'); return $oDb->getOne("select oxid from $sAttViewName where LOWER(oxtitle) = " . $oDb->quote(getStr()->strtolower($sSelTitle))); }
[ "protected", "function", "_getAttrId", "(", "$", "sSelTitle", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDB", "(", ")", ";", "$", "sAttViewName", "=", "getViewName", "(", "'oxattribute'", ...
Searches for attribute by oxtitle. If exists returns attribute id @param string $sSelTitle selection list title @return mixed attribute id or false
[ "Searches", "for", "attribute", "by", "oxtitle", ".", "If", "exists", "returns", "attribute", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Attribute.php#L136-L142
train
OXID-eSales/oxideshop_ce
source/Application/Model/Attribute.php
Attribute._createAttribute
protected function _createAttribute($aSelTitle) { $myLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aConfLanguages = $myLang->getLanguageIds(); $oAttr = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class); $oAttr->setEnableMultilang(false); $oAttr->init('oxattribute'); foreach ($aConfLanguages as $sKey => $sLang) { $sPrefix = $myLang->getLanguageTag($sKey); $oAttr->{'oxattribute__oxtitle' . $sPrefix} = new \OxidEsales\Eshop\Core\Field($aSelTitle[$sKey]); } $oAttr->save(); return $oAttr->getId(); }
php
protected function _createAttribute($aSelTitle) { $myLang = \OxidEsales\Eshop\Core\Registry::getLang(); $aConfLanguages = $myLang->getLanguageIds(); $oAttr = oxNew(\OxidEsales\Eshop\Core\Model\MultiLanguageModel::class); $oAttr->setEnableMultilang(false); $oAttr->init('oxattribute'); foreach ($aConfLanguages as $sKey => $sLang) { $sPrefix = $myLang->getLanguageTag($sKey); $oAttr->{'oxattribute__oxtitle' . $sPrefix} = new \OxidEsales\Eshop\Core\Field($aSelTitle[$sKey]); } $oAttr->save(); return $oAttr->getId(); }
[ "protected", "function", "_createAttribute", "(", "$", "aSelTitle", ")", "{", "$", "myLang", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", ";", "$", "aConfLanguages", "=", "$", "myLang", "->", "getLangua...
Checks if attribute exists @param array $aSelTitle selection list title @return string attribute id
[ "Checks", "if", "attribute", "exists" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Attribute.php#L151-L165
train
OXID-eSales/oxideshop_ce
source/Application/Model/Attribute.php
Attribute.getAttributeAssigns
public function getAttributeAssigns($sArtId) { if ($sArtId) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sSelect = "select o2a.oxid from oxobject2attribute as o2a "; $sSelect .= "where o2a.oxobjectid = " . $oDb->quote($sArtId) . " order by o2a.oxpos"; $aIds = []; $rs = $oDb->select($sSelect); if ($rs != false && $rs->count() > 0) { while (!$rs->EOF) { $aIds[] = $rs->fields[0]; $rs->fetchRow(); } } return $aIds; } }
php
public function getAttributeAssigns($sArtId) { if ($sArtId) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sSelect = "select o2a.oxid from oxobject2attribute as o2a "; $sSelect .= "where o2a.oxobjectid = " . $oDb->quote($sArtId) . " order by o2a.oxpos"; $aIds = []; $rs = $oDb->select($sSelect); if ($rs != false && $rs->count() > 0) { while (!$rs->EOF) { $aIds[] = $rs->fields[0]; $rs->fetchRow(); } } return $aIds; } }
[ "public", "function", "getAttributeAssigns", "(", "$", "sArtId", ")", "{", "if", "(", "$", "sArtId", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "sSelect", "="...
Returns all oxobject2attribute Ids of article @param string $sArtId article ids @return null;
[ "Returns", "all", "oxobject2attribute", "Ids", "of", "article" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Attribute.php#L174-L193
train
OXID-eSales/oxideshop_ce
source/Application/Controller/AccountNewsletterController.php
AccountNewsletterController.subscribe
public function subscribe() { if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) { return false; } // is logged in ? $oUser = $this->getUser(); if (!$oUser) { return false; } $iStatus = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('status'); if ($oUser->setNewsSubscription($iStatus, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOrderOptInEmail'))) { $this->_iSubscriptionStatus = ($iStatus == 0 && $iStatus !== null) ? -1 : 1; } }
php
public function subscribe() { if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) { return false; } // is logged in ? $oUser = $this->getUser(); if (!$oUser) { return false; } $iStatus = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('status'); if ($oUser->setNewsSubscription($iStatus, \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOrderOptInEmail'))) { $this->_iSubscriptionStatus = ($iStatus == 0 && $iStatus !== null) ? -1 : 1; } }
[ "public", "function", "subscribe", "(", ")", "{", "if", "(", "!", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getSession", "(", ")", "->", "checkSessionChallenge", "(", ")", ")", "{", "return", "false", ";", "}", "// is logg...
Removes or adds user to newsletter group according to current subscription status. Returns true on success. @return bool
[ "Removes", "or", "adds", "user", "to", "newsletter", "group", "according", "to", "current", "subscription", "status", ".", "Returns", "true", "on", "success", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/AccountNewsletterController.php#L83-L99
train
OXID-eSales/oxideshop_ce
source/Core/AdminLogSqlDecorator.php
AdminLogSqlDecorator.getUserId
protected function getUserId() { $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($user->loadAdminUser()) { return $user->getId(); } }
php
protected function getUserId() { $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class); if ($user->loadAdminUser()) { return $user->getId(); } }
[ "protected", "function", "getUserId", "(", ")", "{", "$", "user", "=", "oxNew", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Application", "\\", "Model", "\\", "User", "::", "class", ")", ";", "if", "(", "$", "user", "->", "loadAdminUser", "(", ")", ...
Get currently logged in admin user id @return string
[ "Get", "currently", "logged", "in", "admin", "user", "id" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/AdminLogSqlDecorator.php#L34-L40
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.getAddUrlParams
public function getAddUrlParams() { if ($this->_aAddUrlParams === null) { $this->_aAddUrlParams = $this->getBaseAddUrlParams(); // appending currency if (($iCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopCurrency())) { $this->_aAddUrlParams['cur'] = $iCur; } } return $this->_aAddUrlParams; }
php
public function getAddUrlParams() { if ($this->_aAddUrlParams === null) { $this->_aAddUrlParams = $this->getBaseAddUrlParams(); // appending currency if (($iCur = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopCurrency())) { $this->_aAddUrlParams['cur'] = $iCur; } } return $this->_aAddUrlParams; }
[ "public", "function", "getAddUrlParams", "(", ")", "{", "if", "(", "$", "this", "->", "_aAddUrlParams", "===", "null", ")", "{", "$", "this", "->", "_aAddUrlParams", "=", "$", "this", "->", "getBaseAddUrlParams", "(", ")", ";", "// appending currency", "if",...
Returns parameters which should be appended to seo or std url. @return array
[ "Returns", "parameters", "which", "should", "be", "appended", "to", "seo", "or", "std", "url", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L45-L57
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.prepareUrlForNoSession
public function prepareUrlForNoSession($sUrl) { /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */ $oStr = getStr(); // cleaning up session id.. $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)(force_)?(admin_)?sid=[a-z0-9\._]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(&amp;|\?)$/', '', $sUrl); if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) { return $sUrl; } if ($qpos = $oStr->strpos($sUrl, '?')) { if ($qpos == $oStr->strlen($sUrl) - 1) { $sSep = ''; } else { $sSep = '&amp;'; } } else { $sSep = '?'; } if (!$oStr->preg_match('/[&?](amp;)?lang=[0-9]+/i', $sUrl)) { $sUrl .= "{$sSep}lang=" . \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); $sSep = '&amp;'; } $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if (!$oStr->preg_match('/[&?](amp;)?cur=[0-9]+/i', $sUrl)) { $iCur = (int) $oConfig->getShopCurrency(); if ($iCur) { $sUrl .= "{$sSep}cur=" . $iCur; } } return $sUrl; }
php
public function prepareUrlForNoSession($sUrl) { /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */ $oStr = getStr(); // cleaning up session id.. $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)(force_)?(admin_)?sid=[a-z0-9\._]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(&amp;|\?)$/', '', $sUrl); if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) { return $sUrl; } if ($qpos = $oStr->strpos($sUrl, '?')) { if ($qpos == $oStr->strlen($sUrl) - 1) { $sSep = ''; } else { $sSep = '&amp;'; } } else { $sSep = '?'; } if (!$oStr->preg_match('/[&?](amp;)?lang=[0-9]+/i', $sUrl)) { $sUrl .= "{$sSep}lang=" . \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); $sSep = '&amp;'; } $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); if (!$oStr->preg_match('/[&?](amp;)?cur=[0-9]+/i', $sUrl)) { $iCur = (int) $oConfig->getShopCurrency(); if ($iCur) { $sUrl .= "{$sSep}cur=" . $iCur; } } return $sUrl; }
[ "public", "function", "prepareUrlForNoSession", "(", "$", "sUrl", ")", "{", "/** @var \\OxidEsales\\Eshop\\Core\\StrRegular $oStr */", "$", "oStr", "=", "getStr", "(", ")", ";", "// cleaning up session id..", "$", "sUrl", "=", "$", "oStr", "->", "preg_replace", "(", ...
prepareUrlForNoSession adds extra url params making it usable without session also removes sid=xxxx&. @param string $sUrl given url @access public @return string
[ "prepareUrlForNoSession", "adds", "extra", "url", "params", "making", "it", "usable", "without", "session", "also", "removes", "sid", "=", "xxxx&", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L68-L105
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.prepareCanonicalUrl
public function prepareCanonicalUrl($sUrl) { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */ $oStr = getStr(); // cleaning up session id.. $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)(force_)?(admin_)?sid=[a-z0-9\._]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(&amp;|\?)$/', '', $sUrl); $sSep = ($oStr->strpos($sUrl, '?') === false) ? '?' : '&amp;'; if (!\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) { // non seo url has no language identifier.. $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); if (!$oStr->preg_match('/[&?](amp;)?lang=[0-9]+/i', $sUrl) && $iLang != $oConfig->getConfigParam('sDefaultLang') ) { $sUrl .= "{$sSep}lang=" . $iLang; } } return $sUrl; }
php
public function prepareCanonicalUrl($sUrl) { $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */ $oStr = getStr(); // cleaning up session id.. $sUrl = $oStr->preg_replace('/(\?|&(amp;)?)(force_)?(admin_)?sid=[a-z0-9\._]+&?(amp;)?/i', '\1', $sUrl); $sUrl = $oStr->preg_replace('/(&amp;|\?)$/', '', $sUrl); $sSep = ($oStr->strpos($sUrl, '?') === false) ? '?' : '&amp;'; if (!\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) { // non seo url has no language identifier.. $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage(); if (!$oStr->preg_match('/[&?](amp;)?lang=[0-9]+/i', $sUrl) && $iLang != $oConfig->getConfigParam('sDefaultLang') ) { $sUrl .= "{$sSep}lang=" . $iLang; } } return $sUrl; }
[ "public", "function", "prepareCanonicalUrl", "(", "$", "sUrl", ")", "{", "$", "oConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", ";", "/** @var \\OxidEsales\\Eshop\\Core\\StrRegular $oStr */", "$", "oStr...
Prepares canonical url. @param string $sUrl given url @access public @return string
[ "Prepares", "canonical", "url", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L115-L137
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.appendUrl
public function appendUrl($sUrl, $parametersToAdd, $blFinalUrl = false, $allowParameterOverwrite = false) { $paramSeparator = self::PARAMETER_SEPARATOR; $finalParameters = $this->removeNotSetParameters($parametersToAdd); if (is_array($finalParameters) && !empty($finalParameters)) { $urlWithoutQuery = $sUrl; $separatorPlace = strpos($sUrl, '?'); if ($separatorPlace !== false) { $urlWithoutQuery = substr($sUrl, 0, $separatorPlace); $urlQueryEscaped = substr($sUrl, $separatorPlace + 1); $urlQuery = str_replace($paramSeparator, '&', $urlQueryEscaped); $finalParameters = $this->mergeDuplicatedParameters($finalParameters, $urlQuery, $allowParameterOverwrite); } $sUrl = $this->appendParamSeparator($urlWithoutQuery); $sUrl .= http_build_query($finalParameters, null, $paramSeparator); } if ($sUrl && !$blFinalUrl) { $sUrl = $this->appendParamSeparator($sUrl); } return $sUrl; }
php
public function appendUrl($sUrl, $parametersToAdd, $blFinalUrl = false, $allowParameterOverwrite = false) { $paramSeparator = self::PARAMETER_SEPARATOR; $finalParameters = $this->removeNotSetParameters($parametersToAdd); if (is_array($finalParameters) && !empty($finalParameters)) { $urlWithoutQuery = $sUrl; $separatorPlace = strpos($sUrl, '?'); if ($separatorPlace !== false) { $urlWithoutQuery = substr($sUrl, 0, $separatorPlace); $urlQueryEscaped = substr($sUrl, $separatorPlace + 1); $urlQuery = str_replace($paramSeparator, '&', $urlQueryEscaped); $finalParameters = $this->mergeDuplicatedParameters($finalParameters, $urlQuery, $allowParameterOverwrite); } $sUrl = $this->appendParamSeparator($urlWithoutQuery); $sUrl .= http_build_query($finalParameters, null, $paramSeparator); } if ($sUrl && !$blFinalUrl) { $sUrl = $this->appendParamSeparator($sUrl); } return $sUrl; }
[ "public", "function", "appendUrl", "(", "$", "sUrl", ",", "$", "parametersToAdd", ",", "$", "blFinalUrl", "=", "false", ",", "$", "allowParameterOverwrite", "=", "false", ")", "{", "$", "paramSeparator", "=", "self", "::", "PARAMETER_SEPARATOR", ";", "$", "f...
Appends url with given parameters. @param string $sUrl url to append @param array $parametersToAdd parameters to append @param bool $blFinalUrl final url @param bool $allowParameterOverwrite Decides if same parameters should overwrite query parameters. @return string
[ "Appends", "url", "with", "given", "parameters", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L149-L174
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.cleanUrl
public function cleanUrl($sUrl, $aParams = null) { /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */ $oStr = getStr(); if (is_array($aParams)) { foreach ($aParams as $sParam) { $sUrl = $oStr->preg_replace( '/(\?|&(amp;)?)' . preg_quote($sParam) . '=[a-z0-9\.]+&?(amp;)?/i', '\1', $sUrl ); } } else { $sUrl = $oStr->preg_replace('/(\?|&(amp;)?).+/i', '\1', $sUrl); } return trim($sUrl, "?"); }
php
public function cleanUrl($sUrl, $aParams = null) { /** @var \OxidEsales\Eshop\Core\StrRegular $oStr */ $oStr = getStr(); if (is_array($aParams)) { foreach ($aParams as $sParam) { $sUrl = $oStr->preg_replace( '/(\?|&(amp;)?)' . preg_quote($sParam) . '=[a-z0-9\.]+&?(amp;)?/i', '\1', $sUrl ); } } else { $sUrl = $oStr->preg_replace('/(\?|&(amp;)?).+/i', '\1', $sUrl); } return trim($sUrl, "?"); }
[ "public", "function", "cleanUrl", "(", "$", "sUrl", ",", "$", "aParams", "=", "null", ")", "{", "/** @var \\OxidEsales\\Eshop\\Core\\StrRegular $oStr */", "$", "oStr", "=", "getStr", "(", ")", ";", "if", "(", "is_array", "(", "$", "aParams", ")", ")", "{", ...
Removes any or specified dynamic parameter from given url. @param string $sUrl url to clean. @param array $aParams parameters to remove [optional]. @return string
[ "Removes", "any", "or", "specified", "dynamic", "parameter", "from", "given", "url", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L184-L201
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.addShopHost
public function addShopHost($sUrl) { if (!preg_match("#^https?://#i", $sUrl)) { $sShopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getSslShopUrl(); $sUrl = $sShopUrl . $sUrl; } return $sUrl; }
php
public function addShopHost($sUrl) { if (!preg_match("#^https?://#i", $sUrl)) { $sShopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getSslShopUrl(); $sUrl = $sShopUrl . $sUrl; } return $sUrl; }
[ "public", "function", "addShopHost", "(", "$", "sUrl", ")", "{", "if", "(", "!", "preg_match", "(", "\"#^https?://#i\"", ",", "$", "sUrl", ")", ")", "{", "$", "sShopUrl", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "ge...
Adds shop host if url does not start with it. @param string $sUrl @return string
[ "Adds", "shop", "host", "if", "url", "does", "not", "start", "with", "it", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L211-L219
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.processUrl
public function processUrl($sUrl, $blFinalUrl = true, $aParams = null, $iLang = null) { $sUrl = $this->appendUrl($sUrl, $aParams, $blFinalUrl); if ($this->isCurrentShopHost($sUrl)) { $sUrl = $this->processShopUrl($sUrl, $blFinalUrl, $iLang); } return $sUrl; }
php
public function processUrl($sUrl, $blFinalUrl = true, $aParams = null, $iLang = null) { $sUrl = $this->appendUrl($sUrl, $aParams, $blFinalUrl); if ($this->isCurrentShopHost($sUrl)) { $sUrl = $this->processShopUrl($sUrl, $blFinalUrl, $iLang); } return $sUrl; }
[ "public", "function", "processUrl", "(", "$", "sUrl", ",", "$", "blFinalUrl", "=", "true", ",", "$", "aParams", "=", "null", ",", "$", "iLang", "=", "null", ")", "{", "$", "sUrl", "=", "$", "this", "->", "appendUrl", "(", "$", "sUrl", ",", "$", "...
Performs base url processing - adds required parameters to given url. @param string $sUrl url to process. @param bool $blFinalUrl should url be finalized or should it end with ? or &amp; (default true). @param array $aParams additional parameters (default null). @param int $iLang url target language (default null). @return string
[ "Performs", "base", "url", "processing", "-", "adds", "required", "parameters", "to", "given", "url", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L231-L240
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.processShopUrl
public function processShopUrl($sUrl, $blFinalUrl = true, $iLang = null) { $aAddParams = $this->getAddUrlParams(); $sUrl = $this->appendUrl($sUrl, $aAddParams, $blFinalUrl); $sUrl = \OxidEsales\Eshop\Core\Registry::getLang()->processUrl($sUrl, $iLang); $sUrl = \OxidEsales\Eshop\Core\Registry::getSession()->processUrl($sUrl); if ($blFinalUrl) { $sUrl = $this->rightTrimAmp($sUrl); } return $sUrl; }
php
public function processShopUrl($sUrl, $blFinalUrl = true, $iLang = null) { $aAddParams = $this->getAddUrlParams(); $sUrl = $this->appendUrl($sUrl, $aAddParams, $blFinalUrl); $sUrl = \OxidEsales\Eshop\Core\Registry::getLang()->processUrl($sUrl, $iLang); $sUrl = \OxidEsales\Eshop\Core\Registry::getSession()->processUrl($sUrl); if ($blFinalUrl) { $sUrl = $this->rightTrimAmp($sUrl); } return $sUrl; }
[ "public", "function", "processShopUrl", "(", "$", "sUrl", ",", "$", "blFinalUrl", "=", "true", ",", "$", "iLang", "=", "null", ")", "{", "$", "aAddParams", "=", "$", "this", "->", "getAddUrlParams", "(", ")", ";", "$", "sUrl", "=", "$", "this", "->",...
Adds additional shop url parameters, session id, language id when needed. @param string $sUrl url to process. @param bool $blFinalUrl should url be finalized or should it end with ? or &amp;. @param int $iLang url target language. @return string
[ "Adds", "additional", "shop", "url", "parameters", "session", "id", "language", "id", "when", "needed", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L251-L264
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.getActiveShopHost
public function getActiveShopHost() { $shopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl(); return $this->extractHost($shopUrl); }
php
public function getActiveShopHost() { $shopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl(); return $this->extractHost($shopUrl); }
[ "public", "function", "getActiveShopHost", "(", ")", "{", "$", "shopUrl", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getShopUrl", "(", ")", ";", "return", "$", "this", "->", "extractHost", ...
Method returns active shop host. @return string
[ "Method", "returns", "active", "shop", "host", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L271-L276
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.getActiveShopUrlPath
public function getActiveShopUrlPath() { $shopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl(); return $this->extractUrlPath($shopUrl); }
php
public function getActiveShopUrlPath() { $shopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopUrl(); return $this->extractUrlPath($shopUrl); }
[ "public", "function", "getActiveShopUrlPath", "(", ")", "{", "$", "shopUrl", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getConfig", "(", ")", "->", "getShopUrl", "(", ")", ";", "return", "$", "this", "->", "extractUrlPat...
Method returns shop URL part - path. @return null|string
[ "Method", "returns", "shop", "URL", "part", "-", "path", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L295-L300
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.isCurrentShopHost
public function isCurrentShopHost($sUrl) { $blCurrent = false; $sUrlHost = @parse_url($sUrl, PHP_URL_HOST); // checks if it is relative url. if (is_null($sUrlHost)) { $blCurrent = true; } else { $aHosts = $this->_getHosts(); foreach ($aHosts as $sHost) { if ($sHost === $sUrlHost) { $blCurrent = true; break; } } } return $blCurrent; }
php
public function isCurrentShopHost($sUrl) { $blCurrent = false; $sUrlHost = @parse_url($sUrl, PHP_URL_HOST); // checks if it is relative url. if (is_null($sUrlHost)) { $blCurrent = true; } else { $aHosts = $this->_getHosts(); foreach ($aHosts as $sHost) { if ($sHost === $sUrlHost) { $blCurrent = true; break; } } } return $blCurrent; }
[ "public", "function", "isCurrentShopHost", "(", "$", "sUrl", ")", "{", "$", "blCurrent", "=", "false", ";", "$", "sUrlHost", "=", "@", "parse_url", "(", "$", "sUrl", ",", "PHP_URL_HOST", ")", ";", "// checks if it is relative url.", "if", "(", "is_null", "("...
Compares current URL to supplied string. @param string $sUrl @return bool true if $sUrl is equal to current page URL.
[ "Compares", "current", "URL", "to", "supplied", "string", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L321-L340
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.parseUrlAndAppendSchema
private function parseUrlAndAppendSchema($url, $flag, $appendScheme = 'http') { if (!filter_var($url, FILTER_VALIDATE_URL)) { $url = $appendScheme . '://' . $url; } return parse_url($url, $flag); }
php
private function parseUrlAndAppendSchema($url, $flag, $appendScheme = 'http') { if (!filter_var($url, FILTER_VALIDATE_URL)) { $url = $appendScheme . '://' . $url; } return parse_url($url, $flag); }
[ "private", "function", "parseUrlAndAppendSchema", "(", "$", "url", ",", "$", "flag", ",", "$", "appendScheme", "=", "'http'", ")", "{", "if", "(", "!", "filter_var", "(", "$", "url", ",", "FILTER_VALIDATE_URL", ")", ")", "{", "$", "url", "=", "$", "app...
Improved url parsing with parse_url as base and scheme checking improvement in url preprocessing @param string $url @param string $flag @param string $appendScheme Append this scheme to url if no scheme found @return string
[ "Improved", "url", "parsing", "with", "parse_url", "as", "base", "and", "scheme", "checking", "improvement", "in", "url", "preprocessing" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L351-L358
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.cleanUrlParams
public function cleanUrlParams($sUrl, $sConnector = '&amp;') { $aUrlParts = explode('?', $sUrl); // check for params part if (!is_array($aUrlParts) || count($aUrlParts) != 2) { return $sUrl; } $sUrl = $aUrlParts[0]; $sUrlParams = $aUrlParts[1]; /** @var \OxidEsales\Eshop\Core\StrRegular $oStrUtils */ $oStrUtils = getStr(); $sUrlParams = $oStrUtils->preg_replace( ['@(\&(amp;){1,})@ix', '@\&{1,}@', '@\?&@x'], ['&', '&', '?'], $sUrlParams ); // remove duplicate entries parse_str($sUrlParams, $aUrlParams); $sUrl .= '?' . http_build_query($aUrlParams, '', $sConnector); // replace brackets $sUrl = str_replace( ['%5B', '%5D'], ['[', ']'], $sUrl ); return $sUrl; }
php
public function cleanUrlParams($sUrl, $sConnector = '&amp;') { $aUrlParts = explode('?', $sUrl); // check for params part if (!is_array($aUrlParts) || count($aUrlParts) != 2) { return $sUrl; } $sUrl = $aUrlParts[0]; $sUrlParams = $aUrlParts[1]; /** @var \OxidEsales\Eshop\Core\StrRegular $oStrUtils */ $oStrUtils = getStr(); $sUrlParams = $oStrUtils->preg_replace( ['@(\&(amp;){1,})@ix', '@\&{1,}@', '@\?&@x'], ['&', '&', '?'], $sUrlParams ); // remove duplicate entries parse_str($sUrlParams, $aUrlParams); $sUrl .= '?' . http_build_query($aUrlParams, '', $sConnector); // replace brackets $sUrl = str_replace( ['%5B', '%5D'], ['[', ']'], $sUrl ); return $sUrl; }
[ "public", "function", "cleanUrlParams", "(", "$", "sUrl", ",", "$", "sConnector", "=", "'&amp;'", ")", "{", "$", "aUrlParts", "=", "explode", "(", "'?'", ",", "$", "sUrl", ")", ";", "// check for params part", "if", "(", "!", "is_array", "(", "$", "aUrlP...
Remove duplicate GET parameters and clean &amp; and duplicate &. @param string $sUrl url to process. @param string $sConnector GET elements connector. @return string
[ "Remove", "duplicate", "GET", "parameters", "and", "clean", "&amp", ";", "and", "duplicate", "&", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L386-L418
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.getCurrentUrl
public function getCurrentUrl() { $oUtilsServer = \OxidEsales\Eshop\Core\Registry::getUtilsServer(); $aServerParams["HTTPS"] = $oUtilsServer->getServerVar("HTTPS"); $aServerParams["HTTP_X_FORWARDED_PROTO"] = $oUtilsServer->getServerVar("HTTP_X_FORWARDED_PROTO"); $aServerParams["HTTP_HOST"] = $oUtilsServer->getServerVar("HTTP_HOST"); $aServerParams["REQUEST_URI"] = $oUtilsServer->getServerVar("REQUEST_URI"); $sProtocol = "http://"; if (isset($aServerParams['HTTPS']) && (($aServerParams['HTTPS'] == 'on' || $aServerParams['HTTPS'] == 1)) || (isset($aServerParams['HTTP_X_FORWARDED_PROTO']) && $aServerParams['HTTP_X_FORWARDED_PROTO'] == 'https') ) { $sProtocol = 'https://'; } return $sProtocol . $aServerParams['HTTP_HOST'] . $aServerParams['REQUEST_URI']; }
php
public function getCurrentUrl() { $oUtilsServer = \OxidEsales\Eshop\Core\Registry::getUtilsServer(); $aServerParams["HTTPS"] = $oUtilsServer->getServerVar("HTTPS"); $aServerParams["HTTP_X_FORWARDED_PROTO"] = $oUtilsServer->getServerVar("HTTP_X_FORWARDED_PROTO"); $aServerParams["HTTP_HOST"] = $oUtilsServer->getServerVar("HTTP_HOST"); $aServerParams["REQUEST_URI"] = $oUtilsServer->getServerVar("REQUEST_URI"); $sProtocol = "http://"; if (isset($aServerParams['HTTPS']) && (($aServerParams['HTTPS'] == 'on' || $aServerParams['HTTPS'] == 1)) || (isset($aServerParams['HTTP_X_FORWARDED_PROTO']) && $aServerParams['HTTP_X_FORWARDED_PROTO'] == 'https') ) { $sProtocol = 'https://'; } return $sProtocol . $aServerParams['HTTP_HOST'] . $aServerParams['REQUEST_URI']; }
[ "public", "function", "getCurrentUrl", "(", ")", "{", "$", "oUtilsServer", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getUtilsServer", "(", ")", ";", "$", "aServerParams", "[", "\"HTTPS\"", "]", "=", "$", "oUtilsServer", ...
Return current url. @return string
[ "Return", "current", "url", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L437-L455
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.stringToParamsArray
public function stringToParamsArray($sValue) { // url building // replace possible ampersands, explode, and filter out empty values $sValue = str_replace("&amp;", "&", $sValue); $aNavParams = explode("&", $sValue); $aNavParams = array_filter($aNavParams); $aParams = []; foreach ($aNavParams as $sValue) { $exp = explode("=", $sValue); $aParams[$exp[0]] = $exp[1]; } return $aParams; }
php
public function stringToParamsArray($sValue) { // url building // replace possible ampersands, explode, and filter out empty values $sValue = str_replace("&amp;", "&", $sValue); $aNavParams = explode("&", $sValue); $aNavParams = array_filter($aNavParams); $aParams = []; foreach ($aNavParams as $sValue) { $exp = explode("=", $sValue); $aParams[$exp[0]] = $exp[1]; } return $aParams; }
[ "public", "function", "stringToParamsArray", "(", "$", "sValue", ")", "{", "// url building", "// replace possible ampersands, explode, and filter out empty values", "$", "sValue", "=", "str_replace", "(", "\"&amp;\"", ",", "\"&\"", ",", "$", "sValue", ")", ";", "$", ...
Forms parameters array out of a string. Takes & and &amp; as delimiters. Returns associative array with parameters. @param string $sValue String @return array
[ "Forms", "parameters", "array", "out", "of", "a", "string", ".", "Takes", "&", "and", "&amp", ";", "as", "delimiters", ".", "Returns", "associative", "array", "with", "parameters", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L466-L480
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl._getHosts
protected function _getHosts() { if ($this->_aHosts === null) { $this->_aHosts = []; $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $this->_addMallHosts($this->_aHosts); // language url $this->_addLanguageHost($oConfig->getConfigParam('aLanguageURLs'), $this->_aHosts); $this->_addLanguageHost($oConfig->getConfigParam('aLanguageSSLURLs'), $this->_aHosts); // current url $this->_addHost($oConfig->getConfigParam("sShopURL"), $this->_aHosts); $this->_addHost($oConfig->getConfigParam("sSSLShopURL"), $this->_aHosts); if ($this->isAdmin()) { $this->_addHost($oConfig->getConfigParam("sAdminSSLURL"), $this->_aHosts); } } return $this->_aHosts; }
php
protected function _getHosts() { if ($this->_aHosts === null) { $this->_aHosts = []; $oConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); $this->_addMallHosts($this->_aHosts); // language url $this->_addLanguageHost($oConfig->getConfigParam('aLanguageURLs'), $this->_aHosts); $this->_addLanguageHost($oConfig->getConfigParam('aLanguageSSLURLs'), $this->_aHosts); // current url $this->_addHost($oConfig->getConfigParam("sShopURL"), $this->_aHosts); $this->_addHost($oConfig->getConfigParam("sSSLShopURL"), $this->_aHosts); if ($this->isAdmin()) { $this->_addHost($oConfig->getConfigParam("sAdminSSLURL"), $this->_aHosts); } } return $this->_aHosts; }
[ "protected", "function", "_getHosts", "(", ")", "{", "if", "(", "$", "this", "->", "_aHosts", "===", "null", ")", "{", "$", "this", "->", "_aHosts", "=", "[", "]", ";", "$", "oConfig", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Re...
Collects and returns current shop hosts array. @return array
[ "Collects", "and", "returns", "current", "shop", "hosts", "array", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L529-L551
train
OXID-eSales/oxideshop_ce
source/Core/UtilsUrl.php
UtilsUrl.removeNotSetParameters
private function removeNotSetParameters($parametersToAdd) { if (is_array($parametersToAdd) && !empty($parametersToAdd)) { foreach ($parametersToAdd as $key => $value) { if (is_null($value)) { unset($parametersToAdd[$key]); } } } return $parametersToAdd; }
php
private function removeNotSetParameters($parametersToAdd) { if (is_array($parametersToAdd) && !empty($parametersToAdd)) { foreach ($parametersToAdd as $key => $value) { if (is_null($value)) { unset($parametersToAdd[$key]); } } } return $parametersToAdd; }
[ "private", "function", "removeNotSetParameters", "(", "$", "parametersToAdd", ")", "{", "if", "(", "is_array", "(", "$", "parametersToAdd", ")", "&&", "!", "empty", "(", "$", "parametersToAdd", ")", ")", "{", "foreach", "(", "$", "parametersToAdd", "as", "$"...
Removes parameters which are not set. @param string $parametersToAdd @return string
[ "Removes", "parameters", "which", "are", "not", "set", "." ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsUrl.php#L591-L602
train
OXID-eSales/oxideshop_ce
source/Application/Model/Diagnostics.php
Diagnostics.getShopDetails
public function getShopDetails() { $aShopDetails = [ 'Date' => date(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('fullDateFormat'), time()), 'URL' => $this->getShopLink(), 'Edition' => $this->getEdition(), 'Version' => $this->getVersion(), 'Subshops (Total)' => $this->_countRows('oxshops', true), 'Subshops (Active)' => $this->_countRows('oxshops', false), 'Categories (Total)' => $this->_countRows('oxcategories', true), 'Categories (Active)' => $this->_countRows('oxcategories', false), 'Articles (Total)' => $this->_countRows('oxarticles', true), 'Articles (Active)' => $this->_countRows('oxarticles', false), 'Users (Total)' => $this->_countRows('oxuser', true), ]; return $aShopDetails; }
php
public function getShopDetails() { $aShopDetails = [ 'Date' => date(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('fullDateFormat'), time()), 'URL' => $this->getShopLink(), 'Edition' => $this->getEdition(), 'Version' => $this->getVersion(), 'Subshops (Total)' => $this->_countRows('oxshops', true), 'Subshops (Active)' => $this->_countRows('oxshops', false), 'Categories (Total)' => $this->_countRows('oxcategories', true), 'Categories (Active)' => $this->_countRows('oxcategories', false), 'Articles (Total)' => $this->_countRows('oxarticles', true), 'Articles (Active)' => $this->_countRows('oxarticles', false), 'Users (Total)' => $this->_countRows('oxuser', true), ]; return $aShopDetails; }
[ "public", "function", "getShopDetails", "(", ")", "{", "$", "aShopDetails", "=", "[", "'Date'", "=>", "date", "(", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "Registry", "::", "getLang", "(", ")", "->", "translateString", "(", "'fullDateFormat'",...
Collects information on the shop, like amount of categories, articles, users @return array
[ "Collects", "information", "on", "the", "shop", "like", "amount", "of", "categories", "articles", "users" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Diagnostics.php#L108-L125
train
OXID-eSales/oxideshop_ce
source/Application/Model/Diagnostics.php
Diagnostics._countRows
protected function _countRows($sTable, $blMode) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sRequest = 'SELECT COUNT(*) FROM ' . $sTable; if ($blMode == false) { $sRequest .= ' WHERE oxactive = 1'; } $aRes = $oDb->select($sRequest)->fields[0]; return $aRes; }
php
protected function _countRows($sTable, $blMode) { $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(); $sRequest = 'SELECT COUNT(*) FROM ' . $sTable; if ($blMode == false) { $sRequest .= ' WHERE oxactive = 1'; } $aRes = $oDb->select($sRequest)->fields[0]; return $aRes; }
[ "protected", "function", "_countRows", "(", "$", "sTable", ",", "$", "blMode", ")", "{", "$", "oDb", "=", "\\", "OxidEsales", "\\", "Eshop", "\\", "Core", "\\", "DatabaseProvider", "::", "getDb", "(", ")", ";", "$", "sRequest", "=", "'SELECT COUNT(*) FROM ...
counts result Rows @param string $sTable table @param boolean $blMode mode @return integer
[ "counts", "result", "Rows" ]
acd72f4a7c5c7340d70b191e081e4a24b74887cc
https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Diagnostics.php#L135-L147
train