PHP Класс Newscoop\TemplateList\BaseList

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
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.

Описание методов

__construct() публичный метод

public __construct ( $criteria )

__get() публичный метод

Overloaded method call to give access to the list properties.
public __get ( string $property ) : mixed
$property string - the property name
Результат mixed the property value

convertConstraints() защищенный метод

Convert constraints array to Criteria
protected convertConstraints ( )

convertParameters() защищенный метод

Convert parameters array to Criteria
protected convertParameters ( integer $firstResult, array $parameters ) : Criteria
$firstResult integer
$parameters array
Результат Newscoop\Criteria

defaultIterator() публичный метод

Returns the default iterator of this list.
public defaultIterator ( ) : object
Результат object of type ArrayIterator

getCacheKey() защищенный метод

protected getCacheKey ( )

getColumn() публичный метод

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

getColumns() публичный метод

Returns the number of columns.
public getColumns ( ) : integer
Результат integer

getConstraints() публичный метод

Returns the constraints.
public getConstraints ( ) : array
Результат array

getCurrent() публичный метод

Returns the current element of the default iterator.
public getCurrent ( ) : object
Результат object

getEnd() публичный метод

Returns the index of the last element of this list in the original list from which this was truncated.
public getEnd ( ) : integer
Результат integer

getIndex() публичный метод

Returns the index of the current element of the default iterator.
public getIndex ( ) : integer
Результат integer

getIterator() публичный метод

Returns an iterator for this list.
public getIterator ( ) : object
Результат object of type ArrayIterator

getLength() публичный метод

Returns the length of the list.
public getLength ( ) : integer
Результат integer

getLimit() публичный метод

Returns the maximum number of elements, 0 for limitless.
public getLimit ( ) : integer
Результат integer

getList() публичный метод

public getList ( $firstResult, $parameters )

getName() публичный метод

Returns the list name.
public getName ( ) : string
Результат string

getRow() публичный метод

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

getStart() публичный метод

Returns the index of the start element of this list in the original list from which this was truncated.
public getStart ( ) : integer
Результат integer

getTotalCount() публичный метод

Returns the total number of elements in the list without the limits.
public getTotalCount ( ) : unknown
Результат unknown

hasNextElements() публичный метод

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
Результат boolean

hasPreviousElements() публичный метод

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
Результат boolean

isBlank() публичный метод

Return true if the list is blank (see the constructor documentation).
public isBlank ( ) : boolean
Результат boolean

isEmpty() публичный метод

Return true if the list is empty.
public isEmpty ( ) : boolean
Результат boolean

isLimited() публичный метод

Returns true if the list is limited to a certain number of elements.
public isLimited ( ) : boolean
Результат boolean

parseConstraintsString() защищенный метод

Parses the constraints string and returns an array of words
protected parseConstraintsString ( string $constraintsString ) : array
$constraintsString string
Результат array

prepareList() абстрактный защищенный метод

Get ListResult object with list elements
abstract protected prepareList ( Criteria $criteria, array $parameters ) : ListResult
$criteria Newscoop\Criteria
$parameters array
Результат Newscoop\ListResult

setCriteria() защищенный метод

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

setId() публичный метод

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

setTotalCount() публичный метод

Set list total count.
public setTotalCount ( $totalCount ) : unknown
Результат unknown

Описание свойств

$cacheKey защищенное свойство

List cache key
protected mixed $cacheKey
Результат mixed

$columns защищенное свойство

The number of columns (for generating tables)
protected int $columns
Результат integer

$constraints защищенное свойство

The constraints array.
protected array $constraints
Результат array

$critera защищенное свойство

The Criteria object
protected Criteria,Newscoop $critera
Результат Newscoop\Criteria

$defaultIterator защищенное свойство

The default iterator for the current object.
protected object $defaultIterator
Результат object

$defaultTTL защищенное свойство

Default cache time
protected int $defaultTTL
Результат integer

$firstResult защищенное свойство

The start page number from which to generate the list.
protected int $firstResult
Результат integer

$hasNextResults защищенное свойство

True if the generated list has more elements than $this->m_limit
protected bool $hasNextResults
Результат boolean

$id защищенное свойство

The identifier of the list
protected string $id
Результат string

$maxResults защищенное свойство

The maximum number of objects in the list, null or 0 for no limit
protected int $maxResults
Результат integer

$name защищенное свойство

The name of the list
protected string $name
Результат string

$objectsList защищенное свойство

The list of objects.
protected ListResult,Newscoop $objectsList
Результат Newscoop\ListResult

$operatorsMap защищенное свойство

protected $operatorsMap

$parameters защищенное свойство

The clean array of parameters
protected array $parameters
Результат array

$totalCount защищенное свойство

The total number of elements in the list without the limits.
protected int $totalCount
Результат integer