OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Application\Model\ArticleList Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Application\Model\ArticleList:
+ Collaboration diagram for OxidEsales\EshopCommunity\Application\Model\ArticleList:

Public Member Functions

 setCustomSorting ($sSorting)
 
 enableSelectLists ()
 
 selectString ($sql, array $parameters=[])
 
 getHistoryArticles ()
 
 setHistoryArticles ($aArticlesIds)
 
 loadHistoryArticles ($sArtId, $iCnt=4)
 
 sortByIds ($aIds)
 
 loadNewestArticles ($iLimit=null)
 
 loadTop5Articles ($iLimit=null)
 
 loadActionArticles ($sActionID, $iLimit=null)
 
 loadArticleCrossSell ($sArticleId)
 
 loadArticleAccessoires ($sArticleId)
 
 loadCategoryIds ($sCatId, $aSessionFilter)
 
 loadCategoryArticles ($sCatId, $aSessionFilter, $iLimit=null)
 
 loadRecommArticles ($sRecommId, $sArticlesFilter=null)
 
 loadRecommArticleIds ($sRecommId, $sArticlesFilter)
 
 loadSearchIds ($sSearchStr='', $sSearchCat='', $sSearchVendor='', $sSearchManufacturer='')
 
 loadPriceIds ($dPriceFrom, $dPriceTo)
 
 loadPriceArticles ($dPriceFrom, $dPriceTo, $oCategory=null)
 
 loadVendorIDs ($sVendorId)
 
 loadManufacturerIDs ($sManufacturerId)
 
 loadVendorArticles ($sVendorId, $oVendor=null)
 
 loadManufacturerArticles ($sManufacturerId, $oManufacturer=null)
 
 loadIds ($aIds)
 
 loadOrderArticles ($aOrders)
 
 loadStockRemindProducts ($aBasketContents)
 
 renewPriceUpdateTime ()
 
 updateUpcomingPrices ($blForceUpdate=false)
 

Protected Member Functions

 _sortByOrderMapCallback ($key1, $key2)
 
 _getArticleSelect ($sRecommId, $sArticlesFilter=null)
 
 _createIdListFromSql ($sSql)
 
 _getFilterIdsSql ($sCatId, $aFilter)
 
 _getFilterSql ($sCatId, $aFilter)
 
 _getCategorySelect ($sFields, $sCatId, $aSessionFilter)
 
 _getCategoryCountSelect ($sCatId, $aSessionFilter)
 
 _getSearchSelect ($sSearchString)
 
 _getPriceSelect ($dPriceFrom, $dPriceTo)
 
 _getVendorSelect ($sVendorId)
 
 _getManufacturerSelect ($sManufacturerId)
 
 _canUpdatePrices ()
 
 fetchNextUpdateTime ()
 
 getQueryToFetchNextUpdateTime ()
 
 updateOxArticles ($sCurrUpdateTime, $oDb)
 
 getQueryToUpdateOxArticle ($sCurrUpdateTime)
 
 updateArticles ($aUpdatedArticleIds)
 
 getDescriptionJoin ()
 
 getSearchTableName ($table, $field)
 

Protected Attributes

 $_sCustomSorting
 
 $_sObjectsInListName = 'oxarticle'
 
 $_blLoadSelectLists = false
 

Detailed Description

Article list manager. Collects list of article according to collection rules (categories, etc.).

Member Function Documentation

◆ _canUpdatePrices()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_canUpdatePrices ( )
protected

Checks if price update can be executed - current time > next price update time

Returns
bool

◆ _createIdListFromSql()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_createIdListFromSql (   $sSql)
protected

fills the list simply with keys of the oxid and the position as value for the given sql

Parameters
string$sSqlSQL select

◆ _getArticleSelect()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getArticleSelect (   $sRecommId,
  $sArticlesFilter = null 
)
protected

Returns the appropriate SQL select

