PHP Class Newscoop\TemplateList\BaseList

Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Свойство Type Description
$cacheKey mixed List cache key
$columns integer The number of columns (for generating tables)
$constraints array The constraints array.
$critera Newscoop\Criteria The Criteria object
$defaultIterator object The default iterator for the current object.
$defaultTTL integer Default cache time
$firstResult integer The start page number from which to generate the list.
$hasNextResults boolean True if the generated list has more elements than $this->m_limit
$id string The identifier of the list
$maxResults integer The maximum number of objects in the list, null or 0 for no limit
$name string The name of the list
$objectsList Newscoop\ListResult The list of objects.
$operatorsMap
$parameters array The clean array of parameters
$totalCount integer The total number of elements in the list without the limits.

Méthodes publiques

Méthode Description
__construct ( $criteria )
__get ( string $property ) : mixed Overloaded method call to give access to the list properties.
defaultIterator ( ) : object Returns the default iterator of this list.
getColumn ( integer $iterator = null ) Returns the column number for the given iterator
getColumns ( ) : integer Returns the number of columns.
getConstraints ( ) : array Returns the constraints.
getCurrent ( ) : object Returns the current element of the default iterator.
getEnd ( ) : integer Returns the index of the last element of this list in the original list from which this was truncated.
getIndex ( ) : integer Returns the index of the current element of the default iterator.
getIterator ( ) : object Returns an iterator for this list.
getLength ( ) : integer Returns the length of the list.
getLimit ( ) : integer Returns the maximum number of elements, 0 for limitless.
getList ( $firstResult, $parameters )
getName ( ) : string Returns the list name.
getRow ( $iterator = null ) Returns the row number for the given iterator
getStart ( ) : integer Returns the index of the start element of this list in the original list from which this was truncated.
getTotalCount ( ) : unknown Returns the total number of elements in the list without the limits.
hasNextElements ( ) : boolean Returns true if this list is limited and elements still exist in the original list (from which this was truncated) after the last element of this list.
hasPreviousElements ( ) : boolean Returns true if the index of the start element in the original list - from which this was truncated - is greater than 0.
isBlank ( ) : boolean Return true if the list is blank (see the constructor documentation).
isEmpty ( ) : boolean Return true if the list is empty.
isLimited ( ) : boolean Returns true if the list is limited to a certain number of elements.
setId ( string $id ) Sets the list identifier
setTotalCount ( $totalCount ) : unknown Set list total count.

Méthodes protégées

Méthode Description
convertConstraints ( ) Convert constraints array to Criteria
convertParameters ( integer $firstResult, array $parameters ) : Criteria Convert parameters array to Criteria
getCacheKey ( )
parseConstraintsString ( string $constraintsString ) : array Parses the constraints string and returns an array of words
prepareList ( Criteria $criteria, array $parameters ) : ListResult Get ListResult object with list elements
setCriteria ( Criteria $criteria ) Set Criteria object

Private Methods

Méthode Description
defaultName ( ) : string Generates a unique name for this list object.
duplicateObject ( object $source ) : object Copies the given object
getNextStart ( ) : integer Returns the start element index of the next group of items from the list. Returns null if the list had no limit.
getPrevStart ( ) : integer Returns the start element index of the previous group of items from the list. Returns null if the list had no limit.

Method Details

__construct() public méthode

public __construct ( $criteria )

__get() public méthode

Overloaded method call to give access to the list properties.
public __get ( string $property ) : mixed
$property string - the property name
Résultat mixed the property value

convertConstraints() protected méthode

Convert constraints array to Criteria
protected convertConstraints ( )

convertParameters() protected méthode

Convert parameters array to Criteria
protected convertParameters ( integer $firstResult, array $parameters ) : Criteria
$firstResult integer
$parameters array
Résultat Newscoop\Criteria

defaultIterator() public méthode

Returns the default iterator of this list.
public defaultIterator ( ) : object
Résultat object of type ArrayIterator

getCacheKey() protected méthode

protected getCacheKey ( )

getColumn() public méthode

Returns the column number for the given iterator
public getColumn ( integer $iterator = null )
$iterator integer

getColumns() public méthode

Returns the number of columns.
public getColumns ( ) : integer
Résultat integer

getConstraints() public méthode

