Class cArticleCollector
The article collector returns you a list of articles, which destination you can choose. You have the ability to limit, sort and filter the article list.
You can configure the article collector with an options array, which can include the following configuration.
- idcat - category ID
- categories - array with multiple category IDs
- lang - language ID, active language if ommited
- client - client ID, active client if ommited
- artspecs - array of article specifications, which should be considered
- offline - include offline article in the collection, defaults to false
- offlineonly - only list offline articles, defaults to false
- start - include start article in the collection, defaults to false
- startonly - only list start articles, defaults to false
- order - articles will be ordered by this property, defaults to created
- direction - order direction, ASC or DESC for ascending/descending, defaults to DESC
- limit - limit numbers of articles in collection, default to 0 (unlimited)
TODO: Use generic DB instead of SQL queries
- cArticleCollector implements SeekableIterator, Countable
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Dominik Ziegler
Located at classes/class.article.collector.php
public
|
#
__construct( array $options = array() )
Constructor. If options are defined, the loading process is automatically initiated. |
public
|
#
setOptions( array $options )
Setter for the collector options. Validates incoming options and sets the default of the missing options. |
public
|
|
public
|
#
startArticle( )
Compatibility method for old ArticleCollection class. Returns the start article of a category. Does work only if one category was requested. |
public
boolean|
|
|
public
|
#
setResultPerPage( integer $resPerPage )
Compatibility method for old ArticleCollection. Split the article results into pages of a given size. Example: Article Collection with 5 articles [0] => 250 [1] => 251 [2] => 253 [3] => 254 [4] => 255 $collection->setResultPerPage(2) Would split the results into 3 pages [0] => [0] => 250 [1] => 251 [1] => [0] => 253 [1] => 254 [2] => [0] => 255 A page can be selected with $collection->setPage(int page) |
public
|
|
public
|
|
public
|
|
public
mixed
|
|
public
integer
|
|
public
|
|
public
boolean
|
|
public
integer
|
protected
array
|
$_options | array() |
#
Options for the collector. |
protected
array
|
$_articles | array() |
#
Loaded articles. |
protected
array
|
$_pages | array() |
#
Total paging data. |
protected
array
|
$_startArticles | array() |
#
Start articles of the requested categories. |
protected
integer
|
$_currentPosition | 0 |
#
Current position for the iterator. |