Deprecated:
since v5.3 (2016-06-17); Listmania will be moved to an own module.
Parameters
string$sRecommIdRecommlist ID
string$sArticlesFilterAdditional filter for recommlist's items
Returns
string

◆ _getCategoryCountSelect()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getCategoryCountSelect (   $sCatId,
  $aSessionFilter 
)
protected

Creates SQL Statement to load Articles Count, etc.

Parameters
string$sCatIdCategory tree ID
array$aSessionFilterLike array ( catid => array( attrid => value,...))
Returns
string SQL

◆ _getCategorySelect()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getCategorySelect (   $sFields,
  $sCatId,
  $aSessionFilter 
)
protected

Creates SQL Statement to load Articles, etc.

Parameters
string$sFieldsFields which are loaded e.g. "oxid" or "*" etc.
string$sCatIdCategory tree ID
array$aSessionFilterLike array ( catid => array( attrid => value,...))
Returns
string SQL

◆ _getFilterIdsSql()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getFilterIdsSql (   $sCatId,
  $aFilter 
)
protected

Returns sql to fetch ids of articles fitting current filter

Parameters
string$sCatIdcategory id
array$aFilterfilters for this category
Returns
string

◆ _getFilterSql()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getFilterSql (   $sCatId,
  $aFilter 
)
protected

Returns filtered articles sql "oxid in (filtered ids)" part

Parameters
string$sCatIdcategory id
array$aFilterfilters for this category
Returns
string

◆ _getManufacturerSelect()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getManufacturerSelect (   $sManufacturerId)
protected

Builds Manufacturer select SQL statement

Parameters
string$sManufacturerIdManufacturer ID
Returns
string

◆ _getPriceSelect()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getPriceSelect (   $dPriceFrom,
  $dPriceTo 
)
protected

Builds SQL for selecting articles by price

Parameters
double$dPriceFromStarting price
double$dPriceToMax price
Returns
string

◆ _getSearchSelect()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getSearchSelect (   $sSearchString)
protected

Forms and returns SQL query string for search in DB.

Parameters
string$sSearchStringsearching string
Returns
string

◆ _getVendorSelect()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_getVendorSelect (   $sVendorId)
protected

Builds vendor select SQL statement

Parameters
string$sVendorIdVendor ID
Returns
string

◆ _sortByOrderMapCallback()

OxidEsales\EshopCommunity\Application\Model\ArticleList::_sortByOrderMapCallback (   $key1,
  $key2 
)
protected

callback function only used from sortByIds

Parameters
string$key11st key
string$key22nd key
See also
oxArticleList::sortByIds
Returns
int

◆ enableSelectLists()

OxidEsales\EshopCommunity\Application\Model\ArticleList::enableSelectLists ( )

Call enableSelectLists() for loading select lists in lst articles

◆ fetchNextUpdateTime()

OxidEsales\EshopCommunity\Application\Model\ArticleList::fetchNextUpdateTime ( )
protected

Method fetches next update time for renewing price update time.

Returns
string

◆ getDescriptionJoin()

OxidEsales\EshopCommunity\Application\Model\ArticleList::getDescriptionJoin ( )
protected

Get description join. Needed in case of searching for data in table oxartextends or its views.

Returns
string

◆ getHistoryArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::getHistoryArticles ( )

Get history article id's from session or cookie.

Returns
array

◆ getQueryToFetchNextUpdateTime()

OxidEsales\EshopCommunity\Application\Model\ArticleList::getQueryToFetchNextUpdateTime ( )
protected

Returns query to fetch next update time.

Returns
string

◆ getQueryToUpdateOxArticle()

OxidEsales\EshopCommunity\Application\Model\ArticleList::getQueryToUpdateOxArticle (   $sCurrUpdateTime)
protected

Method returns query to update article.

Parameters
string$sCurrUpdateTime
Returns
string

◆ getSearchTableName()

