idx
int64
0
60.3k
question
stringlengths
101
6.21k
target
stringlengths
7
803
36,100
public function getShopConfVar ( $ varName , $ shopId = null , $ module = '' ) { if ( ! $ shopId ) { $ shopId = $ this -> getShopId ( ) ; } if ( $ shopId == $ this -> getShopId ( ) && ( ! $ module || $ module == Config :: OXMODULE_THEME_PREFIX . $ this -> getConfigParam ( 'sTheme' ) ) ) { $ varValue = $ this -> getConf...
Retrieves shop configuration parameters from DB .
36,101
public function decodeValue ( $ type , $ mOrigValue ) { $ value = $ mOrigValue ; switch ( $ type ) { case 'arr' : case 'aarr' : $ value = unserialize ( $ mOrigValue ) ; break ; case 'bool' : $ value = ( $ mOrigValue == 'true' || $ mOrigValue == '1' ) ; break ; } return $ value ; }
Decodes and returns database value
36,102
public function isProductiveMode ( ) { $ productive = $ this -> getConfigParam ( 'blProductive' ) ; if ( ! isset ( $ productive ) ) { $ query = 'select oxproductive from oxshops where oxid = "' . $ this -> getShopId ( ) . '"' ; $ productive = ( bool ) \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> getOn...
Returns true if current active shop is in productive mode or false if not
36,103
public function getActiveShop ( ) { if ( $ this -> _oActShop && $ this -> _iShopId == $ this -> _oActShop -> getId ( ) && $ this -> _oActShop -> getLanguage ( ) == Registry :: getLang ( ) -> getBaseLanguage ( ) ) { return $ this -> _oActShop ; } $ this -> _oActShop = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \...
Loads and returns active shop object
36,104
public function getActiveView ( ) { if ( count ( $ this -> _aActiveViews ) ) { $ actView = end ( $ this -> _aActiveViews ) ; } if ( ! isset ( $ actView ) || $ actView == null ) { $ actView = oxNew ( \ OxidEsales \ Eshop \ Application \ Controller \ FrontendController :: class ) ; $ this -> _aActiveViews [ ] = $ actView...
Returns active view object . If this object was not defined - returns oxubase object
36,105
public function getActiveViewsIds ( ) { $ ids = [ ] ; if ( is_array ( $ this -> getActiveViewsList ( ) ) ) { foreach ( $ this -> getActiveViewsList ( ) as $ view ) { $ ids [ ] = $ view -> getClassKey ( ) ; } } return $ ids ; }
Get active views class id list
36,106
public function getMallShopUrl ( $ ssl = false ) { $ configParameter = $ ssl ? 'sMallSSLShopURL' : 'sMallShopURL' ; $ mallShopUrl = $ this -> getConfigParam ( $ configParameter ) ; if ( $ mallShopUrl ) { return Registry :: getUtils ( ) -> checkUrlEndingSlash ( $ mallShopUrl ) ; } }
Function returns mall shop url .
36,107
protected function _handleDbConnectionException ( \ OxidEsales \ Eshop \ Core \ Exception \ DatabaseException $ exception ) { $ exceptionHandler = $ this -> getExceptionHandler ( ) ; $ exceptionHandler -> handleDatabaseException ( $ exception ) ; }
Handle database exception . At this point everything has crashed already and not much of shop business logic is left to call . So just go straight and call the ExceptionHandler .
36,108
protected function _handleCookieException ( $ ex ) { $ this -> _processSeoCall ( ) ; $ this -> getSession ( ) -> start ( ) ; Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ ex ) ; Registry :: getUtils ( ) -> redirect ( $ this -> getShopHomeUrl ( ) . 'cl=start' , true , 302 ) ; }
Redirect to start page and display the error
36,109
public function saveSystemConfigParameter ( $ parameterType , $ parameterName , $ parameterValue ) { $ this -> saveShopConfVar ( $ parameterType , $ parameterName , $ parameterValue , $ this -> getBaseShopId ( ) ) ; }
Save system configuration parameters which is the same for sub - shops .
36,110
public function makeValidFileName ( $ sFilename ) { $ sFilename = preg_replace ( '/[\s]+/' , '_' , $ sFilename ) ; $ sFilename = preg_replace ( '/[^a-zA-Z0-9_\.-]/' , '' , $ sFilename ) ; return str_replace ( ' ' , '_' , $ sFilename ) ; }
Gets proper file name
36,111
public function canResetShippingDate ( ) { $ oOrder = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Order :: class ) ; $ blCan = false ; if ( $ oOrder -> load ( $ this -> getEditObjectId ( ) ) ) { $ blCan = $ oOrder -> oxorder__oxstorno -> value == "0" && ! ( $ oOrder -> oxorder__oxsenddate -> value == "0000-00-...
Get information about shipping status
36,112
public function addVariant ( $ sName , $ sValue , $ blDisabled , $ blActive ) { $ sName = trim ( $ sName ) ; if ( ! empty ( $ sName ) || $ sName === '0' ) { $ sKey = $ sValue ; if ( ! isset ( $ this -> _aList [ $ sKey ] ) ) { $ this -> _aList [ $ sKey ] = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Selection :...
Adds given variant info to current variant selection list
36,113
protected function _prepareWhereQuery ( $ aWhere , $ sqlFull ) { $ sQ = parent :: _prepareWhereQuery ( $ aWhere , $ sqlFull ) ; $ sDisplayType = ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'displaytype' ) ; $ sTable = getViewName ( "oxactions" ) ; if ( $ sDisplayType ) { $ s...
Adds active promotion check
36,114
public function getListSorting ( ) { $ aListSorting = parent :: getListSorting ( ) ; if ( array_keys ( $ aListSorting [ 'oxcountry' ] ) === [ 'oxactive' ] ) { $ aListSorting [ 'oxcountry' ] [ $ this -> _getSecondSortFieldName ( ) ] = 'asc' ; } return $ aListSorting ; }
Returns sorting fields array . We extend this method for getting a second order by which will give us not the undefined order behind the active countries .
36,115
public function encrypt ( $ string , $ key ) { $ string = "ox{$string}id" ; $ key = $ this -> _formKey ( $ key , $ string ) ; $ string = $ string ^ $ key ; $ string = base64_encode ( $ string ) ; $ string = str_replace ( "=" , "!" , $ string ) ; return "ox_$string" ; }
Encrypts string with given key .
36,116
protected function _formKey ( $ key , $ string ) { $ key = '_' . $ key ; $ keyLength = ( strlen ( $ string ) / strlen ( $ key ) ) + 5 ; return str_repeat ( $ key , $ keyLength ) ; }
Forms key for use in encoding .
36,117
public function loadNews ( $ iFrom = 0 , $ iLimit = 10 ) { if ( $ iLimit ) { $ this -> setSqlLimit ( $ iFrom , $ iLimit ) ; } $ sNewsViewName = getViewName ( 'oxnews' ) ; $ oBaseObject = $ this -> getBaseObject ( ) ; $ sSelectFields = $ oBaseObject -> getSelectFields ( ) ; if ( $ oUser = $ this -> getUser ( ) ) { $ sSe...
Loads news stored in DB filtered by user groups returns array filled with objects that keeps news data .
36,118
public function getCount ( ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sNewsViewName = getViewName ( 'oxnews' ) ; $ oBaseObject = $ this -> getBaseObject ( ) ; if ( $ oUser = $ this -> getUser ( ) ) { $ sSelect = "select COUNT($sNewsViewName.`oxid`) from $sNewsViewName " ; $ sSelect .= "...
Returns count of all entries .
36,119
public function getUser ( ) { if ( $ this -> _oUser == null ) { $ this -> _oUser = parent :: getUser ( ) ; } return $ this -> _oUser ; }
News list user getter
36,120
public function getRecommLists ( ) { if ( $ this -> _aUserRecommList === null ) { $ oUser = $ this -> getUser ( ) ; if ( $ oUser ) { $ this -> _aUserRecommList = $ oUser -> getUserRecommLists ( ) ; } } return $ this -> _aUserRecommList ; }
Returns user recommlists
36,121
public function getTitle ( ) { $ oProduct = $ this -> getProduct ( ) ; return $ oProduct -> oxarticles__oxtitle -> value . ' ' . $ oProduct -> oxarticles__oxvarselect -> value ; }
Returns the title of the product added to the recommendation list .
36,122
protected function _checkArticleFile ( $ aFileInfo ) { if ( ! isset ( $ aFileInfo [ 'name' ] ) || ! isset ( $ aFileInfo [ 'tmp_name' ] ) ) { throw new \ OxidEsales \ Eshop \ Core \ Exception \ StandardException ( 'EXCEPTION_NOFILE' ) ; } if ( isset ( $ aFileInfo [ 'error' ] ) && $ aFileInfo [ 'error' ] ) { throw new \ ...
Checks if given file is valid upload file
36,123
protected function _getBaseDownloadDirPath ( ) { $ sConfigValue = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'sDownloadsDir' ) ; if ( $ sConfigValue && $ sConfigValue [ 0 ] == DIRECTORY_SEPARATOR ) { return $ sConfigValue ; } if ( $ sConfigValue ) { $ sPath = getShopBasePath ( ) . DIREC...
Return full path of root dir where download files are stored
36,124
public function isUnderDownloadFolder ( ) { $ storageLocation = realpath ( $ this -> getStoreLocation ( ) ) ; if ( $ storageLocation === false ) { return false ; } $ downloadFolder = realpath ( $ this -> _getBaseDownloadDirPath ( ) ) ; return strpos ( $ storageLocation , $ downloadFolder ) !== false ; }
Return true if file is under download folder . Return false if file is above download folder or if file does not exist .
36,125
protected function _getFileLocation ( ) { $ this -> _sRelativeFilePath = '' ; $ sFileHash = $ this -> oxfiles__oxstorehash -> value ; $ sFileName = $ this -> oxfiles__oxfilename -> value ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> isDemoShop ( ) ) { $ sFileName = basename ( $ sFileName ) ; } if ( ...
Returns relative file path from oxConfig sDownloadsDir variable .
36,126
protected function _uploadFile ( $ sSource , $ sTarget ) { $ blDone = move_uploaded_file ( $ sSource , $ sTarget ) ; if ( $ blDone ) { $ blDone = @ chmod ( $ sTarget , 0644 ) ; } return $ blDone ; }
Moves file from source to target and changes file mode . Returns true on success .
36,127
public function delete ( $ sOxId = null ) { $ sOxId = $ sOxId ? $ sOxId : $ this -> getId ( ) ; $ this -> load ( $ sOxId ) ; if ( $ blDeleted = parent :: delete ( $ sOxId ) ) { $ this -> _deleteFile ( ) ; } return $ blDeleted ; }
Deletes oxFile record from DB removes orphan files .
36,128
protected function _deleteFile ( ) { if ( ! $ this -> isUploaded ( ) ) { return false ; } $ sHash = $ this -> oxfiles__oxstorehash -> value ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ iCount = $ oDb -> getOne ( 'SELECT COUNT(*) FROM `oxfiles` WHERE `OXSTOREHASH` = ' . $ oDb -> quote ( $ sH...
Checks if file is not used for other objects . If not used unlink the file .
36,129
public function download ( ) { $ oUtils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; $ sFileName = $ this -> _getFilenameForUrl ( ) ; $ sFileLocations = $ this -> getStoreLocation ( ) ; if ( ! $ this -> exist ( ) || ! $ this -> isUnderDownloadFolder ( ) ) { throw new \ OxidEsales \ Eshop \ Core \ Exceptio...
Supplies the downloadable file for client and exits
36,130
public function hasValidDownloads ( ) { if ( $ this -> _blHasValidDownloads == null ) { $ this -> _blHasValidDownloads = false ; $ sNow = date ( 'Y-m-d H:i:s' , \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ) ; $ sFileId = $ this -> getId ( ) ; $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseP...
Checks if this file has valid ordered downloads
36,131
public function getMaxDownloadsCount ( ) { $ iMaxCount = $ this -> oxfiles__oxmaxdownloads -> value ; if ( $ iMaxCount < 0 ) { $ iMaxCount = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( "iMaxDownloadsCount" ) ; } return $ iMaxCount ; }
Returns max download count of file
36,132
public function getMaxUnregisteredDownloadsCount ( ) { $ iMaxCount = $ this -> oxfiles__oxmaxunregdownloads -> value ; if ( $ iMaxCount < 0 ) { $ iMaxCount = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( "iMaxDownloadsCountUnregistered" ) ; } return $ iMaxCount ; }
Returns max download count of file if user is not registered
36,133
public function getLinkExpirationTime ( ) { $ iExpTime = $ this -> oxfiles__oxlinkexptime -> value ; if ( $ iExpTime < 0 ) { $ iExpTime = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( "iLinkExpirationTime" ) ; } return $ iExpTime ; }
Returns ordered file link expiration time in hours
36,134
public function getDownloadExpirationTime ( ) { $ iExpTime = $ this -> oxfiles__oxdownloadexptime -> value ; if ( $ iExpTime < 0 ) { $ iExpTime = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( "iDownloadExpirationTime" ) ; } return $ iExpTime ; }
Returns download link expiration time in hours after the first download
36,135
public function getReviews ( ) { $ oReview = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getTopActiveView ( ) ; return $ oReview -> getReviews ( ) ; }
Template variable getter . Returns active object s reviews from parent class
36,136
public function getUserVat ( \ OxidEsales \ Eshop \ Application \ Model \ User $ oUser , $ blCacheReset = false ) { $ cacheId = $ oUser -> getId ( ) . '_' . $ oUser -> oxuser__oxcountryid -> value ; if ( ! $ blCacheReset ) { if ( array_key_exists ( $ cacheId , self :: $ _aUserVatCache ) && self :: $ _aUserVatCache [ $ ...
get VAT for user can NOT be null
36,137
protected function _getForeignCountryUserVat ( \ OxidEsales \ Eshop \ Application \ Model \ User $ oUser , \ OxidEsales \ Eshop \ Application \ Model \ Country $ oCountry ) { if ( $ oCountry -> isInEU ( ) ) { if ( $ oUser -> oxuser__oxustid -> value ) { return 0 ; } return false ; } return 0 ; }
get vat for user of a foreign country
36,138
protected function _getVatForArticleCategory ( \ OxidEsales \ Eshop \ Application \ Model \ Article $ oArticle ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sCatT = getViewName ( 'oxcategories' ) ; if ( $ this -> _blCatVatSet === null ) { $ sSelect = "SELECT oxid FROM $sCatT WHERE oxvat IS...
return Vat value for category type assignment only
36,139
public function getArticleVat ( \ OxidEsales \ Eshop \ Application \ Model \ Article $ oArticle ) { startProfile ( "_assignPriceInternal" ) ; if ( ( $ dArticleVat = $ oArticle -> getCustomVAT ( ) ) !== null ) { stopProfile ( "_assignPriceInternal" ) ; return $ dArticleVat ; } if ( ( $ dArticleVat = $ this -> _getVatFor...
get VAT for given article can NOT be null
36,140
public function getArticleUserVat ( \ OxidEsales \ Eshop \ Application \ Model \ Article $ oArticle ) { if ( ( $ oUser = $ oArticle -> getArticleUser ( ) ) ) { return $ this -> getUserVat ( $ oUser ) ; } return false ; }
get article user vat
36,141
public function getFromCache ( $ key ) { $ fileName = $ this -> getCacheFilePath ( $ key ) ; $ value = null ; if ( is_readable ( $ fileName ) ) { $ value = file_get_contents ( $ fileName ) ; if ( $ value == serialize ( false ) ) { return false ; } $ value = unserialize ( $ value ) ; if ( $ value === false ) { $ value =...
Returns cached item value by given key . This method is independent from oxConfig class and does not use database .
36,142
public function setToCache ( $ key , $ value ) { $ fileName = $ this -> getCacheFilePath ( $ key ) ; $ cacheDirectory = $ this -> getCacheDir ( ) ; $ tmpFile = $ cacheDirectory . "/" . basename ( $ fileName ) . uniqid ( '.temp' , true ) . '.txt' ; file_put_contents ( $ tmpFile , serialize ( $ value ) , LOCK_EX ) ; rena...
Caches item value by given key .
36,143
public static function clearCache ( ) { $ tempDirectory = \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Core \ ConfigFile :: class ) -> getVar ( "sCompileDir" ) ; $ mask = $ tempDirectory . "/" . self :: CACHE_FILE_PREFIX . ".*.txt" ; $ files = glob ( $ mask ) ; if ( is_array ( $ files ) ) { fo...
Clears all cache by deleting cached files .
36,144
protected function getCacheDir ( ) { return \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Core \ ConfigFile :: class ) -> getVar ( "sCompileDir" ) ; }
Returns cache directory .
36,145
public function save ( ) { parent :: save ( ) ; $ soxId = $ this -> getEditObjectId ( ) ; $ aParams = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "editval" ) ; $ oNews = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ News :: class ) ; $ iNewsLang = \ OxidEsales \ Eshop \ Core ...
Saves news text .
36,146
protected function _runBasicDiagnostics ( ) { $ aViewData = [ ] ; $ oDiagnostics = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Diagnostics :: class ) ; $ oDiagnostics -> setShopLink ( Registry :: getConfig ( ) -> getConfigParam ( 'sShopURL' ) ) ; $ oDiagnostics -> setEdition ( Registry :: getConfig ( ) -> getF...
Performs main system diagnostic . Shop and module details database health php parameters server information
36,147
public function getParam ( $ name ) { $ request = Registry :: get ( \ OxidEsales \ Eshop \ Core \ Request :: class ) ; return $ request -> getRequestEscapedParameter ( $ name ) ; }
Request parameter getter
36,148
public function getViewName ( $ table , $ languageId = null , $ shopId = null ) { $ config = $ this -> getConfig ( ) ; if ( ! $ config -> getConfigParam ( 'blSkipViewUsage' ) ) { $ language = $ this -> getLanguage ( ) ; $ languageId = $ languageId !== null ? $ languageId : $ language -> getBaseLanguage ( ) ; $ shopId =...
Return the view name of the given table if a view exists otherwise the table name itself . Views usage can be disabled with blSkipViewUsage config option in case admin area is not reachable due to broken views so that they could be regenerated .
36,149
protected function getViewSuffix ( $ table , $ languageId , $ shopId , $ isMultiLang ) { $ viewSuffix = '' ; if ( $ languageId != - 1 && $ isMultiLang ) { $ languageAbbreviation = $ this -> getLanguage ( ) -> getLanguageAbbr ( $ languageId ) ; $ viewSuffix .= "_{$languageAbbreviation}" ; } return $ viewSuffix ; }
Generates view suffix .
36,150
public function getString ( ) { $ sWarning = "" ; if ( $ this -> _blNotCaught ) { $ sWarning .= "--!--NOT CAUGHT--!--" ; } if ( $ this -> _blRenderer ) { $ sWarning .= "--!--RENDERER--!--" ; } $ currentTime = date ( 'Y-m-d H:i:s' , \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ) ; return $ s...
Get complete string dump should be overwritten by excptions extending this exceptions if they introduce new fields
36,151
public function assign ( $ dbRecord ) { parent :: assign ( $ dbRecord ) ; if ( $ this -> oxnews__oxdate ) { $ this -> oxnews__oxdate -> setValue ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> formatDBDate ( $ this -> oxnews__oxdate -> value ) ) ; } }
Assigns object data .
36,152
protected function _update ( ) { $ this -> oxnews__oxdate -> setValue ( \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> formatDBDate ( $ this -> oxnews__oxdate -> value , true ) ) ; parent :: _update ( ) ; }
Updates object information in DB .
36,153
protected function _insert ( ) { if ( ! $ this -> oxnews__oxdate || \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> isEmptyDate ( $ this -> oxnews__oxdate -> value ) ) { $ this -> oxnews__oxdate = new \ OxidEsales \ Eshop \ Core \ Field ( date ( 'Y-m-d' ) ) ; } else { $ this -> oxnews__oxdate = new \ Oxid...
Inserts object details to DB returns true on success .
36,154
public function getLongDesc ( ) { $ oUtilsView = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) ; return $ oUtilsView -> parseThroughSmarty ( $ this -> oxnews__oxlongdesc -> getRawValue ( ) , $ this -> getId ( ) . $ this -> getLanguage ( ) , null , true ) ; }
get long description parsed through smarty
36,155
public function decrypt ( $ string , $ key ) { $ key = $ this -> _formKey ( $ key , $ string ) ; $ string = substr ( $ string , 3 ) ; $ string = str_replace ( '!' , '=' , $ string ) ; $ string = base64_decode ( $ string ) ; $ string = $ string ^ $ key ; return substr ( $ string , 2 , - 2 ) ; }
Decrypts string with given key .
36,156
public static function instanceExists ( $ className ) { $ key = self :: getStorageKey ( $ className ) ; return isset ( self :: $ instances [ $ key ] ) ; }
Check if an instance of a given class is set in the registry
36,157
public static function getStorageKey ( $ className ) { $ key = $ className ; if ( ! \ OxidEsales \ Eshop \ Core \ NamespaceInformationProvider :: isNamespacedClass ( $ className ) ) { $ bcMap = self :: getBackwardsCompatibilityClassMap ( ) ; $ key = isset ( $ bcMap [ strtolower ( $ key ) ] ) ? $ bcMap [ strtolower ( $ ...
Translate a given old class name like oxconfig into a storage key as known by the Registry . If a new class name is used the method just returns it as it is .
36,158
protected static function getObject ( $ className ) { if ( ! isset ( self :: $ instances [ $ className ] ) ) { self :: $ instances [ $ className ] = self :: createObject ( $ className ) ; } return self :: $ instances [ $ className ] ; }
Return a well known object from the registry
36,159
private function prepareRatingAndReviewPropertiesData ( $ reviewAndRatingList ) { foreach ( $ reviewAndRatingList as $ reviewAndRating ) { $ this -> setObjectTitleToReviewAndRating ( $ reviewAndRating ) ; $ this -> formatReviewText ( $ reviewAndRating ) ; $ this -> formatReviewAndRatingDate ( $ reviewAndRating ) ; } }
Prepare RatingAndReview properties data .
36,160
private function formatReviewText ( ReviewAndRating $ reviewAndRating ) { $ preparedText = htmlspecialchars ( $ reviewAndRating -> getReviewText ( ) ) ; $ reviewAndRating -> setReviewText ( $ preparedText ) ; }
Formats Review text .
36,161
private function formatReviewAndRatingDate ( ReviewAndRating $ reviewAndRating ) { $ formattedDate = Registry :: getUtilsDate ( ) -> formatDBDate ( $ reviewAndRating -> getCreatedAt ( ) ) ; $ reviewAndRating -> setCreatedAt ( $ formattedDate ) ; }
Formats ReviewAndRating date .
36,162
private function setObjectTitleToReviewAndRating ( ReviewAndRating $ reviewAndRating ) { $ title = $ this -> getObjectTitle ( $ reviewAndRating -> getObjectType ( ) , $ reviewAndRating -> getObjectId ( ) ) ; $ reviewAndRating -> setObjectTitle ( $ title ) ; }
Sets object title to ReviewAndRating .
36,163
private function getObjectTitle ( $ type , $ objectId ) { $ objectModel = $ this -> getObjectModel ( $ type ) ; $ objectModel -> load ( $ objectId ) ; $ fieldName = $ this -> getObjectTitleFieldName ( $ type ) ; $ field = $ objectModel -> $ fieldName ; return $ field -> value ; }
Returns object title .
36,164
private function getObjectModel ( $ type ) { if ( $ type === 'oxarticle' ) { $ model = oxNew ( Article :: class ) ; } if ( $ type === 'oxrecommlist' ) { $ model = oxNew ( RecommendationList :: class ) ; } if ( ! isset ( $ model ) ) { throw new ReviewAndRatingObjectTypeException ( ) ; } return $ model ; }
Returns object model .
36,165
private function getObjectTitleFieldName ( $ type ) { if ( $ type === 'oxarticle' ) { $ fieldName = 'oxarticles__oxtitle' ; } if ( $ type === 'oxrecommlist' ) { $ fieldName = 'oxrecommlists__oxtitle' ; } if ( ! isset ( $ fieldName ) ) { throw new ReviewAndRatingObjectTypeException ( ) ; } return $ fieldName ; }
Returns field name of the object title .
36,166
protected function _getParentProduct ( $ parentId ) { if ( $ parentId && $ this -> _oParentProd === null ) { $ this -> _oParentProd = false ; $ article = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; if ( ( $ article -> load ( $ parentId ) ) ) { $ this -> _processProduct ( $ article ) ; $ th...
Returns current product parent article object if it is available
36,167
protected function _processProduct ( $ article ) { $ article -> setLinkType ( $ this -> getLinkType ( ) ) ; if ( $ dynamicParameters = $ this -> _getAddUrlParams ( ) ) { $ article -> appendLink ( $ dynamicParameters ) ; } }
Processes product by setting link type and in case list type is search adds search parameters to details link
36,168
public function addToRecomm ( ) { if ( ! \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> checkSessionChallenge ( ) ) { return ; } if ( ! $ this -> getViewConfig ( ) -> getShowListmania ( ) ) { return ; } $ recommendationText = trim ( ( string ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getR...
Adds article to selected recommendation list
36,169
public function getProduct ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ utils = \ OxidEsales \ Eshop \ Core \ Registry :: getUtils ( ) ; if ( $ this -> _oProduct === null ) { $ config -> setConfigParam ( 'blLoadVariants' , true ) ; $ articleId = \ OxidEsales \ Eshop \ Core \ Registry :: ...
Returns current product
36,170
public function getLinkType ( ) { if ( $ this -> _iLinkType === null ) { $ listType = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'listtype' ) ; if ( 'vendor' == $ listType ) { $ this -> _iLinkType = OXARTICLE_LINKTYPE_VENDOR ; } elseif ( 'manufacturer' == $ listType ) { $ this -> _...
Returns current view link type
36,171
public function getPictureGallery ( ) { if ( $ this -> _aPicGallery === null ) { $ this -> _aPicGallery = $ this -> getPicturesProduct ( ) -> getPictureGallery ( ) ; } return $ this -> _aPicGallery ; }
Template variable getter . Returns picture gallery of current article
36,172
public function getSelectLists ( ) { if ( $ this -> _aSelectLists === null ) { $ this -> _aSelectLists = false ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadSelectLists' ) ) { $ this -> _aSelectLists = $ this -> getProduct ( ) -> getSelectLists ( ) ; } } return $ this ->...
Template variable getter . Returns selectLists of current article
36,173
public function getReviews ( ) { if ( $ this -> _aReviews === null ) { $ this -> _aReviews = false ; if ( \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'bl_perfLoadReviews' ) ) { $ this -> _aReviews = $ this -> getProduct ( ) -> getReviews ( ) ; } } return $ this -> _aReviews ; }
Template variable getter . Returns reviews of current article
36,174
public function getCrossSelling ( ) { if ( $ this -> _oCrossSelling === null ) { $ this -> _oCrossSelling = false ; if ( $ article = $ this -> getProduct ( ) ) { $ this -> _oCrossSelling = $ article -> getCrossSelling ( ) ; } } return $ this -> _oCrossSelling ; }
Template variable getter . Returns cross selling
36,175
public function getSimilarProducts ( ) { if ( $ this -> _oSimilarProducts === null ) { $ this -> _oSimilarProducts = false ; if ( $ article = $ this -> getProduct ( ) ) { $ this -> _oSimilarProducts = $ article -> getSimilarProducts ( ) ; } } return $ this -> _oSimilarProducts ; }
Template variable getter . Returns similar article list
36,176
public function getAccessoires ( ) { if ( $ this -> _oAccessoires === null ) { $ this -> _oAccessoires = false ; if ( $ article = $ this -> getProduct ( ) ) { $ this -> _oAccessoires = $ article -> getAccessoires ( ) ; } } return $ this -> _oAccessoires ; }
Template variable getter . Returns accessories of article
36,177
public function noIndex ( ) { $ listType = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'listtype' ) ; if ( $ listType && ( 'vendor' == $ listType || 'manufacturer' == $ listType ) ) { return $ this -> _iViewIndexState = VIEW_INDEXSTATE_NOINDEXFOLLOW ; } return parent :: noIndex ( ) ...
If product details are accessed by vendor url view must not be indexable
36,178
public function getTitle ( ) { if ( $ article = $ this -> getProduct ( ) ) { $ articleTitle = $ article -> oxarticles__oxtitle -> value ; $ variantSelectionId = $ article -> oxarticles__oxvarselect -> value ; $ variantSelectionValue = $ variantSelectionId ? ' ' . $ variantSelectionId : '' ; return $ articleTitle . $ va...
Returns current view title . Default is null
36,179
public function getVariantSelections ( ) { $ article = $ this -> getProduct ( ) ; $ variantSelectionListId = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( "varselid" ) ; if ( ( $ articleParent = $ this -> _getParentProduct ( $ article -> oxarticles__oxparentid -> value ) ) ) { return ...
Returns variant selection
36,180
public function getPicturesProduct ( ) { $ variantSelections = $ this -> getVariantSelections ( ) ; if ( $ variantSelections && $ variantSelections [ 'oActiveVariant' ] && ! $ variantSelections [ 'blPerfectFit' ] ) { return $ variantSelections [ 'oActiveVariant' ] ; } return $ this -> getProduct ( ) ; }
Returns pictures product object
36,181
public function getRDFaNormalizedRating ( ) { $ config = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ minRating = $ config -> getConfigParam ( "iRDFaMinRating" ) ; $ maxRating = $ config -> getConfigParam ( "iRDFaMaxRating" ) ; $ article = $ this -> getProduct ( ) ; $ count = $ article -> oxarticles__oxr...
Sets normalized rating
36,182
public function getRDFaValidityPeriod ( $ configVariableName ) { if ( $ configVariableName ) { $ validity = [ ] ; $ days = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( $ configVariableName ) ; $ from = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsDate ( ) -> getTime ( ) ; $ through =...
Sets and returns validity period of given object
36,183
public function getBundleArticle ( ) { $ article = $ this -> getProduct ( ) ; if ( $ article && $ article -> oxarticles__oxbundleid -> value ) { $ bundle = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Article :: class ) ; $ bundle -> load ( $ article -> oxarticles__oxbundleid -> value ) ; return $ bundle ; } re...
Returns bundle product
36,184
public function getRDFaPaymentMethods ( ) { $ price = $ this -> getProduct ( ) -> getPrice ( ) -> getBruttoPrice ( ) ; $ paymentList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ PaymentList :: class ) ; $ paymentList -> loadRDFaPaymentList ( $ price ) ; return $ paymentList ; }
Gets accepted payment methods
36,185
public function getRDFaDeliverySetMethods ( ) { $ deliverySetList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ DeliverySetList :: class ) ; $ deliverySetList -> loadRDFaDeliverySetList ( ) ; return $ deliverySetList ; }
Returns delivery methods with assigned delivery sets .
36,186
public function getProductsDeliveryList ( ) { $ article = $ this -> getProduct ( ) ; $ deliveryList = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ DeliveryList :: class ) ; $ deliveryList -> loadDeliveryListForProduct ( $ article ) ; return $ deliveryList ; }
Template variable getter . Returns delivery list for current product
36,187
public function getSortingParameters ( ) { $ sorting = $ this -> getSorting ( $ this -> getSortIdent ( ) ) ; if ( ! is_array ( $ sorting ) ) { return null ; } return implode ( '|' , $ sorting ) ; }
Returns sorting parameters separated by |
36,188
protected function _getVendorBreadCrumb ( ) { $ paths = [ ] ; $ vendorPath = [ ] ; $ vendor = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Vendor :: class ) ; $ vendor -> load ( 'root' ) ; $ vendorPath [ 'link' ] = $ vendor -> getLink ( ) ; $ vendorPath [ 'title' ] = $ vendor -> oxvendor__oxtitle -> value ; $ p...
Vendor bread crumb
36,189
protected function _getRecommendationListBredCrumb ( ) { $ paths = [ ] ; $ recommListPath = [ ] ; $ baseLanguageId = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; $ recommListPath [ 'title' ] = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> translateString ( 'LISTMANIA' , $ ba...
Recommendation list bread crumb
36,190
protected function _getSearchBreadCrumb ( ) { $ paths = [ ] ; $ searchPath = [ ] ; $ baseLanguageId = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getBaseLanguage ( ) ; $ translatedString = \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> translateString ( 'SEARCH_RESULT' , $ baseLanguageId , false ...
Search bread crumb
36,191
protected function _getCategoryBreadCrumb ( ) { $ paths = [ ] ; $ categoryTree = $ this -> getCatTreePath ( ) ; if ( $ categoryTree ) { foreach ( $ categoryTree as $ category ) { $ categoryPath = [ ] ; $ categoryPath [ 'link' ] = $ category -> getLink ( ) ; $ categoryPath [ 'title' ] = $ category -> oxcategories__oxtit...
Category bread crumb
36,192
public function getReviewsByUserId ( $ userId ) { $ queryBuilder = $ this -> queryBuilderFactory -> create ( ) ; $ queryBuilder -> select ( 'r.*' ) -> from ( 'oxreviews' , 'r' ) -> where ( 'r.oxuserid = :userId' ) -> orderBy ( 'r.oxcreate' , 'DESC' ) -> setParameter ( 'userId' , $ userId ) ; return $ this -> mapReviews...
Returns User Reviews .
36,193
private function mapReviews ( $ reviewsData ) { $ reviews = new ArrayCollection ( ) ; foreach ( $ reviewsData as $ reviewData ) { $ review = new Review ( ) ; $ reviews [ ] = $ this -> mapper -> map ( $ review , $ reviewData ) ; } return $ reviews ; }
Maps rating data from database to Reviews Collection .
36,194
protected function _prepareWhereQuery ( $ aWhere , $ sqlFull ) { $ sQ = parent :: _prepareWhereQuery ( $ aWhere , $ sqlFull ) ; $ sFolder = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'folder' ) ; $ sViewName = getviewName ( "oxcontents" ) ; if ( $ sFolder == 'CMSFOLDER_NONE' || $ s...
Adding folder check and empty folder field check .
36,195
protected function _loadArticles ( $ oManufacturer ) { $ sManufacturerId = $ oManufacturer -> getId ( ) ; $ iNrofCatArticles = ( int ) \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getConfigParam ( 'iNrofCatArticles' ) ; $ iNrofCatArticles = $ iNrofCatArticles ? $ iNrofCatArticles : 1 ; $ oArtList = oxNew ...
Loads and returns article list of active Manufacturer .
36,196
public function getActiveCategory ( ) { if ( $ this -> _oActCategory === null ) { $ this -> _oActCategory = false ; if ( ( $ oManufacturerTree = $ this -> getManufacturerTree ( ) ) ) { if ( $ oManufacturer = $ this -> getActManufacturer ( ) ) { $ this -> _oActCategory = $ oManufacturer ; } } } return $ this -> _oActCat...
Template variable getter . Returns active Manufacturer
36,197
private function _formMarks ( $ sCurrentMark ) { $ oBasket = $ this -> _getBasket ( ) ; $ aMarks = [ ] ; if ( $ oBasket -> hasSkipedDiscount ( ) ) { $ aMarks [ 'skippedDiscount' ] = $ sCurrentMark ; $ sCurrentMark .= '*' ; } if ( $ oBasket -> hasArticlesWithDownloadableAgreement ( ) ) { $ aMarks [ 'downloadable' ] = $ ...
Forms marks for articles .
36,198
public function getMinDPrice ( ) { $ dMinPrice = $ this -> getDPrice ( ) ; $ aVariants = $ this -> getMdSubvariants ( ) ; foreach ( $ aVariants as $ oVariant ) { $ dMinVariantPrice = $ oVariant -> getMinDPrice ( ) ; if ( is_null ( $ dMinPrice ) ) { $ dMinPrice = $ dMinVariantPrice ; } if ( ! is_null ( $ dMinVariantPric...
Returns min price recursively selected from full subvariant tree .
36,199
public function getMaxDepth ( ) { $ aSubvariants = $ this -> getMdSubvariants ( ) ; if ( ! count ( $ aSubvariants ) ) { return 0 ; } $ iMaxDepth = 0 ; foreach ( $ aSubvariants as $ oSubvariant ) { if ( $ oSubvariant -> getMaxDepth ( ) > $ iMaxDepth ) { $ iMaxDepth = $ oSubvariant -> getMaxDepth ( ) ; } } return $ iMaxD...
Gets max subvariant depth . 0 means no deeper subvariants .