Returns the constraints.
public getConstraints ( ) : array
Résultat array

getCurrent() public méthode

Returns the current element of the default iterator.
public getCurrent ( ) : object
Résultat object

getEnd() public méthode

Returns the index of the last element of this list in the original list from which this was truncated.
public getEnd ( ) : integer
Résultat integer

getIndex() public méthode

Returns the index of the current element of the default iterator.
public getIndex ( ) : integer
Résultat integer

getIterator() public méthode

Returns an iterator for this list.
public getIterator ( ) : object
Résultat object of type ArrayIterator

getLength() public méthode

Returns the length of the list.
public getLength ( ) : integer
Résultat integer

getLimit() public méthode

Returns the maximum number of elements, 0 for limitless.
public getLimit ( ) : integer
Résultat integer

getList() public méthode

public getList ( $firstResult, $parameters )

getName() public méthode

Returns the list name.
public getName ( ) : string
Résultat string

getRow() public méthode

Returns the row number for the given iterator
public getRow ( $iterator = null )

getStart() public méthode

Returns the index of the start element of this list in the original list from which this was truncated.
public getStart ( ) : integer
Résultat integer

getTotalCount() public méthode

Returns the total number of elements in the list without the limits.
public getTotalCount ( ) : unknown
Résultat unknown

hasNextElements() public méthode

Returns true if this list is limited and elements still exist in the original list (from which this was truncated) after the last element of this list.
public hasNextElements ( ) : boolean
Résultat boolean

hasPreviousElements() public méthode

Returns true if the index of the start element in the original list - from which this was truncated - is greater than 0.
public hasPreviousElements ( ) : boolean
Résultat boolean

isBlank() public méthode

Return true if the list is blank (see the constructor documentation).
public isBlank ( ) : boolean
Résultat boolean

isEmpty() public méthode

Return true if the list is empty.
public isEmpty ( ) : boolean
Résultat boolean

isLimited() public méthode

Returns true if the list is limited to a certain number of elements.
public isLimited ( ) : boolean
Résultat boolean

parseConstraintsString() protected méthode

Parses the constraints string and returns an array of words
protected parseConstraintsString ( string $constraintsString ) : array
$constraintsString string
Résultat array

prepareList() abstract protected méthode

Get ListResult object with list elements
abstract protected prepareList ( Criteria $criteria, array $parameters ) : ListResult
$criteria Newscoop\Criteria
$parameters array
Résultat Newscoop\ListResult

setCriteria() protected méthode

Set Criteria object
protected setCriteria ( Criteria $criteria )
$criteria Newscoop\Criteria

setId() public méthode

Sets the list identifier
public setId ( string $id )
$id string

setTotalCount() public méthode

Set list total count.
public setTotalCount ( $totalCount ) : unknown
Résultat unknown

Property Details

$cacheKey protected_oe property

List cache key
protected mixed $cacheKey
Résultat mixed

$columns protected_oe property

The number of columns (for generating tables)
protected int $columns
Résultat integer

$constraints protected_oe property

The constraints array.
protected array $constraints
Résultat array

$critera protected_oe property

The Criteria object
protected Criteria,Newscoop $critera
Résultat Newscoop\Criteria

$defaultIterator protected_oe property

The default iterator for the current object.
protected object $defaultIterator
Résultat object

$defaultTTL protected_oe property

Default cache time
protected int $defaultTTL
Résultat integer

$firstResult protected_oe property

The start page number from which to generate the list.
protected int $firstResult
Résultat integer

$hasNextResults protected_oe property

True if the generated list has more elements than $this->m_limit
protected bool $hasNextResults
Résultat boolean

$id protected_oe property

The identifier of the list
protected string $id
Résultat string

$maxResults protected_oe property

The maximum number of objects in the list, null or 0 for no limit
protected int $maxResults
Résultat integer

$name protected_oe property

The name of the list
protected string $name
Résultat string

$objectsList protected_oe property

The list of objects.
protected ListResult,Newscoop $objectsList
Résultat Newscoop\ListResult

$operatorsMap protected_oe property

protected $operatorsMap

$parameters protected_oe property

The clean array of parameters
protected array $parameters
Résultat array

$totalCount protected_oe property

The total number of elements in the list without the limits.
protected int $totalCount
Résultat integer