idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
36,400 | public function oxNew ( $ className ) { $ arguments = func_get_args ( ) ; array_shift ( $ arguments ) ; $ argumentsCount = count ( $ arguments ) ; $ shouldUseCache = $ this -> shouldCacheObject ( $ className , $ arguments ) ; if ( ! \ OxidEsales \ Eshop \ Core \ NamespaceInformationProvider :: isNamespacedClass ( $ cla... | Creates and returns new object . If creation is not available dies and outputs error message . |
36,401 | public function getClassName ( $ classAlias ) { $ classNameProvider = $ this -> getClassNameProvider ( ) ; $ class = $ classNameProvider -> getClassName ( $ classAlias ) ; if ( $ class == $ classAlias ) { $ classAlias = $ classNameProvider -> getClassAliasName ( $ class ) ; } return $ this -> getModuleChainsGenerator (... | Returns name of class file according to class name . |
36,402 | public function render ( ) { parent :: render ( ) ; $ soxId = $ this -> _aViewData [ "oxid" ] = $ this -> getEditObjectId ( ) ; if ( isset ( $ soxId ) && $ soxId != "-1" ) { $ oAttr = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Attribute :: class ) ; $ oAttr -> load ( $ soxId ) ; $ this -> _aViewData [ "edit" ... | Loads Attribute categories info passes it to Smarty engine and returns name of template file attribute_main . tpl . |
36,403 | public function getOnlineLicenseCheck ( ) { if ( ! $ this -> onlineLicenseCheck ) { $ curl = oxNew ( \ OxidEsales \ Eshop \ Core \ Curl :: class ) ; $ emailBuilder = oxNew ( \ OxidEsales \ Eshop \ Core \ OnlineServerEmailBuilder :: class ) ; $ simpleXml = oxNew ( \ OxidEsales \ Eshop \ Core \ SimpleXml :: class ) ; $ l... | OLC dependency getter |
36,404 | protected function getApplicationServerExporter ( ) { $ appServerService = $ this -> getAppServerService ( ) ; return oxNew ( \ OxidEsales \ Eshop \ Core \ Service \ ApplicationServerExporter :: class , $ appServerService ) ; } | ApplicationServerExporter dependency setter |
36,405 | public function getOnlineModuleVersionNotifier ( ) { if ( ! $ this -> onlineModuleVersionNotifier ) { $ curl = oxNew ( \ OxidEsales \ Eshop \ Core \ Curl :: class ) ; $ mailBuilder = oxNew ( \ OxidEsales \ Eshop \ Core \ OnlineServerEmailBuilder :: class ) ; $ simpleXml = oxNew ( \ OxidEsales \ Eshop \ Core \ SimpleXml... | OnlineModuleVersionNotifier dependency getter |
36,406 | protected function validateOnline ( ) { try { $ appServerService = $ this -> getAppServerService ( ) ; if ( $ this -> getConfig ( ) -> isAdmin ( ) ) { $ appServerService -> updateAppServerInformationInAdmin ( ) ; } else { $ appServerService -> updateAppServerInformationInFrontend ( ) ; } if ( $ this -> isSendingShopDat... | Check if shop is valid online . |
36,407 | protected function sendShopInformation ( ) { if ( $ this -> needToSendShopInformation ( ) ) { $ onlineLicenseCheck = $ this -> getOnlineLicenseCheck ( ) ; $ onlineLicenseCheck -> validateShopSerials ( ) ; $ this -> updateNextCheckTime ( ) ; } } | Sends shop information to oxid servers . |
36,408 | private function updateNextCheckTime ( ) { $ hourToCheck = $ this -> getCheckTime ( ) ; $ utilsDate = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) ; $ nextCheckTime = $ utilsDate -> formTime ( 'tomorrow' , $ hourToCheck ) ; $ this -> getConfig ( ) -> saveSystemConfigParameter ( 'str' , 'sOnlineLicenseNext... | Update when shop was checked last time with white noise . White noise is used to separate call time for different shop . |
36,409 | protected function getAppServerService ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ appServerDao = oxNew ( \ OxidEsales \ Eshop \ Core \ Dao \ ApplicationServerDao :: class , $ database , $ config ) ; $ utilsServe... | Gets application server service . |
36,410 | protected function buildEmail ( ) { $ email = $ this -> getEmailObject ( ) ; $ email -> setSubject ( $ this -> getSubject ( ) ) ; $ email -> setRecipient ( $ this -> getRecipient ( ) ) ; $ email -> setFrom ( $ this -> getSender ( ) ) ; $ email -> setBody ( $ this -> getBody ( ) ) ; return $ email ; } | Builds and returns the email object |
36,411 | protected function getShopInfoAddress ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ activeShop = $ config -> getActiveShop ( ) ; return $ activeShop -> getFieldData ( 'oxinfoemail' ) ; } | Returns active shop info email address . |
36,412 | protected function getEmailOriginMessage ( ) { $ lang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) ; $ shopUrl = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sShopURL' ) ; return "<br>" . sprintf ( $ lang -> translateString ( 'SHOP_EMAIL_ORIGIN_MESSAGE' , null , true ) , $ sho... | Returns the message with email origin information . |
36,413 | public function render ( ) { parent :: render ( ) ; $ oArticle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ this -> _aViewData [ "edit" ] = $ oArticle ; $ soxId = $ this -> getEditObjectId ( ) ; if ( isset ( $ soxId ) && $ soxId != "-1" ) { if ( $ oArticle -> isDerived ( ) ) { $ this ->... | Loads article data from DB passes it to Smarty engine returns name of template file article_userdef . tpl . |
36,414 | public function removeDir ( $ sPath , $ blDeleteSuccess , $ iMode = 0 , $ aSkipFiles = [ ] , $ aSkipFolders = [ ] ) { if ( is_file ( $ sPath ) || is_dir ( $ sPath ) ) { $ d = dir ( $ sPath ) ; $ d -> handle ; while ( false !== ( $ sEntry = $ d -> read ( ) ) ) { if ( $ sEntry != "." && $ sEntry != ".." ) { $ sFilePath =... | Recursively removes given path files and folders |
36,415 | protected function _extractPath ( $ aPath ) { $ sExtPath = '' ; $ blBuildPath = false ; for ( $ i = count ( $ aPath ) ; $ i > 0 ; $ i -- ) { $ sDir = $ aPath [ $ i - 1 ] ; if ( $ blBuildPath ) { $ sExtPath = $ sDir . '/' . $ sExtPath ; } if ( stristr ( $ sDir , EditionPathProvider :: SETUP_DIRECTORY ) ) { $ blBuildPath... | Extracts install path |
36,416 | public function updateConfigFile ( $ parameters ) { $ configFile = '' ; $ language = $ this -> getInstance ( "Language" ) ; if ( isset ( $ parameters [ 'sShopDir' ] ) ) { $ configFile = $ parameters [ 'sShopDir' ] . "/config.inc.php" ; } $ this -> handleMissingConfigFileException ( $ configFile ) ; clearstatcache ( ) ;... | Updates config . inc . php file contents . |
36,417 | private function handleMissingConfigFileException ( $ pathToConfigFile ) { if ( ! file_exists ( $ pathToConfigFile ) ) { $ language = $ this -> getLanguageInstance ( ) ; throw new Exception ( sprintf ( $ language -> getText ( 'ERROR_COULD_NOT_OPEN_CONFIG_FILE' ) , $ pathToConfigFile ) ) ; } } | Throws an exception in case config file is missing . |
36,418 | public function updateHtaccessFile ( $ aParams , $ sSubFolder = "" ) { $ oLang = $ this -> getInstance ( "Language" ) ; if ( ! isset ( $ aParams [ "sBaseUrlPath" ] ) || ! $ aParams [ "sBaseUrlPath" ] ) { $ aParams [ "sBaseUrlPath" ] = "" ; } if ( $ sSubFolder ) { $ sSubFolder = $ this -> preparePath ( "/" . $ sSubFolde... | Updates default htaccess file with user defined params |
36,419 | public function canHtaccessFileBeUpdated ( ) { try { $ defaultPathParameters = $ this -> getDefaultPathParams ( ) ; $ defaultPathParameters [ 'sBaseUrlPath' ] = $ this -> extractRewriteBase ( $ defaultPathParameters [ 'sShopURL' ] ) ; $ this -> updateHtaccessFile ( $ defaultPathParameters ) ; } catch ( Exception $ exce... | Returns true if htaccess file can be updated by setup process . |
36,420 | public function getRequestVar ( $ sVarName , $ sRequestType = null ) { $ sValue = null ; switch ( $ sRequestType ) { case 'post' : if ( isset ( $ _POST [ $ sVarName ] ) ) { $ sValue = $ _POST [ $ sVarName ] ; } break ; case 'get' : if ( isset ( $ _GET [ $ sVarName ] ) ) { $ sValue = $ _GET [ $ sVarName ] ; } break ; ca... | Returns variable from request |
36,421 | public function getFileContents ( $ sFile ) { $ sContents = null ; if ( file_exists ( $ sFile ) && is_readable ( $ sFile ) ) { $ sContents = file_get_contents ( $ sFile ) ; } return $ sContents ; } | Returns file contents if file is readable |
36,422 | public function extractRewriteBase ( $ sUrl ) { $ sPath = "/" ; if ( ( $ aPathInfo = @ parse_url ( $ sUrl ) ) !== false ) { if ( isset ( $ aPathInfo [ "path" ] ) ) { $ sPath = $ this -> preparePath ( $ aPathInfo [ "path" ] ) ; } } return $ sPath ; } | Extracts rewrite base path from url |
36,423 | public function executeExternalDatabaseMigrationCommand ( ConsoleOutput $ output = null , Facts $ facts = null ) { $ migrations = $ this -> createMigrations ( $ facts ) ; $ migrations -> setOutput ( $ output ) ; $ command = Migrations :: MIGRATE_COMMAND ; $ migrations -> execute ( $ command ) ; } | Calls external database migration command . |
36,424 | public function checkDbExists ( $ database ) { try { $ databaseExists = true ; $ database -> execSql ( "select * from oxconfig" ) ; } catch ( Exception $ exception ) { $ databaseExists = false ; } return $ databaseExists ; } | Check if database is up and running |
36,425 | public function getActiveEditionDemodataPackagePath ( ) { $ facts = new Facts ( ) ; return $ this -> getVendorDirectory ( ) . EditionRootPathProvider :: EDITIONS_DIRECTORY . DIRECTORY_SEPARATOR . sprintf ( self :: DEMODATA_PACKAGE_NAME , strtolower ( $ facts -> getEdition ( ) ) ) ; } | Return full path to demodata package based on current eShop edition . |
36,426 | public function getLicenseContent ( $ languageId ) { $ licensePathElements = [ $ this -> getSetupDirectory ( ) , ucfirst ( $ languageId ) , self :: LICENSE_TEXT_FILENAME ] ; $ licensePath = implode ( DIRECTORY_SEPARATOR , $ licensePathElements ) ; $ licenseContent = $ this -> getFileContents ( $ licensePath ) ; return ... | Returns the contents of license agreement in requested language . |
36,427 | protected function _executeMaintenanceTasks ( ) { if ( isset ( $ this -> _blMainTasksExecuted ) ) { return ; } startProfile ( 'executeMaintenanceTasks' ) ; oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) -> updateUpcomingPrices ( ) ; stopProfile ( 'executeMaintenanceTasks' ) ; } | Executes regular maintenance functions .. |
36,428 | protected function _initializeViewObject ( $ class , $ function , $ parameters = null , $ viewsChain = null ) { $ classKey = Registry :: getControllerClassNameResolver ( ) -> getIdByClassName ( $ class ) ; $ classKey = ! is_null ( $ classKey ) ? $ classKey : $ class ; $ view = oxNew ( $ class ) ; $ view -> setClassKey ... | Initialize and return view object . |
36,429 | protected function _canExecuteFunction ( $ view , $ function ) { $ canExecute = true ; if ( method_exists ( $ view , $ function ) ) { $ reflectionMethod = new ReflectionMethod ( $ view , $ function ) ; if ( ! $ reflectionMethod -> isPublic ( ) ) { $ canExecute = false ; } } return $ canExecute ; } | Check if method can be executed . |
36,430 | protected function _getFormattedErrors ( $ controllerName ) { $ errors = $ this -> _getErrors ( $ controllerName ) ; $ formattedErrors = [ ] ; if ( is_array ( $ errors ) && count ( $ errors ) ) { foreach ( $ errors as $ location => $ ex2 ) { foreach ( $ ex2 as $ key => $ er ) { $ error = unserialize ( $ er ) ; $ format... | Format error messages from _getErrors and return as array . |
36,431 | protected function _render ( $ view ) { $ smarty = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> getSmarty ( ) ; $ templateName = $ view -> render ( ) ; $ templateFile = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getTemplatePath ( $ templateName , $ this -> isAdmin ( ) ) ; if ( ! file_ex... | Render BaseController object . |
36,432 | protected function _getOutputManager ( ) { if ( ! $ this -> _oOutput ) { $ this -> _oOutput = oxNew ( \ OxidEsales \ Eshop \ Core \ Output :: class ) ; } return $ this -> _oOutput ; } | Return output handler . |
36,433 | protected function _getErrors ( $ currentControllerName ) { if ( null === $ this -> _aErrors ) { $ this -> _aErrors = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( 'Errors' ) ; $ this -> _aControllerErrors = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( 'ErrorCont... | Return page errors array . |
36,434 | protected function _runOnce ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ config -> init ( ) ; error_reporting ( $ this -> _getErrorReportingLevel ( ) ) ; $ runOnceExecuted = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( 'blRunOnceExecuted' ) ; if ( ! $ runOnce... | This function is only executed one time here we perform checks if we only need once per session . |
36,435 | protected function formMonitorMessage ( $ view ) { $ debugInfo = oxNew ( \ OxidEsales \ Eshop \ Core \ DebugInfo :: class ) ; $ debugLevel = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iDebug' ) ; $ message = '' ; if ( $ debugLevel == 4 ) { $ message .= $ debugInfo -> formatTemplateData... | Forms message for displaying monitoring information on the bottom of the page . |
36,436 | protected function _handleCookieException ( $ exception ) { if ( $ this -> _isDebugMode ( ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ exception ) ; } \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> redirect ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( )... | Redirect to start page in debug mode shows error message . |
36,437 | protected function _handleBaseException ( $ exception ) { $ this -> logException ( $ exception ) ; if ( $ this -> _isDebugMode ( ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ exception ) ; $ this -> _process ( 'exceptionError' , 'displayExceptionError' ) ; } } | Handling other not caught exceptions . |
36,438 | protected function reportDatabaseConnectionException ( DatabaseConnectionException $ exception ) { if ( $ this -> messageWasSentWithinThreshold ( ) || $ this -> _isDebugMode ( ) ) { return ; } $ result = $ this -> sendOfflineWarning ( $ exception ) ; if ( $ result ) { file_put_contents ( $ this -> offlineWarningTimesta... | Notify the shop owner about database connection problems . |
36,439 | protected function messageWasSentWithinThreshold ( ) { $ wasSentWithinThreshold = false ; $ threshold = Registry :: get ( \ OxidEsales \ Eshop \ Core \ ConfigFile :: class ) -> getVar ( 'offlineWarningInterval' ) ; if ( file_exists ( $ this -> offlineWarningTimestampFile ) ) { $ lastSentTimestamp = ( int ) file_get_con... | Return true if a message was already sent within a given threshold . |
36,440 | protected function sendOfflineWarning ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException $ exception ) { $ result = false ; $ emailAddress = Registry :: get ( \ OxidEsales \ Eshop \ Core \ ConfigFile :: class ) -> getVar ( 'sAdminEmail' ) ; if ( $ emailAddress ) { $ failedShop = isset ( $ _REQUEST [ 'shp' ] ... | Send an offline warning to the shop owner . Currently an email is sent to the email address configured as sAdminEmail in the eShop config file . |
36,441 | protected function getControllerClass ( $ controllerKey ) { try { $ controllerClass = $ this -> resolveControllerClass ( $ controllerKey ) ; } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ RoutingException $ exception ) { $ this -> handleRoutingException ( $ exception ) ; $ controllerClass = $ controllerKey ; } ret... | Get controller class from key . Fallback is to use key as class if no match can be found . |
36,442 | protected function _canUpdate ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ blIsMallAdmin = \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> getVariable ( 'malladmin' ) ; if ( ! $ blIsMallAdmin ) { return false ; } if ( $ myConfig -> isDemoShop ( ) ) { return false ; } return... | Checks if the license key update is allowed . |
36,443 | protected function _fetchCurVersionInfo ( $ sUrl ) { $ aParams = [ "myversion" => \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getVersion ( ) ] ; $ oLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) ; $ iLang = $ oLang -> getTplLanguage ( ) ; $ sLang = $ oLang -> getLanguageAbbr ( $ iLang ) ; $... | Fetch current shop version information from url |
36,444 | protected function formLocalFileUrl ( $ file ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ parts = explode ( '?' , $ file ) ; $ url = $ config -> getResourceUrl ( $ parts [ 0 ] , $ config -> isAdmin ( ) ) ; $ parameters = $ parts [ 1 ] ; if ( empty ( $ parameters ) ) { $ path = $ config -> ... | Separate query part appends query part if needed append file modification timestamp . |
36,445 | public function setLocatorData ( $ oCurrArticle , $ oLocatorTarget ) { $ sLocfnc = "_set{$this->_sType}LocatorData" ; $ this -> $ sLocfnc ( $ oLocatorTarget , $ oCurrArticle ) ; $ oLocatorTarget -> setListType ( $ this -> _sType ) ; } | Executes locator method according locator type |
36,446 | protected function _setListLocatorData ( $ oLocatorTarget , $ oCurrArticle ) { if ( ( $ oCategory = $ oLocatorTarget -> getActiveCategory ( ) ) ) { $ sOrderBy = $ oLocatorTarget -> getSortingSql ( $ oLocatorTarget -> getSortIdent ( ) ) ; $ oIdList = $ this -> _loadIdsInList ( $ oCategory , $ oCurrArticle , $ sOrderBy )... | Sets details locator data for articles that came from regular list . |
36,447 | protected function _setVendorLocatorData ( $ oLocatorTarget , $ oCurrArticle ) { if ( ( $ oVendor = $ oLocatorTarget -> getActVendor ( ) ) ) { $ sVendorId = $ oVendor -> getId ( ) ; $ myUtils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; $ blSeo = $ myUtils -> seoIsActive ( ) ; $ oIdList = oxNew ( \ OxidEs... | Sets details locator data for articles that came from vendor list . |
36,448 | protected function _setManufacturerLocatorData ( $ oLocatorTarget , $ oCurrArticle ) { if ( ( $ oManufacturer = $ oLocatorTarget -> getActManufacturer ( ) ) ) { $ sManufacturerId = $ oManufacturer -> getId ( ) ; $ myUtils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; $ blSeo = $ myUtils -> seoIsActive ( ) ... | Sets details locator data for articles that came from Manufacturer list . |
36,449 | protected function _setRecommlistLocatorData ( $ oLocatorTarget , $ oCurrArticle ) { if ( ( $ oRecommList = $ oLocatorTarget -> getActiveRecommList ( ) ) ) { $ oIdList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oIdList -> loadRecommArticleIds ( $ oRecommList -> getId ( ) , null ) ... | Sets details locator data for articles that came from recommlist . |
36,450 | protected function _loadIdsInList ( $ oCategory , $ oCurrArticle , $ sOrderBy = null ) { $ oIdList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oIdList -> setCustomSorting ( $ sOrderBy ) ; if ( $ oCategory -> isPriceCategory ( ) ) { $ oIdList -> loadPriceIds ( $ oCategory -> oxcateg... | Setting product position in list amount of articles etc |
36,451 | protected function _makeLink ( $ sLink , $ sParams ) { if ( $ sParams ) { $ sLink .= ( ( strpos ( $ sLink , '?' ) !== false ) ? '&' : '?' ) . $ sParams ; } return $ sLink ; } | Appends urs with currently passed parameters |
36,452 | protected function _findActPageNumber ( $ iPageNr , $ oIdList = null , $ oArticle = null ) { $ iPageNr = ( int ) $ iPageNr ; if ( ! $ iPageNr && $ oIdList && $ oArticle ) { $ iNrofCatArticles = ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iNrofCatArticles' ) ; $ iNrofCatArticles ... | If page number is not passed trying to fetch it from list of ids . To search for position in list article ids list and current article id must be passed |
36,453 | protected function _removeCookies ( ) { $ oUtilsServer = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) ; if ( isset ( $ _SERVER [ 'HTTP_COOKIE' ] ) ) { $ aCookies = explode ( ';' , $ _SERVER [ 'HTTP_COOKIE' ] ) ; foreach ( $ aCookies as $ sCookie ) { $ sRawCookie = explode ( '=' , $ sCookie ) ; $ oUtilsS... | Clears all cookies |
36,454 | public function render ( ) { parent :: render ( ) ; $ oLang = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) ; $ iLang = $ oLang -> getTplLanguage ( ) ; $ oCatTree = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ CategoryList :: class ) ; $ oCatTree -> loadList ( ) ; $ aNewList = [ ] ; $ oRoot = new stdCla... | Loads category tree passes data to Smarty and returns name of template file category_list . tpl . |
36,455 | public function isForeignCountry ( ) { return ! in_array ( $ this -> getId ( ) , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aHomeCountry' ) ) ; } | returns true if this country is a foreign country |
36,456 | public function getStates ( ) { if ( ! is_null ( $ this -> _aStates ) ) { return $ this -> _aStates ; } $ sCountryId = $ this -> getId ( ) ; $ sViewName = getViewName ( "oxstates" , $ this -> getLanguage ( ) ) ; $ sQ = "select * from {$sViewName} where `oxcountryid` = '$sCountryId' order by `oxtitle` " ; $ this -> _aS... | Returns current state list |
36,457 | public function getIdByCode ( $ sCode ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; return $ oDb -> getOne ( "select oxid from oxcountry where oxisoalpha2 = " . $ oDb -> quote ( $ sCode ) ) ; } | Returns country id by code |
36,458 | public function addGroupToSet ( ) { $ aChosenCat = $ this -> _getActionIds ( 'oxgroups.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sGroupTable = $ ... | Adds user group to delivery sets config |
36,459 | private function initializeContainer ( ) { $ cacheFilePath = $ this :: getCacheFilePath ( ) ; if ( file_exists ( $ cacheFilePath ) ) { $ this -> loadContainerFromCache ( $ cacheFilePath ) ; } else { $ this -> getCompiledSymfonyContainer ( ) ; $ this -> saveContainerToCache ( $ cacheFilePath ) ; } } | Loads container from cache if available otherwise create the container from scratch . |
36,460 | private function getCompiledSymfonyContainer ( ) { $ containerBuilder = ( new ContainerBuilderFactory ( ) ) -> create ( ) ; $ this -> symfonyContainer = $ containerBuilder -> getContainer ( ) ; $ this -> symfonyContainer -> compile ( ) ; } | Returns compiled Container |
36,461 | private function saveContainerToCache ( $ cachefile ) { $ dumper = new PhpDumper ( $ this -> symfonyContainer ) ; file_put_contents ( $ cachefile , $ dumper -> dump ( ) ) ; } | Dumps the compiled container to the cachefile . |
36,462 | public static function resetContainer ( ) { if ( file_exists ( self :: getCacheFilePath ( ) ) ) { unlink ( self :: getCacheFilePath ( ) ) ; } self :: $ instance = null ; } | Forces reload of the ContainerFactory on next request . |
36,463 | public function delete ( ) { $ oRemark = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Remark :: class ) ; $ oRemark -> delete ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "rem_oxid" ) ) ; } | Deletes user actions history record . |
36,464 | public function validateNewSerial ( $ serial ) { $ serials = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( "aSerials" ) ; $ serials [ ] = [ 'attributes' => [ 'state' => 'new' ] , 'value' => $ serial ] ; return $ this -> validate ( $ serials ) ; } | The Online shop license check for the new serial is performed . Returns check result . |
36,465 | public function validate ( $ serials ) { $ serials = ( array ) $ serials ; $ this -> setIsException ( false ) ; $ result = false ; try { $ request = $ this -> formRequest ( $ serials ) ; $ caller = $ this -> getCaller ( ) ; $ response = $ caller -> doRequest ( $ request ) ; $ result = $ this -> validateResponse ( $ res... | The Online shop license check is performed . Returns check result . |
36,466 | protected function validateResponse ( $ response ) { if ( isset ( $ response -> code ) && isset ( $ response -> message ) ) { if ( $ response -> code == $ this -> validResponseCode && $ response -> message == $ this -> validResponseMessage ) { $ valid = true ; } else { $ this -> setErrorMessage ( \ OxidEsales \ Eshop \... | Performs a check of the response code and message . |
36,467 | protected function formRequest ( $ serials ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ request = oxNew ( \ OxidEsales \ Eshop \ Core \ OnlineLicenseCheckRequest :: class ) ; $ request -> keys = [ 'key' => $ serials ] ; $ request -> productSpecificInformation = new stdClass ( ) ; if ( ! is... | Builds request object with required parameters . |
36,468 | protected function formCounters ( ) { $ userCounter = $ this -> getUserCounter ( ) ; $ counters = [ ] ; if ( ! is_null ( $ this -> getUserCounter ( ) ) ) { $ counters [ ] = [ 'name' => 'admin users' , 'value' => $ userCounter -> getAdminCount ( ) , ] ; $ counters [ ] = [ 'name' => 'active admin users' , 'value' => $ us... | Forms shop counters array for sending to OXID server . |
36,469 | protected function logSuccess ( ) { $ time = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ; $ baseShop = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getBaseShopId ( ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> saveShopConfVar ( "str" , \ OxidEsales \ Eshop \... | Registers the latest Successful Online License check . |
36,470 | public function send ( ) { $ blError = true ; if ( ( $ sOxid = $ this -> getEditObjectId ( ) ) ) { $ oPricealarm = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ PriceAlarm :: class ) ; $ oPricealarm -> load ( $ sOxid ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter (... | Sending email to selected customer |
36,471 | protected function getActivePriceAlarmsCount ( ) { $ query = " SELECT oxarticles.oxid, oxpricealarm.oxprice FROM oxpricealarm, oxarticles WHERE oxarticles.oxid = oxpricealarm.oxartid AND oxpricealarm.oxsended = '000-00-00 00:00:00'" ; $ result = \ OxidEsales \ Eshop \ Core \ DatabasePro... | Returns number of active price alarms . |
36,472 | public function generate ( ) { if ( $ this -> _getOpenSSLFunctionalityChecker ( ) -> isOpenSslRandomBytesGeneratorAvailable ( ) ) { $ sSalt = bin2hex ( openssl_random_pseudo_bytes ( 16 ) ) ; } else { $ sSalt = $ this -> _customSaltGenerator ( ) ; } return $ sSalt ; } | Generates salt . If openssl_random_pseudo_bytes function is not available than fallback to custom salt generator . |
36,473 | protected function _customSaltGenerator ( ) { $ sHash = '' ; $ sSalt = '' ; for ( $ i = 0 ; $ i < 32 ; $ i ++ ) { $ sHash = hash ( 'sha256' , $ sHash . mt_rand ( ) ) ; $ iPosition = mt_rand ( 0 , 62 ) ; $ sSalt .= $ sHash [ $ iPosition ] ; } return $ sSalt ; } | Generates custom salt . |
36,474 | public function loadCurrent ( ) { $ sViewName = $ this -> getBaseObject ( ) -> getViewName ( ) ; $ sDate = date ( 'Y-m-d H:i:s' , \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = "select * from {$sViewName} where o... | Loads current promotions |
36,475 | protected function _getUserGroupFilter ( $ oUser = null ) { $ oUser = ( $ oUser == null ) ? $ this -> getUser ( ) : $ oUser ; $ sTable = getViewName ( 'oxactions' ) ; $ sGroupTable = getViewName ( 'oxgroups' ) ; $ aIds = [ ] ; if ( $ oUser && count ( $ aGroupIds = $ oUser -> getUserGroups ( ) ) ) { foreach ( $ aGroupId... | Returns part of user group filter query |
36,476 | protected function fetchExistsActivePromotion ( ) { $ query = "select 1 from " . getViewName ( 'oxactions' ) . " where oxtype=2 and oxactive=1 and oxshopid='" . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) . "' limit 1" ; return \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> ... | Fetch the information if there is an active promotion . |
36,477 | public function loadBanners ( ) { $ oBaseObject = $ this -> getBaseObject ( ) ; $ oViewName = $ oBaseObject -> getViewName ( ) ; $ sQ = "select * from {$oViewName} where oxtype=3 and " . $ oBaseObject -> getSqlActiveSnippet ( ) . " and oxshopid='" . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId (... | load active shop banner list |
36,478 | public function findAll ( ) { $ appServerList = [ ] ; $ resultList = $ this -> selectAllData ( ) ; if ( $ resultList != false && $ resultList -> count ( ) > 0 ) { $ result = $ resultList -> getFields ( ) ; $ serverId = $ this -> getServerIdFromConfig ( $ result [ 'oxvarname' ] ) ; $ information = $ this -> getValueFrom... | Finds all application servers . |
36,479 | public function delete ( $ id ) { unset ( $ this -> appServer [ $ id ] ) ; $ query = "DELETE FROM oxconfig WHERE oxvarname = ? and oxshopid = ?" ; $ parameter = [ self :: CONFIG_NAME_FOR_SERVER_INFO . $ id , $ this -> config -> getBaseShopId ( ) ] ; $ this -> database -> execute ( $ query , $ parameter ) ; } | Deletes the entity with the given id . |
36,480 | public function findAppServer ( $ id ) { if ( ! isset ( $ this -> appServer [ $ id ] ) ) { $ serverData = $ this -> selectDataById ( $ id ) ; if ( $ serverData != false ) { $ appServerProperties = ( array ) unserialize ( $ serverData ) ; } else { return null ; } $ this -> appServer [ $ id ] = $ this -> createServer ( $... | Finds an application server by given id null if none is found . |
36,481 | public function save ( $ appServer ) { $ id = $ appServer -> getId ( ) ; if ( $ this -> findAppServer ( $ id ) ) { $ this -> update ( $ appServer ) ; unset ( $ this -> appServer [ $ id ] ) ; } else { $ this -> insert ( $ appServer ) ; } } | Updates or insert the given entity . |
36,482 | protected function update ( $ appServer ) { $ query = "UPDATE oxconfig SET oxvarvalue=ENCODE( ?, ?) WHERE oxvarname = ? and oxshopid = ?" ; $ parameter = [ $ this -> convertAppServerToConfigOption ( $ appServer ) , $ this -> config -> getConfigParam ( 'sConfigKey' ) , self :: CONFIG_NAME_FOR_SERVER_INFO . $ appServer -... | Updates the given entity . |
36,483 | protected function insert ( $ appServer ) { $ query = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue) values(?, ?, '', ?, ?, ENCODE( ?, ?) )" ; $ parameter = [ \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) -> generateUID ( ) , $ this -> config -> getBaseSh... | Insert new application server entity . |
36,484 | private function getServerIdFromConfig ( $ varName ) { $ constNameLength = strlen ( self :: CONFIG_NAME_FOR_SERVER_INFO ) ; $ id = substr ( $ varName , $ constNameLength ) ; return $ id ; } | Parses config option name to get the server id . |
36,485 | protected function createServer ( $ data ) { $ appServer = oxNew ( \ OxidEsales \ Eshop \ Core \ DataObject \ ApplicationServer :: class ) ; $ appServer -> setId ( $ this -> getServerParameter ( $ data , 'id' ) ) ; $ appServer -> setTimestamp ( $ this -> getServerParameter ( $ data , 'timestamp' ) ) ; $ appServer -> se... | Creates ApplicationServer from given server id and data . |
36,486 | private function convertAppServerToConfigOption ( $ appServer ) { $ serverData = [ 'id' => $ appServer -> getId ( ) , 'timestamp' => $ appServer -> getTimestamp ( ) , 'ip' => $ appServer -> getIp ( ) , 'lastFrontendUsage' => $ appServer -> getLastFrontendUsage ( ) , 'lastAdminUsage' => $ appServer -> getLastAdminUsage ... | Convert ApplicationServer object into simple array for saving into database oxconfig table . |
36,487 | public function getPath ( ) { if ( is_null ( $ this -> moduleId ) || is_null ( $ this -> fileName ) ) { throw oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException :: class ) ; } $ fileName = $ this -> fileName ; if ( basename ( $ fileName ) === $ fileName ) { if ( substr ( $ fileName , - 4 ) !== '.tpl' )... | Return full path to module file which defines content to place in Shop block . |
36,488 | protected function getModuleExtensionsGarbage ( $ moduleMetaDataExtensions , $ moduleInstalledExtensions ) { $ garbage = $ moduleInstalledExtensions ; foreach ( $ garbage as $ installedClassName => $ installedClassPaths ) { if ( isset ( $ moduleMetaDataExtensions [ $ installedClassName ] ) ) { $ metaDataExtensionPaths ... | Returns extension which is no longer in metadata - garbage |
36,489 | protected function removeGarbage ( $ installedExtensions , $ garbage ) { foreach ( $ garbage as $ className => $ classPaths ) { foreach ( $ classPaths as $ sClassPath ) { if ( isset ( $ installedExtensions [ $ className ] ) ) { unset ( $ installedExtensions [ $ className ] [ array_search ( $ sClassPath , $ installedExt... | Removes garbage - not exiting module extensions returns clean array of installed extensions |
36,490 | public static function autoload ( $ class ) { if ( false !== strpos ( $ class , 'OxidEsales\Eshop\\' ) ) { return false ; } $ unifiedNamespaceClassName = static :: getUnifiedNamespaceClassForBcAlias ( $ class ) ; if ( ! empty ( $ unifiedNamespaceClassName ) ) { static :: forceBackwardsCompatiblityClassLoading ( $ unifi... | Autoload method . |
36,491 | private static function getUnifiedNamespaceClassForBcAlias ( $ bcAlias ) { $ classMap = static :: getBackwardsCompatibilityClassMap ( ) ; $ bcAlias = strtolower ( $ bcAlias ) ; $ result = isset ( $ classMap [ $ bcAlias ] ) ? $ classMap [ $ bcAlias ] : "" ; return $ result ; } | Return the name of a Unified Namespace class for a given backwards compatible class |
36,492 | public function call ( \ OxidEsales \ Eshop \ Core \ OnlineRequest $ oRequest ) { $ sOutputXml = null ; $ iFailedCallsCount = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getSystemConfigParameter ( 'iFailedOnlineCallsCount' ) ; try { $ sXml = $ this -> _formXMLRequest ( $ oRequest ) ; $ sOutputXml = $ thi... | Makes curl call with given parameters to given url . |
36,493 | private function _executeCurlCall ( $ sUrl , $ sXml ) { $ oCurl = $ this -> _getCurl ( ) ; $ oCurl -> setMethod ( 'POST' ) ; $ oCurl -> setUrl ( $ sUrl ) ; $ oCurl -> setParameters ( [ 'xmlRequest' => $ sXml ] ) ; $ oCurl -> setOption ( \ OxidEsales \ Eshop \ Core \ Curl :: EXECUTION_TIMEOUT_OPTION , static :: CURL_EXE... | Executes CURL call with given parameters . |
36,494 | private function loadProjectServices ( SymfonyContainerBuilder $ symfonyContainer ) { try { $ this -> cleanupProjectYaml ( ) ; $ loader = new YamlFileLoader ( $ symfonyContainer , new FileLocator ( ) ) ; $ loader -> load ( $ this -> context -> getGeneratedProjectFilePath ( ) ) ; } catch ( FileLocatorFileNotFoundExcepti... | Loads a project . yaml file if it can be found in the shop directory . |
36,495 | public function getEntryMetaData ( $ sMetaType ) { return $ this -> _getEncoder ( ) -> getMetaData ( $ this -> getEditObjectId ( ) , $ sMetaType , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) , $ this -> getEditLang ( ) ) ; } | Returns object seo data |
36,496 | protected function _getStdUrl ( $ sOxid ) { if ( $ sType = $ this -> _getType ( ) ) { $ oObject = oxNew ( $ sType ) ; if ( $ oObject -> load ( $ sOxid ) ) { return $ oObject -> getBaseStdLink ( $ this -> getEditLang ( ) , true , false ) ; } } } | Returns objects std url |
36,497 | public function getOxMessage ( ) { if ( $ this -> _blDebug ) { return $ this ; } else { $ sString = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> translateString ( $ this -> _sMessage ) ; if ( ! empty ( $ this -> _aMessageArgs ) ) { $ sString = vsprintf ( $ sString , $ this -> _aMessageArgs ) ; } return $ sS... | Returns translated exception message |
36,498 | private function removeEmptySections ( ) { $ sections = [ $ this :: IMPORTS_SECTION , $ this :: SERVICE_SECTION ] ; foreach ( $ sections as $ section ) { if ( array_key_exists ( $ section , $ this -> configArray ) && ( ! $ this -> configArray [ $ section ] || ! count ( $ this -> configArray [ $ section ] ) ) ) { unset ... | Removes section entries when they are empty |
36,499 | public function removeManufacturer ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ articleIds = $ this -> _getActionIds ( 'oxarticles.oxid' ) ; $ manufacturerId = $ config -> getRequestParameter ( 'oxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter... | Removes article from Manufacturer config |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.