idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
36,000 | public function removeCat ( ) { $ categoriesToRemove = $ this -> _getActionIds ( 'oxcategories.oxid' ) ; $ oxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'oxid' ) ; $ dataBase = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; if ( \ OxidEsales \ Eshop \ Core \ Regi... | Removes article from chosen category |
36,001 | public function addCat ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ categoriesToAdd = $ this -> _getActionIds ( 'oxcategories.oxid' ) ; $ oxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; $ shopId = $ config -> getShopId ( ) ; $ objec... | Adds article to chosen category |
36,002 | protected function _updateOxTime ( $ oxId ) { $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ objectToCategoryView = $ this -> _getViewName ( 'oxobject2category' ) ; $ oxId = $ database -> quote ( $ oxId ) ; $ queryToEmbed = $ this -> formQueryToEmbedForUpdatingTime ( ) ; $ query = "update ... | Updates oxtime value for product |
36,003 | public function setAsDefault ( ) { $ defCat = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "defcat" ) ; $ oxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "oxid" ) ; $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ qu... | Sets selected category as a default |
36,004 | public function save ( ) { $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; $ aParams [ 'oxnewsletter__oxshopid' ] = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ; $ oNewsletter = oxNew ( \ Ox... | Saves newsletter selection changes . |
36,005 | public function render ( ) { parent :: render ( ) ; $ this -> _aViewData [ 'edit' ] = $ oCategory = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( 'neworder_sess' , null ) ; $ soxId = $ this -> getEditObjectId ( ) ; if... | Loads article category ordering info passes it to Smarty engine and returns name of template file category_order . tpl . |
36,006 | private function controllerKeysToLowercase ( array $ controllers ) : array { $ result = [ ] ; foreach ( $ controllers as $ controllerKey => $ controllerClass ) { $ result [ strtolower ( $ controllerKey ) ] = $ controllerClass ; } return $ result ; } | Change the controller keys to lower case . |
36,007 | public function loadVendorList ( ) { $ oBaseObject = $ this -> getBaseObject ( ) ; $ sFieldList = $ oBaseObject -> getSelectFields ( ) ; $ sViewName = $ oBaseObject -> getViewName ( ) ; $ this -> getBaseObject ( ) -> setShowArticleCnt ( $ this -> _blShowVendorArticleCnt ) ; $ sWhere = '' ; if ( ! $ this -> isAdmin ( ) ... | Loads simple vendor list |
36,008 | public function buildVendorTree ( $ sLinkTarget , $ sActCat , $ sShopHomeUrl ) { $ sActCat = str_replace ( 'v_' , '' , $ sActCat ) ; $ this -> loadVendorList ( ) ; $ this -> _oRoot = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Vendor :: class ) ; $ this -> _oRoot -> load ( 'root' ) ; $ this -> _addCategoryFiel... | Creates fake root for vendor tree and ads category list fileds for each vendor item |
36,009 | protected function _addCategoryFields ( $ oVendor ) { $ oVendor -> oxcategories__oxid = new \ OxidEsales \ Eshop \ Core \ Field ( "v_" . $ oVendor -> oxvendor__oxid -> value ) ; $ oVendor -> oxcategories__oxicon = $ oVendor -> oxvendor__oxicon ; $ oVendor -> oxcategories__oxtitle = $ oVendor -> oxvendor__oxtitle ; $ oV... | Adds category specific fields to vendor object |
36,010 | protected function _seoSetVendorData ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> seoIsActive ( ) && ! $ this -> isAdmin ( ) ) { $ oEncoder = \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ SeoEncoderVendor :: class ) ; if ( $ this -> _oRoot ) { $ oEn... | Processes vendor category URLs |
36,011 | public function getCatArticleCount ( $ sCatId ) { $ sActIdent = $ this -> _getUserViewId ( ) ; $ aCatData = $ this -> _getCatCache ( ) ; if ( ! $ aCatData || ! isset ( $ aCatData [ $ sCatId ] [ $ sActIdent ] ) ) { $ iCnt = $ this -> setCatArticleCount ( $ aCatData , $ sCatId , $ sActIdent ) ; } else { $ iCnt = $ aCatDa... | Returns category article count |
36,012 | public function getPriceCatArticleCount ( $ sCatId , $ dPriceFrom , $ dPriceTo ) { $ sActIdent = $ this -> _getUserViewId ( ) ; $ aCatData = $ this -> _getCatCache ( ) ; if ( ! $ aCatData || ! isset ( $ aCatData [ $ sCatId ] [ $ sActIdent ] ) ) { $ iCnt = $ this -> setPriceCatArticleCount ( $ aCatData , $ sCatId , $ sA... | Returns category article count price |
36,013 | public function getVendorArticleCount ( $ sVendorId ) { $ sActIdent = $ this -> _getUserViewId ( ) ; $ aVendorData = $ this -> _getVendorCache ( ) ; if ( ! $ aVendorData || ! isset ( $ aVendorData [ $ sVendorId ] [ $ sActIdent ] ) ) { $ iCnt = $ this -> setVendorArticleCount ( $ aVendorData , $ sVendorId , $ sActIdent ... | Returns vendor article count |
36,014 | public function getManufacturerArticleCount ( $ sManufacturerId ) { $ sActIdent = $ this -> _getUserViewId ( ) ; $ aManufacturerData = $ this -> _getManufacturerCache ( ) ; if ( ! $ aManufacturerData || ! isset ( $ aManufacturerData [ $ sManufacturerId ] [ $ sActIdent ] ) ) { $ iCnt = $ this -> setManufacturerArticleCo... | Returns Manufacturer article count |
36,015 | public function setCatArticleCount ( $ aCache , $ sCatId , $ sActIdent ) { $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ sTable = $ oArticle -> getViewName ( ) ; $ sO2CView = getViewName ( 'oxobject2category' ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ... | Saves and returns category article count into cache |
36,016 | public function setVendorArticleCount ( $ aCache , $ sCatId , $ sActIdent ) { if ( $ sCatId == 'root' ) { return 0 ; } $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ sTable = $ oArticle -> getViewName ( ) ; $ sQ = "select $sTable.oxvendorid AS vendorId, count(*) from $sTable wh... | Saves and returns vendors category article count into cache |
36,017 | protected function getAssoc ( $ query , $ parameters = [ ] ) { $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ resultSet = $ database -> select ( $ query , $ parameters ) ; $ rows = $ resultSet -> fetchAll ( ) ; if ( ! $ row... | Returns the query result as a two dimensional associative array . The keys of the first level are the firsts value of each row . The values of the first level arrays with numeric key that hold the all the values of each row but the first one which is used a a key in the first level . |
36,018 | public function setManufacturerArticleCount ( $ aCache , $ sMnfId , $ sActIdent ) { if ( $ sMnfId == 'root' ) { return 0 ; } $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ sArtTable = $ oArticle -> getViewName ( ) ; $ sQ = "select count($sArtTable.oxid) from $sArtTable where $s... | Saves and returns Manufacturers category article count into cache |
36,019 | public function resetPriceCatArticleCount ( $ iPrice ) { if ( $ aCatData = $ this -> _getCatCache ( ) ) { $ sTable = getViewName ( 'oxcategories' ) ; $ sSelect = "select $sTable.oxid from $sTable where " . ( double ) $ iPrice . " >= $sTable.oxpricefrom and " . ( double ) $ iPrice . " <= $sTable.oxpriceto " ; $ rs = \ O... | Resets price categories article count |
36,020 | protected function _getCatCache ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ aLocalCatCache = $ myConfig -> getGlobalParameter ( 'aLocalCatCache' ) ; if ( ! $ aLocalCatCache ) { $ sLocalCatCache = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> fromFileCache ( 'aLocalCatCache... | Loads and returns category cache data array |
36,021 | protected function _setCatCache ( $ aCache ) { \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> setGlobalParameter ( 'aLocalCatCache' , $ aCache ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> toFileCache ( 'aLocalCatCache' , $ aCache ) ; } | Writes category data into cache |
36,022 | public function getNext ( $ ident ) { $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ database -> startTransaction ( ) ; try { $ query = "SELECT `oxcount` FROM `oxcounters` WHERE `oxident` = ? FOR UPDATE" ; $ currentCounter = ( int ) $ database -> getOne ( $ query , [ $ ident ] ) ; $ nextCo... | Return the next counter value for a given type of counter |
36,023 | public function update ( $ ident , $ count ) { $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ database -> startTransaction ( ) ; try { $ query = "SELECT `oxcount` FROM `oxcounters` WHERE `oxident` = ? FOR UPDATE" ; $ database -> getOne ( $ query , [ $ ident ] ) ; $ query = "INSERT INTO `ox... | Update the counter value for a given type of counter but only when it is greater than the current value |
36,024 | public function render ( ) { parent :: render ( ) ; $ oSmarty = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> getSmarty ( ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> isDemoShop ( ) ) { $ oSmarty -> php_handling = SMARTY_PHP_PASSTHRU ; } foreach ( array_keys ( $ this -> _aViewData... | Renders requested RSS feed |
36,025 | public function topshop ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_rssTopShop' ) ) { $ this -> _getRssFeed ( ) -> loadTopInShop ( ) ; } else { error_404_handler ( ) ; } } | getTopShop loads top shop articles to rss |
36,026 | public function newarts ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_rssNewest' ) ) { $ this -> _getRssFeed ( ) -> loadNewestArticles ( ) ; } else { error_404_handler ( ) ; } } | loads newest shop articles |
36,027 | public function catarts ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_rssCategories' ) ) { $ oCat = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Category :: class ) ; if ( $ oCat -> load ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter... | loads category articles |
36,028 | public function searcharts ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_rssSearch' ) ) { $ sSearchParameter = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'searchparam' , true ) ; $ sCatId = \ OxidEsales \ Eshop \ Core \ Registry :: getCo... | loads search articles |
36,029 | public function recommlists ( ) { if ( $ this -> getViewConfig ( ) -> getShowListmania ( ) && \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_rssRecommLists' ) ) { $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; if ( $ oArticle -> load ( \ OxidEsale... | loads recommendation lists |
36,030 | public function recommlistarts ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_rssRecommListArts' ) ) { $ oRecommList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ RecommendationList :: class ) ; if ( $ oRecommList -> load ( \ OxidEsales \ Eshop \ Core \ Registry :: g... | loads recommendation list articles |
36,031 | public function bargain ( ) { if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_rssBargain' ) ) { $ this -> _getRssFeed ( ) -> loadBargain ( ) ; } else { error_404_handler ( ) ; } } | getBargain loads top shop articles to rss |
36,032 | public function getChannel ( ) { if ( $ this -> _oChannel === null ) { $ this -> _oChannel = $ this -> _getRssFeed ( ) -> getChannel ( ) ; } return $ this -> _oChannel ; } | Template variable getter . Returns rss channel |
36,033 | public function render ( ) { parent :: render ( ) ; $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ oAttr = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Attribute :: class ) ; $ soxId = $ this -> _aViewData [ "oxid" ] = $ this -> getEditObjectId ( ) ; if ( isset ( $ soxId ) && $ soxId !... | Loads article Attributes info passes it to Smarty engine and returns name of template file attribute_main . tpl . |
36,034 | protected function _getQueryCols ( ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ sLangTag = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getLanguageTag ( ) ; $ sQ = '' ; $ blSep = false ; $ aVisiblecols = $ this -> _getVisibleColNames ( ) ; foreach ( $ aVisiblecols as $ iCnt =>... | Formats and returns chunk of SQL query string with definition of fields to load from DB . Adds subselect to get variant title from parent article |
36,035 | public function getActiveModuleInfo ( ) { $ aModulePaths = $ this -> getModuleConfigParametersByKey ( static :: MODULE_KEY_PATHS ) ; if ( ! is_array ( $ aModulePaths ) || count ( $ aModulePaths ) < 1 ) { $ aModulePaths = $ this -> extractModulePaths ( ) ; } $ aDisabledModules = $ this -> getDisabledModules ( ) ; if ( i... | Get active modules path info |
36,036 | public function getDisabledModuleInfo ( ) { $ aDisabledModules = $ this -> getDisabledModules ( ) ; $ aModulePaths = [ ] ; if ( is_array ( $ aDisabledModules ) && count ( $ aDisabledModules ) > 0 ) { $ aModulePaths = $ this -> getModuleConfigParametersByKey ( static :: MODULE_KEY_PATHS ) ; if ( ! is_array ( $ aModulePa... | Get disabled module paths |
36,037 | public function extractModulePaths ( ) { $ aModules = $ this -> getModulesWithExtendedClass ( ) ; $ aModulePaths = [ ] ; if ( is_array ( $ aModules ) && count ( $ aModules ) > 0 ) { foreach ( $ aModules as $ aModuleClasses ) { foreach ( $ aModuleClasses as $ sModule ) { $ sModuleId = substr ( $ sModule , 0 , strpos ( $... | Extract module id s with paths from extended classes . |
36,038 | public function getDisabledModuleClasses ( ) { $ disabledModules = $ this -> getDisabledModules ( ) ; $ disabledModuleClasses = [ ] ; if ( isset ( $ disabledModules ) && is_array ( $ disabledModules ) ) { $ extensions = $ this -> getModuleConfigParametersByKey ( static :: MODULE_KEY_EXTENSIONS ) ; $ modules = $ this ->... | Returns disabled module classes with path using config aModules and aModulePaths . aModules has all extended classes aModulePaths has module id to main path array |
36,039 | public function cleanup ( ) { $ aDeletedModules = $ this -> getDeletedExtensions ( ) ; $ aDeletedModuleIds = array_keys ( $ aDeletedModules ) ; $ this -> _removeExtensions ( $ aDeletedModuleIds ) ; $ this -> _removeFromDisabledModulesArray ( $ aDeletedModuleIds ) ; $ this -> removeFromModulesArray ( static :: MODULE_KE... | Removes extension metadata from shop . |
36,040 | public function getDeletedExtensions ( ) { $ oModuleValidatorFactory = $ this -> getModuleValidatorFactory ( ) ; $ oModuleMetadataValidator = $ oModuleValidatorFactory -> getModuleMetadataValidator ( ) ; $ aModulesIds = $ this -> getModuleIds ( ) ; $ oModule = $ this -> getModule ( ) ; $ aDeletedExt = [ ] ; foreach ( $... | Checks module list - if there is extensions that are registered but extension directory is missing |
36,041 | public function buildModuleChains ( $ aModuleArray ) { $ aModules = [ ] ; if ( is_array ( $ aModuleArray ) ) { foreach ( $ aModuleArray as $ sClass => $ aModuleChain ) { $ aModules [ $ sClass ] = implode ( '&' , $ aModuleChain ) ; } } return $ aModules ; } | Build module chains from nested array |
36,042 | protected function _removeExtensions ( $ aModuleIds ) { $ aModuleExtensions = $ this -> getModulesWithExtendedClass ( ) ; $ aExtensionsToDelete = [ ] ; foreach ( $ aModuleIds as $ sModuleId ) { $ aExtensionsToDelete = array_merge_recursive ( $ aExtensionsToDelete , $ this -> getModuleExtensions ( $ sModuleId ) ) ; } $ ... | Removes extension by given modules ids . |
36,043 | protected function _removeFromDisabledModulesArray ( $ aDeletedExtIds ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ aDisabledExtensionIds = $ this -> getDisabledModules ( ) ; $ aDisabledExtensionIds = array_diff ( $ aDisabledExtensionIds , $ aDeletedExtIds ) ; $ oConfig -> saveShopConfVar ... | Removes extension from disabled modules array |
36,044 | protected function removeFromModulesArray ( $ key , $ aDeletedModule ) { $ array = $ this -> getModuleConfigParametersByKey ( $ key ) ; foreach ( $ aDeletedModule as $ sDeletedModuleId ) { if ( isset ( $ array [ $ sDeletedModuleId ] ) ) { unset ( $ array [ $ sDeletedModuleId ] ) ; } } \ OxidEsales \ Eshop \ Core \ Regi... | Removes extension from given modules array . |
36,045 | protected function _removeFromDatabase ( $ aDeletedExtIds ) { if ( ! is_array ( $ aDeletedExtIds ) || ! count ( $ aDeletedExtIds ) ) { return ; } $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ aConfigIds = $ sDelExtIds = [ ] ; foreach ( $ aDeletedExtIds as $ sDeletedExtId ) { $ aConfigIds [ ] =... | Removes extension from database - oxConfig oxConfigDisplay and oxTplBlocks tables |
36,046 | public function getModuleIds ( ) { $ aModuleIdsFromExtensions = $ this -> _getModuleIdsFromExtensions ( $ this -> getModulesWithExtendedClass ( ) ) ; $ aModuleIdsFromFiles = array_keys ( $ this -> getModuleConfigParametersByKey ( static :: MODULE_KEY_FILES ) ) ; return array_unique ( array_merge ( $ aModuleIdsFromExten... | Returns module ids which have extensions or files . |
36,047 | public function getModuleExtensions ( $ sModuleId ) { if ( ! isset ( $ this -> _aModuleExtensions ) ) { $ aModuleExtension = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getModulesWithExtendedClass ( ) ; $ oModule = $ this -> getModule ( ) ; $ aExtension = [ ] ; foreach ( $ aModuleExtension as $ sOxClass ... | Returns module extensions . |
36,048 | protected function _isVendorDir ( $ sModuleDir ) { if ( ! is_dir ( $ sModuleDir ) ) { return false ; } $ currentDirectoryContents = scandir ( $ sModuleDir ) ; $ currentDirectoryContents = array_diff ( $ currentDirectoryContents , [ '.' , '..' ] ) ; foreach ( $ currentDirectoryContents as $ entry ) { if ( is_dir ( "$sMo... | Checks if directory is vendor directory . |
36,049 | protected function _extendsClasses ( $ sModuleDir ) { $ aModules = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aModules' ) ; if ( is_array ( $ aModules ) ) { $ sModules = implode ( '&' , $ aModules ) ; if ( preg_match ( "@(^|&+)" . $ sModuleDir . "\b@" , $ sModules ) ) { return true ; }... | Checks if module extends any shop class . |
36,050 | protected function _saveModulePath ( $ sModuleId , $ sModulePath ) { $ aModulePaths = $ this -> getModuleConfigParametersByKey ( static :: MODULE_KEY_PATHS ) ; $ aModulePaths [ $ sModuleId ] = $ sModulePath ; \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> saveShopConfVar ( 'aarr' , 'aModulePaths' , $ aModul... | Saving module path info . Module path is saved to config variable aModulePaths . |
36,051 | private function _getModuleIdsFromExtensions ( $ aData ) { $ aModuleIds = [ ] ; $ oModule = $ this -> getModule ( ) ; foreach ( $ aData as $ aModule ) { foreach ( $ aModule as $ sFilePath ) { $ sModuleId = $ oModule -> getIdByPath ( $ sFilePath ) ; $ aModuleIds [ ] = $ sModuleId ; } } return $ aModuleIds ; } | Returns module ids which have extensions . |
36,052 | private function _getInvalidExtensions ( $ moduleId ) { $ extendedShopClasses = $ this -> getModuleExtensions ( $ moduleId ) ; $ invalidModuleClasses = [ ] ; foreach ( $ extendedShopClasses as $ extendedShopClass => $ moduleClasses ) { foreach ( $ moduleClasses as $ moduleClass ) { if ( \ OxidEsales \ Eshop \ Core \ Na... | Returns shop classes and associated invalid module classes for a given module id |
36,053 | public function setFile ( $ sFileName , $ sFileId , $ iMaxDownloadCounts , $ iExpirationTime , $ iExpirationDownloadTime ) { $ sNow = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ; $ sDate = date ( 'Y-m-d G:i' , $ sNow + $ iExpirationTime * 3600 ) ; $ this -> oxorderfiles__oxfileid = new \ ... | Set file and download options |
36,054 | public function getFileSize ( ) { $ oFile = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ File :: class ) ; $ oFile -> load ( $ this -> oxorderfiles__oxfileid -> value ) ; return $ oFile -> getSize ( ) ; } | Returns downloadable file size in bytes . |
36,055 | protected function _getFieldLongName ( $ sFieldName ) { $ aFieldNames = [ 'oxorderfiles__oxarticletitle' , 'oxorderfiles__oxarticleartnum' , 'oxorderfiles__oxordernr' , 'oxorderfiles__oxorderdate' , 'oxorderfiles__oxispaid' , 'oxorderfiles__oxpurchasedonly' ] ; if ( in_array ( $ sFieldName , $ aFieldNames ) ) { return ... | returns long name |
36,056 | public function isValid ( ) { if ( ! $ this -> oxorderfiles__oxmaxdownloadcount -> value || ( $ this -> oxorderfiles__oxdownloadcount -> value < $ this -> oxorderfiles__oxmaxdownloadcount -> value ) ) { if ( ! $ this -> oxorderfiles__oxlinkexpirationtime -> value && ! $ this -> oxorderfiles__oxdownloadxpirationtime -> ... | Checks if order file is still available to download |
36,057 | public function getLeftDownloadCount ( ) { $ iLeft = $ this -> oxorderfiles__oxmaxdownloadcount -> value - $ this -> oxorderfiles__oxdownloadcount -> value ; if ( $ iLeft < 0 ) { $ iLeft = 0 ; } return $ iLeft ; } | returns date ant time |
36,058 | public function processOrderFile ( ) { if ( $ this -> isValid ( ) ) { if ( ! $ this -> oxorderfiles__oxdownloadcount -> value ) { $ this -> oxorderfiles__oxdownloadcount = new \ OxidEsales \ Eshop \ Core \ Field ( 1 ) ; $ iExpirationTime = $ this -> oxorderfiles__oxdownloadexpirationtime -> value * 3600 ; $ iTime = \ O... | Checks if download link is valid changes count if first download changes valid until |
36,059 | private function _getClusterId ( ) { $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ sBaseShop = $ oConfig -> getBaseShopId ( ) ; $ sClusterId = $ oConfig -> getShopConfVar ( 'sClusterId' , $ sBaseShop ) ; if ( ! $ sClusterId ) { $ oUUIDGenerator = oxNew ( \ OxidEsales \ Eshop \ Core \ Universal... | Returns cluster id . Takes cluster id from configuration if set otherwise generates it . |
36,060 | public function getConfigParam ( $ name , $ default = null ) { $ this -> init ( ) ; if ( isset ( $ this -> _aConfigParams [ $ name ] ) ) { $ value = $ this -> _aConfigParams [ $ name ] ; } elseif ( isset ( $ this -> $ name ) ) { $ value = $ this -> $ name ; } else { $ value = $ default ; } return $ value ; } | Returns config parameter value if such parameter exists |
36,061 | public function setConfigParam ( $ name , $ value ) { if ( isset ( $ this -> _aConfigParams [ $ name ] ) ) { $ this -> _aConfigParams [ $ name ] = $ value ; } elseif ( isset ( $ this -> $ name ) ) { $ this -> $ name = $ value ; } else { $ this -> _aConfigParams [ $ name ] = $ value ; } } | Stores config parameter value in config |
36,062 | public function initVars ( $ shopID ) { $ this -> _loadVarsFromFile ( ) ; $ this -> _setDefaults ( ) ; $ configLoaded = $ this -> _loadVarsFromDb ( $ shopID ) ; if ( empty ( $ shopID ) || ! $ configLoaded ) { $ exception = new \ OxidEsales \ Eshop \ Core \ Exception \ DatabaseException ( "Unable to load shop config val... | Initialize configuration variables |
36,063 | public function init ( ) { if ( $ this -> _blInit ) { return ; } $ this -> _blInit = true ; try { $ this -> initVars ( $ this -> getShopId ( ) ) ; $ this -> initializeShop ( ) ; $ this -> _oStart = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ OxidStartController :: class ) ; $ this -> _oStart -> appInit ( ... | Starts session manager |
36,064 | protected function _loadVarsFromFile ( ) { include getShopBasePath ( ) . '/config.inc.php' ; $ fileUtils = Registry :: getUtilsFile ( ) ; $ this -> sShopDir = $ fileUtils -> normalizeDir ( $ this -> sShopDir ) ; $ this -> sCompileDir = $ fileUtils -> normalizeDir ( $ this -> sCompileDir ) ; $ this -> sShopURL = $ fileU... | Loads vars from default config file |
36,065 | protected function _setDefaults ( ) { $ this -> setConfigParam ( 'sTheme' , 'azure' ) ; if ( is_null ( $ this -> getConfigParam ( 'sDefaultLang' ) ) ) { $ this -> setConfigParam ( 'sDefaultLang' , 0 ) ; } if ( is_null ( $ this -> getConfigParam ( 'blLogChangesInAdmin' ) ) ) { $ this -> setConfigParam ( 'blLogChangesInA... | Set important defaults . |
36,066 | protected function _loadVarsFromDb ( $ shopID , $ onlyVars = null , $ module = '' ) { $ db = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ moduleSql = $ module ? " oxmodule LIKE " . $ db -> quote ( $ module . "%" ) : " oxmodule='' " ; $ onlyVarsSql = $ this -> _getConfigParamsSelectSnippet ( $ onlyVar... | Load config values from DB |
36,067 | protected function _getConfigParamsSelectSnippet ( $ vars ) { $ select = '' ; if ( is_array ( $ vars ) && ! empty ( $ vars ) ) { foreach ( $ vars as & $ field ) { $ field = '"' . $ field . '"' ; } $ select = ' and oxvarname in ( ' . implode ( ', ' , $ vars ) . ' ) ' ; } return $ select ; } | Allow loading from some vars only from baseshop |
36,068 | protected function _setConfVarFromDb ( $ varName , $ varType , $ varVal ) { if ( ( $ varName == 'sShopURL' || $ varName == 'sSSLShopURL' ) && ( ! $ varVal || $ this -> isAdmin ( ) === true ) ) { return ; } switch ( $ varType ) { case 'arr' : case 'aarr' : $ this -> setConfigParam ( $ varName , unserialize ( $ varVal ) ... | Sets config variable to config object first unserializing it by given type . sShopURL and sSSLShopURL are skipped for admin or when URL values are not set |
36,069 | public function getRequestControllerClass ( ) { $ controllerId = $ this -> getRequestControllerId ( ) ; $ controllerClass = Registry :: getControllerClassNameResolver ( ) -> getClassNameById ( $ controllerId ) ; return $ controllerClass ; } | Use this function to get the controller class hidden behind the request s cl parameter . |
36,070 | public function getGlobalParameter ( $ name ) { if ( isset ( $ this -> _aGlobalParams [ $ name ] ) ) { return $ this -> _aGlobalParams [ $ name ] ; } else { return null ; } } | Returns global parameter value |
36,071 | public function getShopId ( ) { if ( is_null ( $ this -> _iShopId ) ) { $ shopId = $ this -> calculateActiveShopId ( ) ; $ this -> setShopId ( $ shopId ) ; if ( ! $ this -> _isValidShopId ( $ shopId ) ) { $ shopId = $ this -> getBaseShopId ( ) ; } $ this -> setShopId ( $ shopId ) ; } return $ this -> _iShopId ; } | Returns active shop ID . |
36,072 | protected function _checkSsl ( ) { $ myUtilsServer = Registry :: getUtilsServer ( ) ; $ serverVars = $ myUtilsServer -> getServerVar ( ) ; $ httpsServerVar = $ myUtilsServer -> getServerVar ( 'HTTPS' ) ; $ this -> setIsSsl ( ) ; if ( isset ( $ httpsServerVar ) && ( $ httpsServerVar === 'on' || $ httpsServerVar === 'ON'... | Checks if WEB session is SSL . |
36,073 | public function isCurrentProtocol ( $ url ) { if ( ! $ url || ( strpos ( $ url , "http" ) !== 0 ) ) { return true ; } return ( strpos ( $ url , "https:" ) === 0 ) == $ this -> isSsl ( ) ; } | Compares current protocol to supplied url string |
36,074 | public function getShopUrl ( $ lang = null , $ admin = null ) { $ url = null ; $ admin = isset ( $ admin ) ? $ admin : $ this -> isAdmin ( ) ; if ( ! $ admin ) { $ url = $ this -> getShopUrlByLanguage ( $ lang ) ; if ( ! $ url ) { $ url = $ this -> getMallShopUrl ( ) ; } } if ( ! $ url ) { $ url = $ this -> getConfigPa... | Returns config sShopURL or sMallShopURL if secondary shop |
36,075 | public function getSslShopUrl ( $ lang = null ) { $ url = $ this -> getShopUrlByLanguage ( $ lang , true ) ; if ( ! $ url ) { $ url = $ this -> getMallShopUrl ( true ) ; } if ( ! $ url ) { $ url = $ this -> getMallShopUrl ( ) ; } if ( ! $ url ) { $ url = $ this -> getConfigParam ( 'sSSLShopURL' ) ; } if ( ! $ url ) { $... | Returns config sSSLShopURL or sMallSSLShopURL if secondary shop |
36,076 | public function getShopCurrentUrl ( $ lang = null ) { if ( $ this -> isSsl ( ) ) { $ url = $ this -> getSSLShopURL ( $ lang ) ; } else { $ url = $ this -> getShopURL ( $ lang ) ; } return Registry :: getUtilsUrl ( ) -> processUrl ( $ url . 'index.php' , false ) ; } | Returns SSL or not SSL shop URL with index . php and sid |
36,077 | public function getShopHomeUrl ( $ lang = null , $ admin = null ) { return Registry :: getUtilsUrl ( ) -> processUrl ( $ this -> getShopUrl ( $ lang , $ admin ) . 'index.php' , false ) ; } | Returns shop non SSL URL including index . php and sid . |
36,078 | public function getWidgetUrl ( $ languageId = null , $ inAdmin = null , $ urlParameters = [ ] ) { $ utilsUrl = Registry :: getUtilsUrl ( ) ; $ widgetUrl = $ this -> isSsl ( ) ? $ this -> getSslShopUrl ( $ languageId ) : $ this -> getShopUrl ( $ languageId , $ inAdmin ) ; $ widgetUrl = $ utilsUrl -> processUrl ( $ widge... | Returns widget start non SSL URL including widget . php and sid . |
36,079 | public function getShopCurrency ( ) { if ( ( null === ( $ curr = $ this -> getRequestParameter ( 'cur' ) ) ) ) { if ( null === ( $ curr = $ this -> getRequestParameter ( 'currency' ) ) ) { $ curr = $ this -> getSession ( ) -> getVariable ( 'currency' ) ; } } return ( int ) $ curr ; } | Returns active shop currency . |
36,080 | public function getActShopCurrencyObject ( ) { if ( $ this -> _oActCurrencyObject === null ) { $ cur = $ this -> getShopCurrency ( ) ; $ currencies = $ this -> getCurrencyArray ( ) ; if ( ! isset ( $ currencies [ $ cur ] ) ) { $ this -> _oActCurrencyObject = reset ( $ currencies ) ; } else { $ this -> _oActCurrencyObje... | Returns active shop currency object . |
36,081 | public function setActShopCurrency ( $ cur ) { $ currencies = $ this -> getCurrencyArray ( ) ; if ( isset ( $ currencies [ $ cur ] ) ) { $ this -> getSession ( ) -> setVariable ( 'currency' , $ cur ) ; $ this -> _oActCurrencyObject = null ; } } | Sets the actual currency |
36,082 | public function getOutDir ( $ absolute = true ) { if ( $ absolute ) { return $ this -> getConfigParam ( 'sShopDir' ) . $ this -> _sOutDir . '/' ; } else { return $ this -> _sOutDir . '/' ; } } | Returns path to out dir |
36,083 | public function getTranslationsDir ( $ file , $ dir , $ absolute = true ) { $ path = $ absolute ? $ this -> getConfigParam ( 'sShopDir' ) : '' ; $ path .= 'Application/translations/' ; if ( is_readable ( $ path . $ dir . '/' . $ file ) ) { return $ path . $ dir . '/' . $ file ; } return false ; } | Returns path to translations dir |
36,084 | public function getOutUrl ( $ ssl = null , $ admin = null , $ nativeImg = false ) { $ ssl = is_null ( $ ssl ) ? $ this -> isSsl ( ) : $ ssl ; $ admin = is_null ( $ admin ) ? $ this -> isAdmin ( ) : $ admin ; if ( $ ssl ) { if ( $ nativeImg && ! $ admin ) { $ url = $ this -> getSslShopUrl ( ) ; } else { $ url = $ this -... | Returns url to out dir |
36,085 | public function getUrl ( $ file , $ dir , $ admin = null , $ ssl = null , $ nativeImg = false , $ lang = null , $ shop = null , $ theme = null ) { return str_replace ( $ this -> getOutDir ( ) , $ this -> getOutUrl ( $ ssl , $ admin , $ nativeImg ) , $ this -> getDir ( $ file , $ dir , $ admin , $ lang , $ shop , $ them... | Finds and returns file or folder url in out dir |
36,086 | public function getImagePath ( $ file , $ admin = false ) { return $ this -> getDir ( $ file , $ this -> _sImageDir , $ admin ) ; } | Finds and returns image files or folders path |
36,087 | public function getImageUrl ( $ admin = false , $ ssl = null , $ nativeImg = null , $ file = null ) { $ nativeImg = is_null ( $ nativeImg ) ? $ this -> getConfigParam ( 'blNativeImages' ) : $ nativeImg ; return $ this -> getUrl ( $ file , $ this -> _sImageDir , $ admin , $ ssl , $ nativeImg ) ; } | Finds and returns image folder url |
36,088 | public function getPicturePath ( $ file , $ admin = false , $ lang = null , $ shop = null , $ theme = null ) { return $ this -> getDir ( $ file , $ this -> _sPictureDir , $ admin , $ lang , $ shop , $ theme ) ; } | Finds and returns product pictures files or folders path |
36,089 | public function getMasterPictureDir ( $ admin = false ) { return $ this -> getDir ( null , $ this -> _sPictureDir . "/" . $ this -> _sMasterPictureDir , $ admin ) ; } | Finds and returns master pictures folder path |
36,090 | public function getMasterPicturePath ( $ file , $ admin = false ) { return $ this -> getDir ( $ file , $ this -> _sPictureDir . "/" . $ this -> _sMasterPictureDir , $ admin ) ; } | Finds and returns master picture path |
36,091 | public function getPictureUrl ( $ file , $ admin = false , $ ssl = null , $ lang = null , $ shopId = null , $ defPic = "master/nopic.jpg" ) { if ( $ altUrl = Registry :: getPictureHandler ( ) -> getAltImageUrl ( '' , $ file , $ ssl ) ) { return $ altUrl ; } $ nativeImg = $ this -> getConfigParam ( 'blNativeImages' ) ; ... | Finds and returns product picture file or folder url |
36,092 | public function getTemplatePath ( $ templateName , $ isAdmin ) { $ finalTemplatePath = $ this -> getDir ( $ templateName , $ this -> _sTemplateDir , $ isAdmin ) ; if ( ! $ finalTemplatePath ) { $ templatePathCalculator = $ this -> getModuleTemplatePathCalculator ( ) ; $ templatePathCalculator -> setModulesPath ( $ this... | Calculates and returns full path to template . |
36,093 | public function getTemplateUrl ( $ file = null , $ admin = false , $ ssl = null , $ lang = null ) { return $ this -> getShopMainUrl ( ) . $ this -> getDir ( $ file , $ this -> _sTemplateDir , $ admin , $ lang , null , null , false ) ; } | Finds and returns template file or folder url |
36,094 | public function getTemplateBase ( $ admin = false ) { return str_replace ( $ this -> _sTemplateDir . '/' , '' , $ this -> getDir ( null , $ this -> _sTemplateDir , $ admin , null , null , null , false ) ) ; } | Finds and returns base template folder url |
36,095 | public function getModulesDir ( $ absolute = true ) { if ( $ absolute ) { return $ this -> getConfigParam ( 'sShopDir' ) . $ this -> _sModulesDir . '/' ; } else { return $ this -> _sModulesDir . '/' ; } } | Returns path to modules dir |
36,096 | public function getCurrencyArray ( $ currency = null ) { $ confCurrencies = $ this -> getConfigParam ( 'aCurrencies' ) ; if ( ! is_array ( $ confCurrencies ) ) { return [ ] ; } $ currencies = [ ] ; reset ( $ confCurrencies ) ; foreach ( $ confCurrencies as $ key => $ val ) { if ( $ val ) { $ cur = new stdClass ( ) ; $ ... | Returns array of available currencies |
36,097 | public function getCurrencyObject ( $ name ) { $ search = $ this -> getCurrencyArray ( ) ; foreach ( $ search as $ cur ) { if ( $ cur -> name == $ name ) { return $ cur ; } } } | Returns currency object . |
36,098 | public function getPackageInfo ( ) { $ fileName = $ this -> getConfigParam ( 'sShopDir' ) . "/pkg.info" ; $ rev = @ file_get_contents ( $ fileName ) ; $ rev = str_replace ( "\n" , "<br>" , $ rev ) ; if ( ! $ rev ) { return false ; } return $ rev ; } | Returns build package info file content . |
36,099 | public function saveShopConfVar ( $ varType , $ varName , $ varVal , $ shopId = null , $ module = '' ) { switch ( $ varType ) { case 'arr' : case 'aarr' : $ value = serialize ( $ varVal ) ; break ; case 'bool' : $ varVal = ( ( $ varVal == 'true' || $ varVal ) && $ varVal && strcasecmp ( $ varVal , "false" ) ) ; $ value... | Updates or adds new shop configuration parameters to DB . Arrays must be passed not serialized serialized values are supported just for backward compatibility . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.