OxidEsales\EshopCommunity\Application\Model\ArticleList::getSearchTableName (   $table,
  $field 
)
protected

Get search table name. Needed in case of searching for data in table oxartextends or its views.

Parameters
string$table
string$fieldChose table depending on field.
Returns
string

◆ loadActionArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadActionArticles (   $sActionID,
  $iLimit = null 
)

Loads shop AktionArticles.

Parameters
string$sActionIDAction id
int$iLimitSelect limit
Returns
null

◆ loadArticleAccessoires()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadArticleAccessoires (   $sArticleId)

Loads article accessories

Parameters
string$sArticleIdArticle id
Returns
null

◆ loadArticleCrossSell()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadArticleCrossSell (   $sArticleId)

Loads article cross selling

Parameters
string$sArticleIdArticle id
Returns
null

◆ loadCategoryArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadCategoryArticles (   $sCatId,
  $aSessionFilter,
  $iLimit = null 
)

Loads articles for the give Category

Parameters
string$sCatIdCategory tree ID
array$aSessionFilterLike array ( catid => array( attrid => value,...))
int$iLimitLimit
Returns
integer total Count of Articles in this Category

◆ loadCategoryIds()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadCategoryIds (   $sCatId,
  $aSessionFilter 
)

Loads only ID's and create Fake objects for cmp_categories.

Parameters
string$sCatIdCategory tree ID
array$aSessionFilterLike array ( catid => array( attrid => value,...))

◆ loadHistoryArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadHistoryArticles (   $sArtId,
  $iCnt = 4 
)

Loads up to 4 history (normally recently seen) articles from session, and adds $sArtId to history. Returns article id array.

Parameters
string$sArtIdArticle ID
int$iCntproduct count

◆ loadIds()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadIds (   $aIds)

Load the list by article ids

Parameters
array$aIdsArticle ID array
Returns
null;

◆ loadManufacturerArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadManufacturerArticles (   $sManufacturerId,
  $oManufacturer = null 
)

Loads articles that belongs to Manufacturer, passed by parameter $sManufacturerId. Returns count of selected articles.

Parameters
string$sManufacturerIdManufacturer ID
object$oManufacturerActive Manufacturer object
Returns
integer

◆ loadManufacturerIDs()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadManufacturerIDs (   $sManufacturerId)

Loads Products for specified Manufacturer

Parameters
string$sManufacturerIdManufacturer id

◆ loadNewestArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadNewestArticles (   $iLimit = null)

Loads newest shops articles from DB.

Parameters
int$iLimitSelect limit

◆ loadOrderArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadOrderArticles (   $aOrders)

Loads the article list by orders ids

Parameters
array$aOrdersuser orders array
Returns
null;

◆ loadPriceArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadPriceArticles (   $dPriceFrom,
  $dPriceTo,
  $oCategory = null 
)

Loads articles, that price is bigger than passed $dPriceFrom and smaller than passed $dPriceTo. Returns count of selected articles.

Parameters
double$dPriceFromPrice from
double$dPriceToPrice to
object$oCategoryActive category object
Returns
integer

◆ loadPriceIds()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadPriceIds (   $dPriceFrom,
  $dPriceTo 
)

Loads Id list of appropriate price products

Parameters
float$dPriceFromStarting price
float$dPriceToMax price

◆ loadRecommArticleIds()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadRecommArticleIds (   $sRecommId,
  $sArticlesFilter 
)

Loads only ID's and create Fake objects.

Deprecated:
since v5.3 (2016-06-17); Listmania will be moved to an own module.
Parameters
string$sRecommIdRecommlist ID
string$sArticlesFilterAdditional filter for recommlist's items

◆ loadRecommArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadRecommArticles (   $sRecommId,
  $sArticlesFilter = null 
)

Loads articles for the recommlist

Deprecated:
since v5.3 (2016-06-17); Listmania will be moved to an own module.
Parameters
string$sRecommIdRecommlist ID
string$sArticlesFilterAdditional filter for recommlist's items

