idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
37,300 | public function getPhpSelection ( ) { $ aPhpIniParams = [ 'allow_url_fopen' , 'display_errors' , 'file_uploads' , 'max_execution_time' , 'memory_limit' , 'post_max_size' , 'register_globals' , 'upload_max_filesize' , ] ; $ aPhpIniConf = [ ] ; foreach ( $ aPhpIniParams as $ sParam ) { $ sValue = ini_get ( $ sParam ) ; $ aPhpIniConf [ $ sParam ] = $ sValue ; } return $ aPhpIniConf ; } | Picks some pre - selected PHP configuration settings and returns them . |
37,301 | protected function _getVirtualizationSystem ( ) { $ sSystemType = '' ; if ( $ this -> isExecAllowed ( ) ) { @ $ sDeviceList = $ this -> _getDeviceList ( 'vmware' ) ; if ( $ sDeviceList ) { $ sSystemType = 'VMWare' ; unset ( $ sDeviceList ) ; } @ $ sDeviceList = $ this -> _getDeviceList ( 'VirtualBox' ) ; if ( $ sDeviceList ) { $ sSystemType = 'VirtualBox' ; unset ( $ sDeviceList ) ; } } return $ sSystemType ; } | Tries to find out which VM is used |
37,302 | protected function _getMySqlServerInfo ( ) { $ aResult = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) -> getRow ( "SHOW VARIABLES LIKE 'version'" ) ; return $ aResult [ 'Value' ] ; } | Returns MySQL server Information |
37,303 | protected function _getList ( $ oUser = null , $ sCountryId = null ) { if ( $ oUser === null ) { $ oUser = $ this -> getUser ( ) ; } else { $ this -> setUser ( $ oUser ) ; } $ sUserId = $ oUser ? $ oUser -> getId ( ) : '' ; if ( $ sUserId !== $ this -> _sUserId || $ sCountryId !== $ this -> _sCountryId ) { if ( ! $ sCountryId ) { if ( $ oUser ) { $ sCountryId = $ oUser -> getActiveCountry ( ) ; } else { $ sCountryId = $ this -> _sHomeCountry ; } } $ this -> selectString ( $ this -> _getFilterSelect ( $ oUser , $ sCountryId ) ) ; $ this -> _sUserId = $ sUserId ; $ this -> _sCountryId = $ sCountryId ; } $ this -> rewind ( ) ; return $ this ; } | Returns active delivery set list |
37,304 | protected function _getFilterSelect ( $ oUser , $ sCountryId ) { $ sTable = getViewName ( 'oxdeliveryset' ) ; $ sQ = "select $sTable.* from $sTable " ; $ sQ .= "where " . $ this -> getBaseObject ( ) -> getSqlActiveSnippet ( ) . ' ' ; $ sUserId = null ; $ aGroupIds = [ ] ; if ( $ oUser ) { $ sUserId = $ oUser -> getId ( ) ; $ aGroupIds = $ oUser -> getUserGroups ( ) ; } $ aIds = [ ] ; if ( count ( $ aGroupIds ) ) { foreach ( $ aGroupIds as $ oGroup ) { $ aIds [ ] = $ oGroup -> getId ( ) ; } } $ sUserTable = getViewName ( 'oxuser' ) ; $ sGroupTable = getViewName ( 'oxgroups' ) ; $ sCountryTable = getViewName ( 'oxcountry' ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sCountrySql = $ sCountryId ? "EXISTS(select oxobject2delivery.oxid from oxobject2delivery where oxobject2delivery.oxdeliveryid=$sTable.OXID and oxobject2delivery.oxtype='oxdelset' and oxobject2delivery.OXOBJECTID=" . $ oDb -> quote ( $ sCountryId ) . ")" : '0' ; $ sUserSql = $ sUserId ? "EXISTS(select oxobject2delivery.oxid from oxobject2delivery where oxobject2delivery.oxdeliveryid=$sTable.OXID and oxobject2delivery.oxtype='oxdelsetu' and oxobject2delivery.OXOBJECTID=" . $ oDb -> quote ( $ sUserId ) . ")" : '0' ; $ sGroupSql = count ( $ aIds ) ? "EXISTS(select oxobject2delivery.oxid from oxobject2delivery where oxobject2delivery.oxdeliveryid=$sTable.OXID and oxobject2delivery.oxtype='oxdelsetg' and oxobject2delivery.OXOBJECTID in (" . implode ( ', ' , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aIds ) ) . ") )" : '0' ; $ sQ .= "and ( select if(EXISTS(select 1 from oxobject2delivery, $sCountryTable where $sCountryTable.oxid=oxobject2delivery.oxobjectid and oxobject2delivery.oxdeliveryid=$sTable.OXID and oxobject2delivery.oxtype='oxdelset' LIMIT 1), $sCountrySql, 1) && if(EXISTS(select 1 from oxobject2delivery, $sUserTable where $sUserTable.oxid=oxobject2delivery.oxobjectid and oxobject2delivery.oxdeliveryid=$sTable.OXID and oxobject2delivery.oxtype='oxdelsetu' LIMIT 1), $sUserSql, 1) && if(EXISTS(select 1 from oxobject2delivery, $sGroupTable where $sGroupTable.oxid=oxobject2delivery.oxobjectid and oxobject2delivery.oxdeliveryid=$sTable.OXID and oxobject2delivery.oxtype='oxdelsetg' LIMIT 1), $sGroupSql, 1) )" ; $ sQ .= " order by $sTable.oxpos" ; return $ sQ ; } | Creates delivery set list filter SQL to load current state delivery set list |
37,305 | public function getDeliverySetList ( $ oUser , $ sCountryId , $ sDelSet = null ) { $ this -> _getList ( $ oUser , $ sCountryId ) ; $ aList = $ this -> _aArray ; if ( $ sDelSet && isset ( $ aList [ $ sDelSet ] ) ) { $ oDelSet = $ aList [ $ sDelSet ] ; unset ( $ aList [ $ sDelSet ] ) ; $ aList = array_merge ( [ $ sDelSet => $ oDelSet ] , $ aList ) ; } return $ aList ; } | Creates current state delivery set list |
37,306 | public function loadRDFaDeliverySetList ( $ sDelId = null ) { $ sTable = getViewName ( 'oxdeliveryset' ) ; if ( $ sDelId ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sSubSql = "( select $sTable.* from $sTable left join oxdel2delset on oxdel2delset.oxdelsetid=$sTable.oxid where " . $ this -> getBaseObject ( ) -> getSqlActiveSnippet ( ) . " and oxdel2delset.oxdelid = " . $ oDb -> quote ( $ sDelId ) . " ) as $sTable" ; } else { $ sSubSql = $ sTable ; } $ sQ = "select $sTable.*, oxobject2delivery.oxobjectid from $sSubSql left join (select oxobject2delivery.* from oxobject2delivery where oxobject2delivery.oxtype = 'rdfadeliveryset' ) as oxobject2delivery on oxobject2delivery.oxdeliveryid=$sTable.oxid where " . $ this -> getBaseObject ( ) -> getSqlActiveSnippet ( ) . " " ; $ this -> selectString ( $ sQ ) ; } | Loads delivery set mapped to a predefined GoodRelations delivery method . |
37,307 | public function handleUncaughtException ( \ Throwable $ exception ) { try { Registry :: getLogger ( ) -> error ( $ exception -> getMessage ( ) , [ $ exception ] ) ; } catch ( \ Throwable $ loggerException ) { } if ( $ this -> _iDebug || defined ( 'OXID_PHP_UNIT' ) ) { throw $ exception ; } else { $ this -> displayOfflinePage ( ) ; $ this -> exitApplication ( ) ; } } | Handler for uncaught exceptions . As this is the las resort no fancy business logic should be applied here . |
37,308 | public function handleDatabaseException ( \ OxidEsales \ Eshop \ Core \ Exception \ DatabaseException $ exception ) { $ this -> handleUncaughtException ( $ exception ) ; } | Report the exception and in case that iDebug is not set redirect to maintenance page . Special methods are used here as the normal exception handling routines always need a database connection and this would create a loop . |
37,309 | protected function _getAllViews ( ) { if ( empty ( $ this -> _aAllViews ) ) { $ this -> _aAllViews = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> getCol ( "SHOW TABLES LIKE 'oxv\_%'" ) ; } return $ this -> _aAllViews ; } | Returns list of all shop views |
37,310 | protected function _isCurrentShopView ( $ sViewName ) { $ blResult = false ; $ blEndsWithShopId = preg_match ( "/[_]([0-9]+)$/" , $ sViewName , $ aMatchEndsWithShopId ) ; $ blContainsShopId = preg_match ( "/[_]([0-9]+)[_]/" , $ sViewName , $ aMatchContainsShopId ) ; if ( ( ! $ blEndsWithShopId && ! $ blContainsShopId ) || ( $ blEndsWithShopId && $ aMatchEndsWithShopId [ 1 ] == $ this -> getShopId ( ) ) || ( $ blContainsShopId && $ aMatchContainsShopId [ 1 ] == $ this -> getShopId ( ) ) ) { $ blResult = true ; } return $ blResult ; } | Checks if given view name belongs to current subshop or is general view |
37,311 | protected function _getShopViews ( ) { if ( empty ( $ this -> _aShopViews ) ) { $ this -> _aShopViews = [ ] ; $ aAllViews = $ this -> _getAllViews ( ) ; foreach ( $ aAllViews as $ sView ) { if ( $ this -> _isCurrentShopView ( $ sView ) ) { $ this -> _aShopViews [ ] = $ sView ; } } } return $ this -> _aShopViews ; } | Returns list of shop specific views currently in database |
37,312 | protected function _getValidShopViews ( ) { if ( empty ( $ this -> _aValidShopViews ) ) { $ aTables = $ this -> getShopTables ( ) ; $ this -> _aValidShopViews = [ ] ; foreach ( $ aTables as $ sTable ) { $ this -> prepareShopTableViewNames ( $ sTable ) ; } } return $ this -> _aValidShopViews ; } | Returns list of valid shop views |
37,313 | public function getInvalidViews ( ) { $ aInvalidViews = [ ] ; $ aShopViews = $ this -> _getShopViews ( ) ; foreach ( $ aShopViews as $ sView ) { if ( ! $ this -> _isViewValid ( $ sView ) ) { $ aInvalidViews [ ] = $ sView ; } } return $ aInvalidViews ; } | Returns list of invalid views |
37,314 | public function processRequest ( $ function = null ) { if ( $ function ) { $ this -> $ function ( ) ; $ this -> dispatchEvent ( new AfterRequestProcessedEvent ) ; } else { $ sQAdd = $ this -> _getQuery ( ) ; $ sQ = $ this -> _getDataQuery ( $ sQAdd ) ; $ sCountQ = $ this -> _getCountQuery ( $ sQAdd ) ; $ this -> _outputResponse ( $ this -> _getData ( $ sCountQ , $ sQ ) ) ; } } | AJAX call processor function |
37,315 | protected function _getSortCol ( ) { $ aVisibleNames = $ this -> _getVisibleColNames ( ) ; $ iCol = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'sort' ) ; $ iCol = $ iCol ? ( ( int ) str_replace ( '_' , '' , $ iCol ) ) : 0 ; $ iCol = ( ! isset ( $ aVisibleNames [ $ iCol ] ) ) ? 0 : $ iCol ; return $ iCol ; } | Returns column id to sort |
37,316 | protected function _getColNames ( $ sId = null ) { if ( $ sId === null ) { $ sId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'cmpid' ) ; } if ( $ sId && isset ( $ this -> _aColumns [ $ sId ] ) ) { return $ this -> _aColumns [ $ sId ] ; } return $ this -> _aColumns ; } | Returns array of cotainer DB cols which must be loaded . If id is not passed - all possible containers cols will be returned |
37,317 | protected function _getIdentColNames ( ) { $ aColNames = $ this -> _getColNames ( ) ; $ aCols = [ ] ; foreach ( $ aColNames as $ iKey => $ aCol ) { if ( $ aCol [ 4 ] ) { $ aCols [ $ iKey ] = $ aCol ; } } return $ aCols ; } | Returns array of identifiers which are used as identifiers for specific actions in AJAX and further in this processor class |
37,318 | protected function _getVisibleColNames ( ) { $ aColNames = $ this -> _getColNames ( ) ; $ aUserCols = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'aCols' ) ; $ aVisibleCols = [ ] ; if ( is_array ( $ aUserCols ) ) { foreach ( $ aUserCols as $ iKey => $ sCol ) { $ iCol = ( int ) str_replace ( '_' , '' , $ sCol ) ; if ( isset ( $ aColNames [ $ iCol ] ) && ! $ aColNames [ $ iCol ] [ 4 ] ) { $ aVisibleCols [ $ iCol ] = $ aColNames [ $ iCol ] ; } } } if ( ! count ( $ aVisibleCols ) ) { foreach ( $ aColNames as $ sName => $ aCol ) { if ( $ aCol [ 1 ] && ! $ aColNames [ $ sName ] [ 4 ] ) { $ aVisibleCols [ $ sName ] = $ aCol ; } } } return $ aVisibleCols ; } | Returns array of col names which are requested by AJAX call and will be fetched from DB |
37,319 | protected function _getQueryCols ( ) { $ sQ = $ this -> _buildColsQuery ( $ this -> _getVisibleColNames ( ) , false ) . ", " ; $ sQ .= $ this -> _buildColsQuery ( $ this -> _getIdentColNames ( ) ) ; return " $sQ " ; } | Formats and returns chunk of SQL query string with definition of fields to load from DB |
37,320 | protected function _buildColsQuery ( $ aIdentCols , $ blIdentCols = true ) { $ sQ = '' ; foreach ( $ aIdentCols as $ iCnt => $ aCol ) { if ( $ sQ ) { $ sQ .= ', ' ; } $ sViewTable = $ this -> _getViewName ( $ aCol [ 1 ] ) ; if ( ! $ blIdentCols && $ this -> _isExtendedColumn ( $ aCol [ 0 ] ) ) { $ sQ .= $ this -> _getExtendedColQuery ( $ sViewTable , $ aCol [ 0 ] , $ iCnt ) ; } else { $ sQ .= $ sViewTable . '.' . $ aCol [ 0 ] . ' as _' . $ iCnt ; } } return $ sQ ; } | Builds column selection query |
37,321 | protected function _getLimit ( $ iStart ) { $ iLimit = ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "results" ) ; $ iLimit = $ iLimit ? $ iLimit : $ this -> _iSqlLimit ; return " limit $iStart, $iLimit " ; } | Returns part of SQL query for limiting number of entries from DB |
37,322 | protected function _getFilter ( ) { $ sQ = '' ; $ oConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ aFilter = $ oConfig -> getRequestParameter ( 'aFilter' ) ; if ( is_array ( $ aFilter ) && count ( $ aFilter ) ) { $ aCols = $ this -> _getVisibleColNames ( ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ oStr = getStr ( ) ; foreach ( $ aFilter as $ sCol => $ sValue ) { if ( $ sValue === '' ) { continue ; } $ iCol = ( int ) str_replace ( '_' , '' , $ sCol ) ; if ( isset ( $ aCols [ $ iCol ] ) ) { if ( $ sQ ) { $ sQ .= ' and ' ; } $ sValue = str_replace ( [ '%' , '_' ] , [ '\%' , '\_' ] , $ sValue ) ; $ sValue = $ oStr -> preg_replace ( '/^\*/' , '%' , $ sValue ) ; $ sQ .= $ this -> _getViewName ( $ aCols [ $ iCol ] [ 1 ] ) . '.' . $ aCols [ $ iCol ] [ 0 ] ; $ sQ .= ' like ' . $ oDb -> Quote ( '%' . $ sValue . '%' ) . ' ' ; } } } return $ sQ ; } | Returns part of SQL query for filtering DB data |
37,323 | protected function _getAll ( $ sQ ) { $ aReturn = [ ] ; $ rs = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> select ( $ sQ ) ; if ( $ rs != false && $ rs -> count ( ) > 0 ) { while ( ! $ rs -> EOF ) { $ aReturn [ ] = $ rs -> fields [ 0 ] ; $ rs -> fetchRow ( ) ; } } return $ aReturn ; } | Returns DB records as plain indexed array |
37,324 | protected function _getSortDir ( ) { $ sDir = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'dir' ) ; if ( ! in_array ( $ sDir , $ this -> _aPosDir ) ) { $ sDir = $ this -> _aPosDir [ 0 ] ; } return $ sDir ; } | Checks user input and returns SQL sorting direction key |
37,325 | protected function _getTotalCount ( $ sQ ) { return ( int ) \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) -> getOne ( $ sQ ) ; } | Returns amount of records which can be found according to passed SQL query |
37,326 | protected function _getViewName ( $ sTable ) { return getViewName ( $ sTable , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'editlanguage' ) ) ; } | Return the view name of the given table if a view exists otherwise the table name itself |
37,327 | protected function _getData ( $ sCountQ , $ sQ ) { $ sQ = $ this -> _addFilter ( $ sQ ) ; $ sCountQ = $ this -> _addFilter ( $ sCountQ ) ; $ aResponse [ 'startIndex' ] = $ iStart = $ this -> _getStartIndex ( ) ; $ aResponse [ 'sort' ] = '_' . $ this -> _getSortCol ( ) ; $ aResponse [ 'dir' ] = $ this -> _getSortDir ( ) ; $ iDebug = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iDebug' ) ; if ( $ iDebug ) { $ aResponse [ 'countsql' ] = $ sCountQ ; } $ aResponse [ 'records' ] = [ ] ; if ( ( $ iTotal = $ this -> _getTotalCount ( $ sCountQ ) ) ) { $ sQ .= $ this -> _getSorting ( ) ; $ sQ .= $ this -> _getLimit ( $ iStart ) ; if ( $ iDebug ) { $ aResponse [ 'datasql' ] = $ sQ ; } $ aResponse [ 'records' ] = $ this -> _getDataFields ( $ sQ ) ; } $ aResponse [ 'totalRecords' ] = $ iTotal ; return $ aResponse ; } | Formats data array which later will be processed by _outputResponse method |
37,328 | public function resetArtSeoUrl ( $ aArtIds , $ aCatIds = null ) { if ( empty ( $ aArtIds ) ) { return ; } if ( ! is_array ( $ aArtIds ) ) { $ aArtIds = [ $ aArtIds ] ; } $ sShopId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ; foreach ( $ aArtIds as $ sArtId ) { \ OxidEsales \ Eshop \ Core \ Registry :: getSeoEncoder ( ) -> markAsExpired ( $ sArtId , $ sShopId , 1 , null , "oxtype='oxarticle'" ) ; } } | Marks article seo url as expired |
37,329 | public function resetCounter ( $ sCounterType , $ sValue = null ) { $ blDeleteCacheOnLogout = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'blClearCacheOnLogout' ) ; if ( ! $ blDeleteCacheOnLogout ) { $ myUtilsCount = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsCount ( ) ; switch ( $ sCounterType ) { case 'priceCatArticle' : $ myUtilsCount -> resetPriceCatArticleCount ( $ sValue ) ; break ; case 'catArticle' : $ myUtilsCount -> resetCatArticleCount ( $ sValue ) ; break ; case 'vendorArticle' : $ myUtilsCount -> resetVendorArticleCount ( $ sValue ) ; break ; case 'manufacturerArticle' : $ myUtilsCount -> resetManufacturerArticleCount ( $ sValue ) ; break ; } $ this -> _resetContentCache ( ) ; } } | Resets counters values from cache . Resets price category articles category articles vendor articles manufacturer articles count . |
37,330 | public function addme ( ) { $ oUser = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ User :: class ) ; if ( $ oUser -> load ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'uid' ) ) ) { $ sConfirmCode = md5 ( $ oUser -> oxuser__oxusername -> value . $ oUser -> oxuser__oxpasssalt -> value ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'confirm' ) == $ sConfirmCode ) { $ oUser -> getNewsSubscription ( ) -> setOptInStatus ( 1 ) ; $ oUser -> addToGroup ( 'oxidnewsletter' ) ; $ this -> _iNewsletterStatus = 2 ; } } } | Loads user and Adds him to newsletter group . |
37,331 | public function removeme ( ) { $ oUser = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ User :: class ) ; if ( $ oUser -> load ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'uid' ) ) ) { $ oUser -> getNewsSubscription ( ) -> setOptInStatus ( 0 ) ; $ oUser -> removeFromGroup ( 'oxidnewsletter' ) ; $ this -> _iNewsletterStatus = 3 ; } } | Loads user and removes him from newsletter group . |
37,332 | public function getTopStartActionArticles ( ) { if ( $ this -> _oActionArticles === null ) { $ this -> _oActionArticles = false ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadAktion' ) ) { $ oArtList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ ArticleList :: class ) ; $ oArtList -> loadActionArticles ( 'OXTOPSTART' ) ; if ( $ oArtList -> count ( ) ) { $ this -> _oTopArticle = $ oArtList -> current ( ) ; $ this -> _oActionArticles = $ oArtList ; } } } return $ this -> _oActionArticles ; } | Template variable getter . Returns action articlelist |
37,333 | public function getTopStartArticle ( ) { if ( $ this -> _oTopArticle === null ) { $ this -> _oTopArticle = false ; if ( $ this -> getTopStartActionArticles ( ) ) { return $ this -> _oTopArticle ; } } return $ this -> _oTopArticle ; } | Template variable getter . Returns top start article |
37,334 | public function getHomeCountryId ( ) { if ( $ this -> _sHomeCountryId === null ) { $ this -> _sHomeCountryId = false ; $ aHomeCountry = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'aHomeCountry' ) ; if ( is_array ( $ aHomeCountry ) ) { $ this -> _sHomeCountryId = current ( $ aHomeCountry ) ; } } return $ this -> _sHomeCountryId ; } | Template variable getter . Returns country id |
37,335 | public function getEmos ( ) { if ( $ this -> _oEmos === null ) { $ this -> _oEmos = new Emos ( $ this -> _getScriptPath ( ) ) ; $ this -> _oEmos -> prettyPrint ( ) ; $ this -> _oEmos -> addPageId ( $ this -> _getEmosPageId ( $ this -> _getTplName ( ) ) ) ; $ this -> _oEmos -> addLangId ( \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ) ; $ this -> _oEmos -> addSiteId ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) ) ; } return $ this -> _oEmos ; } | Returns new emos controller object |
37,336 | public function getCode ( $ aParams , $ oSmarty ) { $ oEmos = $ this -> getEmos ( ) ; $ this -> _setControllerInfo ( $ oEmos , $ aParams , $ oSmarty ) ; $ this -> _setBasketActionsInfo ( $ oEmos ) ; return "\n" . $ oEmos -> toString ( ) ; } | Builds JS code for current view tracking functionality |
37,337 | protected function _convertToUtf ( $ sContent ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( ! $ myConfig -> isUtf ( ) ) { $ sContent = iconv ( \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> translateString ( 'charset' ) , 'UTF-8' , $ sContent ) ; } return $ sContent ; } | Checks whether shop is in utf if not - iconv string for using with econda json_encode |
37,338 | protected function _prepareProductTitle ( $ oProduct ) { $ sTitle = $ oProduct -> oxarticles__oxtitle -> value ; if ( $ oProduct -> oxarticles__oxvarselect -> value ) { $ sTitle .= " " . $ oProduct -> oxarticles__oxvarselect -> value ; } return $ sTitle ; } | Returns formatted product title |
37,339 | protected function _convProd2EmosItem ( $ oProduct , $ sCatPath = "NULL" , $ iQty = 1 ) { $ oItem = $ this -> _getNewEmosItem ( ) ; $ sProductId = ( isset ( $ oProduct -> oxarticles__oxartnum -> value ) && $ oProduct -> oxarticles__oxartnum -> value ) ? $ oProduct -> oxarticles__oxartnum -> value : $ oProduct -> getId ( ) ; $ oItem -> productId = $ sProductId ; $ oItem -> productName = $ this -> _prepareProductTitle ( $ oProduct ) ; $ oCur = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActShopCurrencyObject ( ) ; $ oItem -> price = $ oProduct -> getPrice ( ) -> getBruttoPrice ( ) * ( 1 / $ oCur -> rate ) ; $ oItem -> productGroup = "{$sCatPath}/{$oProduct->oxarticles__oxtitle->value}" ; $ oItem -> quantity = $ iQty ; $ oItem -> variant1 = $ oProduct -> getVendor ( ) ? $ oProduct -> getVendor ( ) -> getTitle ( ) : "NULL" ; $ oItem -> variant2 = $ oProduct -> getManufacturer ( ) ? $ oProduct -> getManufacturer ( ) -> getTitle ( ) : "NULL" ; $ oItem -> variant3 = $ oProduct -> getId ( ) ; return $ oItem ; } | Converts a oxarticle object to an EMOS_Item |
37,340 | protected function _getEmosCatPath ( ) { if ( $ this -> _sEmosCatPath === null ) { $ aCatTitle = [ ] ; if ( $ aCatPath = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActiveView ( ) -> getBreadCrumb ( ) ) { foreach ( $ aCatPath as $ aCatPathParts ) { $ aCatTitle [ ] = $ aCatPathParts [ 'title' ] ; } } $ this -> _sEmosCatPath = ( count ( $ aCatTitle ) ? strip_tags ( implode ( '/' , $ aCatTitle ) ) : 'NULL' ) ; } return $ this -> _sEmosCatPath ; } | Returns current view category path |
37,341 | protected function _getBasketProductCatPath ( $ oArticle ) { $ sCatPath = '' ; if ( $ oCategory = $ oArticle -> getCategory ( ) ) { $ sTable = $ oCategory -> getViewName ( ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) ; $ sQ = "select {$sTable}.oxtitle as oxtitle from {$sTable} where {$sTable}.oxleft <= " . $ oDb -> quote ( $ oCategory -> oxcategories__oxleft -> value ) . " and {$sTable}.oxright >= " . $ oDb -> quote ( $ oCategory -> oxcategories__oxright -> value ) . " and {$sTable}.oxrootid = " . $ oDb -> quote ( $ oCategory -> oxcategories__oxrootid -> value ) . " order by {$sTable}.oxleft" ; $ oRs = $ oDb -> select ( $ sQ ) ; if ( $ oRs != false && $ oRs -> count ( ) > 0 ) { while ( ! $ oRs -> EOF ) { if ( $ sCatPath ) { $ sCatPath .= '/' ; } $ sCatPath .= strip_tags ( $ oRs -> fields [ 'oxtitle' ] ) ; $ oRs -> fetchRow ( ) ; } } } return $ sCatPath ; } | Builds basket product category path |
37,342 | protected function _getEmosPageId ( $ sTplName ) { $ sPageId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) . $ this -> _getEmosCl ( ) . $ sTplName . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'cnid' ) . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'anid' ) . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'option' ) ; return md5 ( $ sPageId ) ; } | generates a unique id for the current page |
37,343 | protected function _getTplName ( ) { if ( ! ( $ sCurrTpl = basename ( ( string ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'tpl' ) ) ) ) { $ sCurrTpl = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActiveView ( ) -> getTemplateName ( ) ; } return $ sCurrTpl ; } | Returns active view template name |
37,344 | private function _setUserRegistration ( $ oEmos , $ oUser ) { $ iError = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'newslettererror' ) ; $ iSuccess = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'success' ) ; if ( $ iError && $ iError < 0 ) { $ oEmos -> addRegister ( $ oUser ? $ oUser -> getId ( ) : 'NULL' , abs ( $ iError ) ) ; } if ( $ iSuccess && $ iSuccess > 0 && $ oUser ) { $ oEmos -> addRegister ( $ oUser -> getId ( ) , 0 ) ; } } | Sets user registration action to Emos . |
37,345 | public function addFile ( $ sFile ) { if ( empty ( $ sFile ) ) { throw new Exception ( 'Parameter $sFile is empty!' ) ; } if ( empty ( $ this -> _sBaseDirectory ) ) { throw new Exception ( 'Base directory is not set, please use setter setBaseDirectory!' ) ; } if ( is_file ( $ this -> _sBaseDirectory . $ sFile ) ) { $ this -> _aFiles [ ] = $ sFile ; return true ; } return false ; } | Add one file to collection if it exists |
37,346 | public function addDirectoryFiles ( $ sFolder , $ aExtensions = [ ] , $ blRecursive = false ) { if ( empty ( $ sFolder ) ) { throw new Exception ( 'Parameter $sFolder is empty!' ) ; } if ( empty ( $ this -> _sBaseDirectory ) ) { throw new Exception ( 'Base directory is not set, please use setter setBaseDirectory!' ) ; } $ aCurrentList = [ ] ; if ( ! is_dir ( $ this -> _sBaseDirectory . $ sFolder ) ) { return ; } $ handle = opendir ( $ this -> _sBaseDirectory . $ sFolder ) ; while ( $ sFile = readdir ( $ handle ) ) { if ( $ sFile != "." && $ sFile != ".." ) { if ( is_dir ( $ this -> _sBaseDirectory . $ sFolder . $ sFile ) ) { if ( $ blRecursive ) { $ aResultList = $ this -> addDirectoryFiles ( $ sFolder . $ sFile . '/' , $ aExtensions , $ blRecursive ) ; if ( is_array ( $ aResultList ) ) { $ aCurrentList = array_merge ( $ aCurrentList , $ aResultList ) ; } } } else { $ sExt = substr ( strrchr ( $ sFile , '.' ) , 1 ) ; if ( ( ! empty ( $ aExtensions ) && is_array ( $ aExtensions ) && in_array ( $ sExt , $ aExtensions ) ) || ( empty ( $ aExtensions ) ) ) { $ this -> addFile ( $ sFolder . $ sFile ) ; } } } } closedir ( $ handle ) ; } | browse all folders and sub - folders after files which have given extensions |
37,347 | public function getVendorlist ( ) { if ( $ this -> _aVendorlist === null ) { $ oVendorTree = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ VendorList :: class ) ; $ oVendorTree -> buildVendorTree ( 'vendorlist' , null , \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopHomeUrl ( ) ) ; $ this -> _aVendorlist = $ oVendorTree ; } return $ this -> _aVendorlist ; } | Template variable getter . Returns vendorlist for search |
37,348 | public function removeArtFromAct ( ) { $ aChosenArt = $ this -> _getActionIds ( 'oxactions2article.oxid' ) ; $ sOxid = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'oxid' ) ; $ this -> _getOxRssFeed ( ) -> removeCacheFile ( $ sOxid ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sQ = parent :: _addFilter ( "delete oxactions2article.* " . $ this -> _getQuery ( ) ) ; \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> Execute ( $ sQ ) ; } elseif ( is_array ( $ aChosenArt ) ) { $ sChosenArticles = implode ( ", " , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aChosenArt ) ) ; $ sQ = "delete from oxactions2article where oxactions2article.oxid in (" . $ sChosenArticles . ") " ; \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> Execute ( $ sQ ) ; } } | Removes article from Promotions list |
37,349 | public function addArtToAct ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ aArticles = $ this -> _getActionIds ( 'oxarticles.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; $ this -> _getOxRssFeed ( ) -> removeCacheFile ( $ soxId ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sArtTable = $ this -> _getViewName ( 'oxarticles' ) ; $ aArticles = $ this -> _getAll ( $ this -> _addFilter ( "select $sArtTable.oxid " . $ this -> _getQuery ( ) ) ) ; } $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) ; $ sArtTable = $ this -> _getViewName ( 'oxarticles' ) ; $ sQ = "select max(oxactions2article.oxsort) from oxactions2article join {$sArtTable} " . "on {$sArtTable}.oxid=oxactions2article.oxartid " . "where oxactions2article.oxactionid = " . $ database -> quote ( $ soxId ) . " and oxactions2article.oxshopid = '" . $ myConfig -> getShopId ( ) . "'and $sArtTable.oxid is not null" ; $ iSort = ( ( int ) $ database -> getOne ( $ sQ ) ) + 1 ; $ articleAdded = false ; if ( $ soxId && $ soxId != "-1" && is_array ( $ aArticles ) ) { $ sShopId = $ myConfig -> getShopId ( ) ; foreach ( $ aArticles as $ sAdd ) { $ oNewGroup = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oNewGroup -> init ( 'oxactions2article' ) ; $ oNewGroup -> oxactions2article__oxshopid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sShopId ) ; $ oNewGroup -> oxactions2article__oxactionid = new \ OxidEsales \ Eshop \ Core \ Field ( $ soxId ) ; $ oNewGroup -> oxactions2article__oxartid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sAdd ) ; $ oNewGroup -> oxactions2article__oxsort = new \ OxidEsales \ Eshop \ Core \ Field ( $ iSort ++ ) ; $ oNewGroup -> save ( ) ; } $ articleAdded = true ; } return $ articleAdded ; } | Adds article to Promotions list |
37,350 | public function render ( $ widget , $ forceRender , $ isDynamic = false ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ output = '' ; $ suffix = $ isDynamic ? '_dynamic' : '' ; $ filesParameterName = \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: FILES_PARAMETER_NAME . $ suffix ; $ scriptsParameterName = \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: SNIPPETS_PARAMETER_NAME . $ suffix ; $ isAjaxRequest = $ this -> isAjaxRequest ( ) ; $ forceRender = $ this -> shouldForceRender ( $ forceRender , $ isAjaxRequest ) ; if ( ! $ widget || $ forceRender ) { if ( ! $ isAjaxRequest ) { $ files = $ this -> prepareFilesForRendering ( $ config -> getGlobalParameter ( $ filesParameterName ) , $ widget ) ; $ output .= $ this -> formFilesOutput ( $ files , $ widget ) ; $ config -> setGlobalParameter ( $ filesParameterName , null ) ; if ( $ widget ) { $ dynamicIncludes = ( array ) $ config -> getGlobalParameter ( \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: FILES_PARAMETER_NAME . '_dynamic' ) ; $ output .= $ this -> formFilesOutput ( $ dynamicIncludes , $ widget ) ; $ config -> setGlobalParameter ( \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: FILES_PARAMETER_NAME . '_dynamic' , null ) ; } } $ snippets = ( array ) $ config -> getGlobalParameter ( $ scriptsParameterName ) ; $ scriptOutput = $ this -> formSnippetsOutput ( $ snippets , $ widget , $ isAjaxRequest ) ; $ config -> setGlobalParameter ( $ scriptsParameterName , null ) ; if ( $ widget ) { $ dynamicScripts = ( array ) $ config -> getGlobalParameter ( \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: SNIPPETS_PARAMETER_NAME . '_dynamic' ) ; $ scriptOutput .= $ this -> formSnippetsOutput ( $ dynamicScripts , $ widget , $ isAjaxRequest ) ; $ config -> setGlobalParameter ( \ OxidEsales \ Eshop \ Core \ ViewHelper \ JavaScriptRegistrator :: SNIPPETS_PARAMETER_NAME . '_dynamic' , null ) ; } $ output .= $ this -> enclose ( $ scriptOutput , $ widget , $ isAjaxRequest ) ; } return $ output ; } | Renders all registered JavaScript snippets and files . |
37,351 | protected function formFilesOutput ( $ includes , $ widget ) { if ( ! count ( $ includes ) ) { return '' ; } ksort ( $ includes ) ; $ usedSources = [ ] ; $ widgets = [ ] ; $ widgetTemplate = "WidgetsHandler.registerFile('%s', '%s');" ; $ scriptTemplate = '<script type="text/javascript" src="%s"></script>' ; foreach ( $ includes as $ priority ) { foreach ( $ priority as $ source ) { if ( ! in_array ( $ source , $ usedSources ) ) { $ widgets [ ] = sprintf ( ( $ widget ? $ widgetTemplate : $ scriptTemplate ) , $ source , $ widget ) ; $ usedSources [ ] = $ source ; } } } $ output = implode ( PHP_EOL , $ widgets ) ; if ( $ widget && ! empty ( $ output ) ) { $ output = <<<JS<script type='text/javascript'> window.addEventListener('load', function() { $output }, false)</script>JS ; } return $ output ; } | Form output for includes . |
37,352 | protected function formSnippetsOutput ( $ scripts , $ widgetName , $ ajaxRequest ) { $ preparedScripts = [ ] ; foreach ( $ scripts as $ script ) { if ( $ widgetName && ! $ ajaxRequest ) { $ sanitizedScript = $ this -> sanitize ( $ script ) ; $ script = "WidgetsHandler.registerFunction('$sanitizedScript', '$widgetName');" ; } $ preparedScripts [ ] = $ script ; } return implode ( PHP_EOL , $ preparedScripts ) ; } | Forms how javascript should look like when output . If varnish is active javascript should be passed to WidgetsHandler instead of direct call . |
37,353 | protected function _addNavigationHistory ( $ sNode ) { $ myUtilsServer = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) ; $ aHistory = explode ( '|' , $ myUtilsServer -> getOxCookie ( 'oxidadminhistory' ) ) ; if ( ! is_array ( $ aHistory ) ) { $ aHistory = [ ] ; } if ( ! in_array ( $ sNode , $ aHistory ) ) { $ aHistory [ ] = $ sNode ; } $ myUtilsServer -> setOxCookie ( 'oxidadminhistory' , implode ( '|' , $ aHistory ) ) ; } | Store navigation history parameters to cookie |
37,354 | protected function _getMaxUploadFileInfo ( $ iMaxFileSize , $ blFormatted = false ) { $ iMaxFileSize = $ iMaxFileSize ? $ iMaxFileSize : '2M' ; $ iMaxFileSize = trim ( $ iMaxFileSize ) ; $ sParam = strtolower ( $ iMaxFileSize { strlen ( $ iMaxFileSize ) - 1 } ) ; switch ( $ sParam ) { case 'g' : $ iMaxFileSize *= 1024 ; case 'm' : $ iMaxFileSize *= 1024 ; case 'k' : $ iMaxFileSize *= 1024 ; } $ aMarkers = [ 'KB' , 'MB' , 'GB' ] ; $ sFormattedMaxSize = '' ; $ iSize = floor ( $ iMaxFileSize / 1024 ) ; while ( $ iSize && current ( $ aMarkers ) ) { $ sFormattedMaxSize = $ iSize . " " . current ( $ aMarkers ) ; $ iSize = floor ( $ iSize / 1024 ) ; next ( $ aMarkers ) ; } return [ $ iMaxFileSize , $ sFormattedMaxSize ] ; } | Returns maximum allowed size of upload file and formatted size equivalent |
37,355 | protected function _getCountryByCode ( $ sCountryCode ) { $ sCountry = 'international' ; if ( ! empty ( $ sCountryCode ) ) { $ aLangIds = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getLanguageIds ( ) ; $ iEnglishId = array_search ( "en" , $ aLangIds ) ; if ( false !== $ iEnglishId ) { $ sViewName = getViewName ( "oxcountry" , $ iEnglishId ) ; $ sQ = "select oxtitle from {$sViewName} where oxisoalpha2 = " . \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quote ( $ sCountryCode ) ; $ sCountryName = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> getOne ( $ sQ ) ; if ( $ sCountryName ) { $ sCountry = $ sCountryName ; } } else { switch ( $ sCountryCode ) { case 'de' : return 'germany' ; default : return 'international' ; } } } return strtolower ( $ sCountry ) ; } | Get english country name by country iso alpha 2 code |
37,356 | protected function _authorize ( ) { return ( bool ) ( $ this -> getSession ( ) -> checkSessionChallenge ( ) && count ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsServer ( ) -> getOxCookie ( ) ) && \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> checkAccessRights ( ) ) ; } | performs authorization of admin user |
37,357 | public function getNavigation ( ) { if ( self :: $ _oNaviTree == null ) { self :: $ _oNaviTree = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ Admin \ NavigationTree :: class ) ; } return self :: $ _oNaviTree ; } | Returns navigation object |
37,358 | public function getViewId ( ) { $ viewId = is_null ( $ this -> viewId ) ? strtolower ( $ this -> getControllerKey ( ) ) : $ this -> viewId ; return $ this -> getNavigation ( ) -> getClassId ( $ viewId ) ; } | Current view ID getter helps to identify navigation position |
37,359 | public function resetSeoData ( $ sShopId ) { $ aTypes = [ 'oxarticle' , 'oxcategory' , 'oxvendor' , 'oxcontent' , 'dynamic' , 'oxmanufacturer' ] ; $ oEncoder = \ OxidEsales \ Eshop \ Core \ Registry :: getSeoEncoder ( ) ; foreach ( $ aTypes as $ sType ) { $ oEncoder -> markAsExpired ( null , $ sShopId , 1 , null , "oxtype = '{$sType}'" ) ; } } | Marks seo entires as expired . |
37,360 | protected function getControllerKey ( ) { $ actualClass = get_class ( $ this ) ; $ controllerKey = \ OxidEsales \ Eshop \ Core \ Registry :: getControllerClassNameResolver ( ) -> getIdByClassName ( $ actualClass ) ; if ( is_null ( $ controllerKey ) ) { $ controllerKey = \ OxidEsales \ Eshop \ Core \ Registry :: getControllerClassNameResolver ( ) -> getIdByClassName ( $ this -> getShopParentClass ( ) ) ; } return $ controllerKey ; } | Get controller key also for chain extended class . |
37,361 | protected function getShopParentClass ( ) { $ className = get_class ( $ this ) ; while ( $ className && ! \ OxidEsales \ Eshop \ Core \ NamespaceInformationProvider :: classBelongsToShopUnifiedNamespace ( $ className ) ) { $ className = get_parent_class ( $ className ) ; } return $ className ; } | Method to figure out \ OxidEsales \ Eshop class . |
37,362 | public function save ( ) { $ oxsort = $ this -> oxdiscount__oxsort -> value ; if ( is_null ( $ oxsort ) ) { $ shopId = $ this -> oxdiscount__oxshopid -> value ; $ newSort = $ this -> getNextOxsort ( $ shopId ) ; $ this -> oxdiscount__oxsort = new \ oxField ( $ newSort , \ OxidEsales \ Eshop \ Core \ Field :: T_RAW ) ; } if ( ! is_numeric ( $ this -> oxdiscount__oxsort -> value ) ) { $ exception = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ InputException :: class ) ; $ exception -> setMessage ( 'DISCOUNT_ERROR_OXSORT_NOT_A_NUMBER' ) ; throw $ exception ; } try { $ saveStatus = parent :: save ( ) ; } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException $ exception ) { if ( $ exception -> getCode ( ) == \ OxidEsales \ Eshop \ Core \ Database \ Adapter \ Doctrine \ Database :: DUPLICATE_KEY_ERROR_CODE && false !== strpos ( $ exception -> getMessage ( ) , 'UNIQ_OXSORT' ) ) { $ exception = oxNew ( \ OxidEsales \ Eshop \ Core \ Exception \ InputException :: class ) ; $ exception -> setMessage ( 'DISCOUNT_ERROR_OXSORT_NOT_UNIQUE' ) ; } throw $ exception ; } return $ saveStatus ; } | Save the discount . Assigns a value to oxsort if it was null Does input validation before saving the discount . |
37,363 | public function isForArticle ( $ oArticle ) { if ( $ this -> oxdiscount__oxaddsumtype -> value == 'itm' ) { return false ; } if ( $ this -> oxdiscount__oxamount -> value || $ this -> oxdiscount__oxprice -> value ) { return false ; } if ( $ this -> oxdiscount__oxpriceto -> value && ( $ this -> oxdiscount__oxpriceto -> value < $ oArticle -> getBasePrice ( ) ) ) { return false ; } if ( $ this -> isGlobalDiscount ( ) ) { return true ; } $ sArticleId = $ oArticle -> getProductId ( ) ; if ( ! isset ( $ this -> _aHasArticleDiscounts [ $ sArticleId ] ) ) { $ blResult = $ this -> _isArticleAssigned ( $ oArticle ) || $ this -> _isCategoriesAssigned ( $ oArticle -> getCategoryIds ( ) ) ; $ this -> _aHasArticleDiscounts [ $ sArticleId ] = $ blResult ; } return $ this -> _aHasArticleDiscounts [ $ sArticleId ] ; } | Checks if discount applies for article |
37,364 | public function isForBasketItem ( $ oArticle ) { if ( $ this -> oxdiscount__oxamount -> value == 0 && $ this -> oxdiscount__oxprice -> value == 0 ) { return false ; } if ( $ this -> oxdiscount__oxaddsumtype -> value == 'itm' ) { return false ; } $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = "select 1 from oxobject2discount where oxdiscountid = " . $ oDb -> quote ( $ this -> oxdiscount__oxid -> value ) . " and oxtype = 'oxarticles' " ; $ sQ .= $ this -> _getProductCheckQuery ( $ oArticle ) ; if ( ! ( $ blOk = ( bool ) $ oDb -> getOne ( $ sQ ) ) ) { $ blOk = $ this -> _checkForArticleCategories ( $ oArticle ) ; } return $ blOk ; } | Checks if discount is setup for some basket item |
37,365 | public function isForBasket ( $ oBasket ) { if ( $ this -> oxdiscount__oxamount -> value == 0 && $ this -> oxdiscount__oxprice -> value == 0 ) { return false ; } $ oSummary = $ oBasket -> getBasketSummary ( ) ; if ( $ this -> oxdiscount__oxamount -> value && ( $ oSummary -> iArticleCount < $ this -> oxdiscount__oxamount -> value || $ oSummary -> iArticleCount > $ this -> oxdiscount__oxamountto -> value ) ) { return false ; } elseif ( $ this -> oxdiscount__oxprice -> value ) { $ dRate = $ oBasket -> getBasketCurrency ( ) -> rate ; if ( $ oSummary -> dArticleDiscountablePrice < $ this -> oxdiscount__oxprice -> value * $ dRate || $ oSummary -> dArticleDiscountablePrice > $ this -> oxdiscount__oxpriceto -> value * $ dRate ) { return false ; } } $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = 'select 1 from oxobject2discount where oxdiscountid = ' . $ oDb -> quote ( $ this -> oxdiscount__oxid -> value ) . ' and oxtype in ("oxarticles", "oxcategories" ) ' ; return ! ( ( bool ) $ oDb -> getOne ( $ sQ ) ) ; } | Checks if discount is setup for whole basket |
37,366 | public function isForBundleItem ( $ oArticle ) { if ( $ this -> oxdiscount__oxaddsumtype -> value != 'itm' ) { return false ; } $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = "select 1 from oxobject2discount where oxdiscountid=" . $ oDb -> quote ( $ this -> getId ( ) ) ; $ sQ .= $ this -> _getProductCheckQuery ( $ oArticle ) ; if ( ! ( $ blOk = ( bool ) $ oDb -> getOne ( $ sQ ) ) ) { $ blOk = $ this -> _checkForArticleCategories ( $ oArticle ) ; } return $ blOk ; } | Checks if discount type is bundle discount |
37,367 | public function getAbsValue ( $ dPrice , $ dAmount = 1 ) { if ( $ this -> oxdiscount__oxaddsumtype -> value == '%' ) { return $ dPrice * ( $ this -> oxdiscount__oxaddsum -> value / 100 ) ; } else { $ oCur = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActShopCurrencyObject ( ) ; return $ this -> oxdiscount__oxaddsum -> value * $ dAmount * $ oCur -> rate ; } } | Returns absolute discount value |
37,368 | public function getPercentage ( $ dPrice ) { if ( $ this -> getAddSumType ( ) == 'abs' && $ dPrice > 0 ) { return $ this -> getAddSum ( ) / $ dPrice * 100 ; } else { return $ this -> getAddSum ( ) ; } } | Return discount percent |
37,369 | public function getAddSum ( ) { if ( $ this -> oxdiscount__oxaddsumtype -> value == 'abs' ) { $ oCur = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getActShopCurrencyObject ( ) ; return $ this -> oxdiscount__oxaddsum -> value * $ oCur -> rate ; } else { return $ this -> oxdiscount__oxaddsum -> value ; } } | Return add sum in abs type discount with efected currency rate ; Return discount percent value in other way ; |
37,370 | public function getBundleAmount ( $ dAmount ) { $ dItemAmount = $ this -> oxdiscount__oxitmamount -> value ; if ( $ this -> oxdiscount__oxitmmultiple -> value && $ this -> oxdiscount__oxamount -> value > 0 ) { $ dItemAmount = floor ( $ dAmount / $ this -> oxdiscount__oxamount -> value ) * $ this -> oxdiscount__oxitmamount -> value ; } return $ dItemAmount ; } | Returns amount of items to bundle |
37,371 | public function getSimpleDiscount ( ) { $ oDiscount = new stdClass ( ) ; $ oDiscount -> sOXID = $ this -> getId ( ) ; $ oDiscount -> sDiscount = $ this -> oxdiscount__oxtitle -> value ; $ oDiscount -> sType = $ this -> oxdiscount__oxaddsumtype -> value ; return $ oDiscount ; } | Returns compact discount object which is used in oxbasket |
37,372 | protected function _checkForArticleCategories ( $ oArticle ) { $ aCatIds = $ oArticle -> getCategoryIds ( ) ; if ( ! $ aCatIds || ! count ( $ aCatIds ) ) { return false ; } $ sCatIds = "(" . implode ( "," , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aCatIds ) ) . ")" ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sQ = "select oxobjectid from oxobject2discount where oxdiscountid = " . $ oDb -> quote ( $ this -> oxdiscount__oxid -> value ) . " and oxobjectid in $sCatIds and oxtype = 'oxcategories'" ; return $ oDb -> getOne ( $ sQ ) ; } | Checks if discount may be applied according amounts info |
37,373 | protected function _isArticleAssigned ( $ oArticle ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sDiscountIdQuoted = $ oDb -> quote ( $ this -> oxdiscount__oxid -> value ) ; $ sQ = "select 1 from oxobject2discount where oxdiscountid = {$sDiscountIdQuoted} and oxtype = 'oxarticles' " ; $ sQ .= $ this -> _getProductCheckQuery ( $ oArticle ) ; return $ oDb -> getOne ( $ sQ ) ? true : false ; } | Checks whether this article is assigned to discount |
37,374 | protected function _isCategoriesAssigned ( $ aCategoryIds ) { if ( empty ( $ aCategoryIds ) ) { return false ; } $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sDiscountIdQuoted = $ oDb -> quote ( $ this -> oxdiscount__oxid -> value ) ; $ sCategoryIds = "(" . implode ( "," , \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quoteArray ( $ aCategoryIds ) ) . ")" ; $ sQ = "select 1 from oxobject2discount where oxdiscountid = {$sDiscountIdQuoted} and oxobjectid in {$sCategoryIds} and oxtype = 'oxcategories'" ; return $ oDb -> getOne ( $ sQ ) ? true : false ; } | Checks whether categories are assigned to discount |
37,375 | public function addCountryToDel ( ) { $ aChosenCntr = $ this -> _getActionIds ( 'oxcountry.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sCountryTable = $ this -> _getViewName ( 'oxcountry' ) ; $ aChosenCntr = $ this -> _getAll ( $ this -> _addFilter ( "select $sCountryTable.oxid " . $ this -> _getQuery ( ) ) ) ; } if ( $ soxId && $ soxId != "-1" && is_array ( $ aChosenCntr ) ) { foreach ( $ aChosenCntr as $ sChosenCntr ) { $ oObject2Delivery = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oObject2Delivery -> init ( 'oxobject2delivery' ) ; $ oObject2Delivery -> oxobject2delivery__oxdeliveryid = new \ OxidEsales \ Eshop \ Core \ Field ( $ soxId ) ; $ oObject2Delivery -> oxobject2delivery__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sChosenCntr ) ; $ oObject2Delivery -> oxobject2delivery__oxtype = new \ OxidEsales \ Eshop \ Core \ Field ( 'oxcountry' ) ; $ oObject2Delivery -> save ( ) ; } } } | Adds chosen countries to delivery list |
37,376 | public function addArtToDel ( ) { $ aChosenArt = $ this -> _getActionIds ( 'oxarticles.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sArtTable = $ this -> _getViewName ( 'oxarticles' ) ; $ aChosenArt = $ this -> _getAll ( $ this -> _addFilter ( "select $sArtTable.oxid " . $ this -> _getQuery ( ) ) ) ; } if ( $ soxId && $ soxId != "-1" && is_array ( $ aChosenArt ) ) { foreach ( $ aChosenArt as $ sChosenArt ) { $ oObject2Delivery = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oObject2Delivery -> init ( 'oxobject2delivery' ) ; $ oObject2Delivery -> oxobject2delivery__oxdeliveryid = new \ OxidEsales \ Eshop \ Core \ Field ( $ soxId ) ; $ oObject2Delivery -> oxobject2delivery__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sChosenArt ) ; $ oObject2Delivery -> oxobject2delivery__oxtype = new \ OxidEsales \ Eshop \ Core \ Field ( "oxarticles" ) ; $ oObject2Delivery -> save ( ) ; } } } | Adds article to delivery configuration |
37,377 | protected function _processAddress ( $ aData , $ sTypeToProcess , $ aIgnore ) { $ blEmpty = true ; $ aFields = [ ] ; foreach ( $ aData as $ sName => $ sValue ) { if ( strpos ( $ sName , $ sTypeToProcess ) !== false ) { $ aFields [ ] = $ sName ; if ( ! in_array ( $ sName , $ aIgnore ) && $ sValue ) { $ blEmpty = false ; break ; } } } if ( $ blEmpty ) { foreach ( $ aFields as $ sName ) { $ aData [ $ sName ] = "" ; } } return $ aData ; } | Iterates through data array checks if specified fields are filled in cleanups not needed data |
37,378 | public function save ( ) { parent :: save ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = ( array ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; $ oOrder = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Order :: class ) ; if ( $ soxId != "-1" ) { $ oOrder -> load ( $ soxId ) ; } else { $ aParams [ 'oxorder__oxid' ] = null ; } $ aParams = $ this -> _processAddress ( $ aParams , "oxorder__oxdel" , [ "oxorder__oxdelsal" ] ) ; $ oOrder -> assign ( $ aParams ) ; $ oOrder -> save ( ) ; $ this -> setEditObjectId ( $ oOrder -> getId ( ) ) ; } | Saves ordering address information . |
37,379 | public function addPromotionGroup ( ) { $ aChosenGroup = $ this -> _getActionIds ( 'oxgroups.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sGroupTable = $ this -> _getViewName ( 'oxgroups' ) ; $ aChosenGroup = $ this -> _getAll ( $ this -> _addFilter ( "select $sGroupTable.oxid " . $ this -> _getQuery ( ) ) ) ; } $ promotionAdded = false ; if ( $ soxId && $ soxId != "-1" && is_array ( $ aChosenGroup ) ) { foreach ( $ aChosenGroup as $ sChosenGroup ) { $ oObject2Promotion = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oObject2Promotion -> init ( 'oxobject2action' ) ; $ oObject2Promotion -> oxobject2action__oxactionid = new \ OxidEsales \ Eshop \ Core \ Field ( $ soxId ) ; $ oObject2Promotion -> oxobject2action__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sChosenGroup ) ; $ oObject2Promotion -> oxobject2action__oxclass = new \ OxidEsales \ Eshop \ Core \ Field ( "oxgroups" ) ; $ oObject2Promotion -> save ( ) ; } $ promotionAdded = true ; } return $ promotionAdded ; } | Adds user group to promotion |
37,380 | public function render ( ) { $ sFileOrderId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'sorderfileid' ) ; if ( $ sFileOrderId ) { $ oArticleFile = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ File :: class ) ; try { $ oOrderFile = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ OrderFile :: class ) ; if ( $ oOrderFile -> load ( $ sFileOrderId ) ) { $ sFileId = $ oOrderFile -> getFileId ( ) ; $ blLoadedAndExists = $ oArticleFile -> load ( $ sFileId ) && $ oArticleFile -> exist ( ) ; if ( $ sFileId && $ blLoadedAndExists && $ oOrderFile -> processOrderFile ( ) ) { $ oArticleFile -> download ( ) ; } else { $ sError = "ERROR_MESSAGE_FILE_DOESNOT_EXIST" ; } } } catch ( \ OxidEsales \ Eshop \ Core \ Exception \ StandardException $ oEx ) { $ sError = "ERROR_MESSAGE_FILE_DOWNLOAD_FAILED" ; } } else { $ sError = "ERROR_MESSAGE_WRONG_DOWNLOAD_LINK" ; } if ( $ sError ) { $ oEx = new \ OxidEsales \ Eshop \ Core \ Exception \ ExceptionToDisplay ( ) ; $ oEx -> setMessage ( $ sError ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ oEx , false ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> redirect ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopUrl ( ) . 'index.php?cl=account_downloads' ) ; } } | Checks if given token is valid formats HTTP headers and outputs file to buffer . |
37,381 | public function isValidCodeLengths ( $ aCodeLengths ) { $ blValid = false ; if ( $ this -> _isNotEmptyArray ( $ aCodeLengths ) ) { $ blValid = $ this -> _isEachCodeLengthValid ( $ aCodeLengths ) ; } return $ blValid ; } | Validation of IBAN registry |
37,382 | public function setCodeLengths ( $ aCodeLengths ) { if ( $ this -> isValidCodeLengths ( $ aCodeLengths ) ) { $ this -> _aCodeLengths = $ aCodeLengths ; return true ; } else { return false ; } } | Set IBAN Registry |
37,383 | protected function _isLengthValid ( $ sIBAN ) { $ iActualLength = getStr ( ) -> strlen ( $ sIBAN ) ; $ iCorrectLength = $ this -> _getLengthForCountry ( $ sIBAN ) ; return ! is_null ( $ iCorrectLength ) && $ iActualLength === $ iCorrectLength ; } | Check if the total IBAN length is correct as per country . If not the IBAN is invalid . |
37,384 | protected function _getLengthForCountry ( $ sIBAN ) { $ aIBANRegistry = $ this -> getCodeLengths ( ) ; $ sCountryCode = getStr ( ) -> substr ( $ sIBAN , 0 , 2 ) ; $ iCorrectLength = ( isset ( $ aIBANRegistry [ $ sCountryCode ] ) ) ? $ aIBANRegistry [ $ sCountryCode ] : null ; return $ iCorrectLength ; } | Gets length for country . |
37,385 | protected function _isAlgorithmValid ( $ sIBAN ) { $ sIBAN = $ this -> _moveInitialCharactersToEnd ( $ sIBAN ) ; $ sIBAN = $ this -> _replaceLettersToNumbers ( $ sIBAN ) ; return $ this -> _isIBANChecksumValid ( $ sIBAN ) ; } | Checks if IBAN is valid according to checksum algorithm |
37,386 | protected function _moveInitialCharactersToEnd ( $ sIBAN ) { $ oStr = getStr ( ) ; $ sInitialChars = $ oStr -> substr ( $ sIBAN , 0 , 4 ) ; $ sIBAN = $ oStr -> substr ( $ sIBAN , 4 ) ; return $ sIBAN . $ sInitialChars ; } | Move the four initial characters to the end of the string . |
37,387 | protected function _isEachCodeLengthValid ( $ aCodeLengths ) { $ blValid = true ; foreach ( $ aCodeLengths as $ sCountryAbbr => $ iLength ) { if ( ! $ this -> _isCodeLengthKeyValid ( $ sCountryAbbr ) || ! $ this -> _isCodeLengthValueValid ( $ iLength ) ) { $ blValid = false ; break ; } } return $ blValid ; } | Checks if each code length is valid . |
37,388 | public function addArtToSel ( ) { $ aAddArticle = $ this -> _getActionIds ( 'oxarticles.oxid' ) ; $ soxId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'synchoxid' ) ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'all' ) ) { $ sArtTable = $ this -> _getViewName ( 'oxarticles' ) ; $ aAddArticle = $ this -> _getAll ( parent :: _addFilter ( "select $sArtTable.oxid " . $ this -> _getQuery ( ) ) ) ; } if ( $ soxId && $ soxId != "-1" && is_array ( $ aAddArticle ) ) { $ database = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) ; foreach ( $ aAddArticle as $ sAdd ) { $ oNewGroup = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ BaseModel :: class ) ; $ oNewGroup -> init ( "oxobject2selectlist" ) ; $ oNewGroup -> oxobject2selectlist__oxobjectid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sAdd ) ; $ oNewGroup -> oxobject2selectlist__oxselnid = new \ OxidEsales \ Eshop \ Core \ Field ( $ soxId ) ; $ oNewGroup -> oxobject2selectlist__oxsort = new \ OxidEsales \ Eshop \ Core \ Field ( ( int ) $ database -> getOne ( "select max(oxsort) + 1 from oxobject2selectlist where oxobjectid = " . $ database -> quote ( $ sAdd ) . " " ) ) ; $ oNewGroup -> save ( ) ; $ this -> onArticleAddToSelectionList ( $ sAdd ) ; } } } | Adds article to Selection list |
37,389 | public function getInstance ( $ sInstanceName ) { if ( strpos ( $ sInstanceName , '\\' ) === false ) { $ sInstanceName = $ this -> getClass ( $ sInstanceName ) ; } if ( ! isset ( Core :: $ _aInstances [ $ sInstanceName ] ) ) { Core :: $ _aInstances [ $ sInstanceName ] = new $ sInstanceName ( ) ; } return Core :: $ _aInstances [ $ sInstanceName ] ; } | Returns requested instance object |
37,390 | protected function getClass ( $ sInstanceName ) { $ facts = new Facts ( ) ; $ class = 'OxidEsales\\EshopCommunity\\Setup\\' . $ sInstanceName ; $ classEnterprise = '\\OxidEsales\\EshopEnterprise\\' . EditionPathProvider :: SETUP_DIRECTORY . '\\' . $ sInstanceName ; $ classProfessional = '\\OxidEsales\\EshopProfessional\\' . EditionPathProvider :: SETUP_DIRECTORY . '\\' . $ sInstanceName ; if ( ( $ facts -> isProfessional ( ) || $ facts -> isEnterprise ( ) ) && $ this -> classExists ( $ classProfessional ) ) { $ class = $ classProfessional ; } if ( $ facts -> isEnterprise ( ) && $ this -> classExists ( $ classEnterprise ) ) { $ class = $ classEnterprise ; } return $ class ; } | Methods returns class according edition . |
37,391 | protected function userDecidedOverwriteDB ( ) { $ userDecidedOverwriteDatabase = false ; $ overwriteCheck = $ this -> getUtilitiesInstance ( ) -> getRequestVar ( "ow" , "get" ) ; $ session = $ this -> getSessionInstance ( ) ; if ( isset ( $ overwriteCheck ) || $ session -> getSessionParam ( 'blOverwrite' ) ) { $ userDecidedOverwriteDatabase = true ; } return $ userDecidedOverwriteDatabase ; } | Return true if user already decided to overwrite database . |
37,392 | protected function userDecidedIgnoreDBWarning ( ) { $ userDecidedIgnoreDBWarning = false ; $ overwriteCheck = $ this -> getUtilitiesInstance ( ) -> getRequestVar ( "owrec" , "get" ) ; $ session = $ this -> getSessionInstance ( ) ; if ( isset ( $ overwriteCheck ) || $ session -> getSessionParam ( 'blIgnoreDbRecommendations' ) ) { $ userDecidedIgnoreDBWarning = true ; } return $ userDecidedIgnoreDBWarning ; } | Return true if user already decided to ignore database recommended version related warnings . |
37,393 | protected function _buildSelectString ( $ oListObject = null ) { $ sViewName = getViewName ( "oxarticles" , ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( "sDefaultLang" ) ) ; $ sSql = "select oxpricealarm.*, {$sViewName}.oxtitle AS articletitle, " ; $ sSql .= "oxuser.oxlname as userlname, oxuser.oxfname as userfname " ; $ sSql .= "from oxpricealarm left join {$sViewName} on {$sViewName}.oxid = oxpricealarm.oxartid " ; $ sSql .= "left join oxuser on oxuser.oxid = oxpricealarm.oxuserid WHERE 1 " ; return $ sSql ; } | Modifying SQL query to load additional article and customer data |
37,394 | public function buildWhere ( ) { $ this -> _aWhere = parent :: buildWhere ( ) ; $ sViewName = getViewName ( "oxpricealarm" ) ; $ sArtViewName = getViewName ( "oxarticles" ) ; if ( isset ( $ this -> _aWhere [ $ sViewName . '.oxprice' ] ) ) { $ sPriceParam = ( double ) str_replace ( [ '%' , ',' ] , [ '' , '.' ] , $ this -> _aWhere [ $ sViewName . '.oxprice' ] ) ; $ this -> _aWhere [ $ sViewName . '.oxprice' ] = '%' . $ sPriceParam . '%' ; } if ( isset ( $ this -> _aWhere [ $ sArtViewName . '.oxprice' ] ) ) { $ sPriceParam = ( double ) str_replace ( [ '%' , ',' ] , [ '' , '.' ] , $ this -> _aWhere [ $ sArtViewName . '.oxprice' ] ) ; $ this -> _aWhere [ $ sArtViewName . '.oxprice' ] = '%' . $ sPriceParam . '%' ; } return $ this -> _aWhere ; } | Builds and returns array of SQL WHERE conditions |
37,395 | public function appInit ( ) { $ this -> pageStart ( ) ; if ( 'oxstart' == \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestControllerId ( ) || $ this -> isAdmin ( ) ) { return ; } $ oSystemEventHandler = $ this -> _getSystemEventHandler ( ) ; $ oSystemEventHandler -> onShopStart ( ) ; } | Initializes globals and environment vars |
37,396 | public function render ( ) { parent :: render ( ) ; $ errorNumber = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'execerror' ) ; $ templates = $ this -> getErrorTemplates ( ) ; if ( array_key_exists ( $ errorNumber , $ templates ) ) { return $ templates [ $ errorNumber ] ; } else { return 'message/err_unknown.tpl' ; } } | Renders error screen |
37,397 | public function pageStart ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ config -> setConfigParam ( 'iMaxMandates' , $ config -> getConfigParam ( 'IMS' ) ) ; $ config -> setConfigParam ( 'iMaxArticles' , $ config -> getConfigParam ( 'IMA' ) ) ; } | Creates and starts session object sets default currency . |
37,398 | public function pageClose ( ) { $ systemEventHandler = $ this -> _getSystemEventHandler ( ) ; $ systemEventHandler -> onShopEnd ( ) ; $ mySession = $ this -> getSession ( ) ; if ( isset ( $ mySession ) ) { $ mySession -> freeze ( ) ; } \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) -> commitFileCache ( ) ; } | Finalizes the script . |
37,399 | public function getCompareItems ( $ blJson = false ) { $ oCompare = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ CompareController :: class ) ; $ aCompareItems = $ oCompare -> getCompareItems ( ) ; if ( $ blJson ) { $ aCompareItems = json_encode ( $ aCompareItems ) ; } return $ aCompareItems ; } | Template variable getter . Returns comparison article list . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.