Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cApiPathresolveCacheHelper
  • cArray
  • cArticleCollector
  • cDirHandler
  • cFileHandler
  • cHTMLInputSelectElement
  • cIterator
  • cString
  • cZipArchive
  • UI_Config_Table
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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
Package: Core\Util
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
Methods summary
public
# __construct( array $options = array() )

Constructor. If options are defined, the loading process is automatically initiated.

Constructor. If options are defined, the loading process is automatically initiated.

Parameters

$options
array
$options array with options for the collector (optional, default: empty array)
public
# setOptions( array $options )

Setter for the collector options. Validates incoming options and sets the default of the missing options.

Setter for the collector options. Validates incoming options and sets the default of the missing options.

Parameters

$options
array
$options array with option
public
# loadArticles( )

Executes the article search with the given options.

Executes the article search with the given options.

Throws

cUnexpectedValueException
public cApiArticleLanguage
# startArticle( )

Compatibility method for old ArticleCollection class. Returns the start article of a category. Does work only if one category was requested.

Compatibility method for old ArticleCollection class. Returns the start article of a category. Does work only if one category was requested.

Returns

cApiArticleLanguage

Throws

cBadMethodCallException
public boolean
# nextArticle( )

Compatibility method for old ArticleCollection class. Returns the next article.

Compatibility method for old ArticleCollection class. Returns the next article.

Returns

boolean
cApiArticleLanguage
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)

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)

Parameters

$resPerPage
integer
$resPerPage
public
# setPage( integer $page )

Compatibility method for old ArticleCollection. Select a page if the results was divided before. $collection->setResultPerPage(2); $collection->setPage(1); // Iterate through all articles of page two while ($art = $collection->nextArticle()) { ... }

Compatibility method for old ArticleCollection. Select a page if the results was divided before. $collection->setResultPerPage(2); $collection->setPage(1); // Iterate through all articles of page two while ($art = $collection->nextArticle()) { ... }

Parameters

$page
integer
$page The page of the article collection
public
# seek( integer $position )

Seeks a specific position in the loaded articles.

Seeks a specific position in the loaded articles.

Parameters

$position
integer
$position position to load

Throws

cOutOfBoundsException

Implementation of

SeekableIterator::seek()
public
# rewind( )

Method "rewind" of the implemented iterator.

Method "rewind" of the implemented iterator.

Implementation of

Iterator::rewind()
public mixed
# current( )

Method "current" of the implemented iterator.

Method "current" of the implemented iterator.

Returns

mixed

Implementation of

Iterator::current()
public integer
# key( )

Method "key" of the implemented iterator.

Method "key" of the implemented iterator.

Returns

integer
mixed

Implementation of

Iterator::key()
public
# next( )

Method "next" of the implemented iterator.

Method "next" of the implemented iterator.

Implementation of

Iterator::next()
public boolean
# valid( )

Method "valid" of the implemented iterator.

Method "valid" of the implemented iterator.

Returns

boolean

Implementation of

Iterator::valid()
public integer
# count( )

Method "count" of the implemented Countable interface. Returns the amount of all loaded articles.

Method "count" of the implemented Countable interface. Returns the amount of all loaded articles.

Returns

integer

Implementation of

Countable::count()
Properties summary
protected array $_options array()
#

Options for the collector.

Options for the collector.

protected array $_articles array()
#

Loaded articles.

Loaded articles.

protected array $_pages array()
#

Total paging data.

Total paging data.

protected array $_startArticles array()
#

Start articles of the requested categories.

Start articles of the requested categories.

protected integer $_currentPosition 0
#

Current position for the iterator.

Current position for the iterator.

CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0