◆ loadSearchIds()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadSearchIds (   $sSearchStr = '',
  $sSearchCat = '',
  $sSearchVendor = '',
  $sSearchManufacturer = '' 
)

Loads only ID's and create Fake objects for cmp_categories.

Parameters
string$sSearchStrSearch string
string$sSearchCatSearch within category
string$sSearchVendorSearch within vendor
string$sSearchManufacturerSearch within manufacturer

◆ loadStockRemindProducts()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadStockRemindProducts (   $aBasketContents)

Loads list of low stock state products

Parameters
array$aBasketContentsproduct ids array

◆ loadTop5Articles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadTop5Articles (   $iLimit = null)

Load top 5 articles

Parameters
int$iLimitSelect limit

◆ loadVendorArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadVendorArticles (   $sVendorId,
  $oVendor = null 
)

Loads articles that belongs to vendor, passed by parameter $sVendorId. Returns count of selected articles.

Parameters
string$sVendorIdVendor ID
object$oVendorActive vendor object
Returns
integer

◆ loadVendorIDs()

OxidEsales\EshopCommunity\Application\Model\ArticleList::loadVendorIDs (   $sVendorId)

Loads Products for specified vendor

Parameters
string$sVendorIdVendor id

◆ renewPriceUpdateTime()

OxidEsales\EshopCommunity\Application\Model\ArticleList::renewPriceUpdateTime ( )

Calculates, updates and returns next price renew time

Returns
int

◆ selectString()

OxidEsales\EshopCommunity\Application\Model\ArticleList::selectString (   $sql,
array  $parameters = [] 
)

In addition to the parent method, this method includes profiling.

Parameters
string$sqlSQL select statement or prepared statement
array$parametersParameters to be used in a prepared statement

◆ setCustomSorting()

OxidEsales\EshopCommunity\Application\Model\ArticleList::setCustomSorting (   $sSorting)

Set Custom Sorting, simply an order by....

Parameters
string$sSortingCustom sorting

◆ setHistoryArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::setHistoryArticles (   $aArticlesIds)

Set history article id's to session or cookie

Parameters
array$aArticlesIdsarray history article ids

◆ sortByIds()

OxidEsales\EshopCommunity\Application\Model\ArticleList::sortByIds (   $aIds)

sort this list by given order.

Parameters
array$aIdsordered ids

◆ updateArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::updateArticles (   $aUpdatedArticleIds)
protected

Method is used for overloading.

Parameters
array$aUpdatedArticleIds

◆ updateOxArticles()

OxidEsales\EshopCommunity\Application\Model\ArticleList::updateOxArticles (   $sCurrUpdateTime,
  $oDb 
)
protected

Updates article.

Parameters
string$sCurrUpdateTime
DatabaseInterface$oDb
Returns
mixed

◆ updateUpcomingPrices()

OxidEsales\EshopCommunity\Application\Model\ArticleList::updateUpcomingPrices (   $blForceUpdate = false)

Updates prices where new price > 0, update time != '0000-00-00 00:00:00' and <= CURRENT_TIMESTAMP. Returns update execution state (result of \OxidEsales\Eshop\Core\DatabaseProvider::execute())

Parameters
bool$blForceUpdateif true, forces price update without timeout check, default value is FALSE
Exceptions
Exception
Returns
mixed

Member Data Documentation

◆ $_blLoadSelectLists

OxidEsales\EshopCommunity\Application\Model\ArticleList::$_blLoadSelectLists = false
protected

◆ $_sCustomSorting

OxidEsales\EshopCommunity\Application\Model\ArticleList::$_sCustomSorting
protected

◆ $_sObjectsInListName

OxidEsales\EshopCommunity\Application\Model\ArticleList::$_sObjectsInListName = 'oxarticle'
protected

The documentation for this class was generated from the following file: