PHP Class ListObject

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

Protected Properties

Свойство Type Description
$m_cacheKey
$m_columns integer The number of columns (for generating tables)
$m_constraints array The constraints array
$m_defaultIterator object The default iterator for the current object.
$m_defaultTTL
$m_limit integer The maximum number of objects in the list, 0 for no limit
$m_objects array The list of objects.
$m_order array The order constraints array
$m_parameters
$m_start integer The start element number from which to generate the list.
$m_totalCount integer The total number of elements in the list without the limits.

Méthodes publiques

Méthode Description
ParseConstraintsString ( string $p_constraintsString ) : array Parses the constraints string and returns an array of words
__construct ( integer $p_start, string $p_parameters = [] ) constructor For blank lists the start element index ($p_start) is smaller than 0.
__get ( $p_property ) : mix Overloaded method call to give access to the list properties.
defaultIterator ( ) : object Returns the default iterator of this list.
defaultName ( ) : string Generates a unique name for this list object.
getColumn ( integer $p_iterator = null ) Returns the column number for the given iterator
getColumns ( ) : integer Returns the number of columns.
getConstraintsString ( ) : string Returns the constraints string.
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.
getName ( ) : string Returns the list name.
getOrderString ( ) : string Returns the order string.
getRow ( integer $p_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 $p_id ) Sets the list identifier

Méthodes protégées

Méthode Description
CreateList ( integer $p_start, integer $p_limit, array $p_parameters, integer &$p_count ) : array Creates the list of objects. Sets the parameter $p_hasNextElements to 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.
ProcessConstraints ( array $p_constraints ) : array Processes list constraints passed in an array.
ProcessOrder ( array $p_order ) : array Processes order constraints passed in an array.
ProcessParameters ( array $p_parameters ) : array Processes the input parameters passed in an array; drops the invalid parameters and parameters with invalid values. Returns an array of valid parameters.
getCacheKey ( )

Private Methods

Méthode Description
duplicateObject ( object $p_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

CreateList() abstract protected méthode

Creates the list of objects. Sets the parameter $p_hasNextElements to 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.
abstract protected CreateList ( integer $p_start, integer $p_limit, array $p_parameters, integer &$p_count ) : array
$p_start integer
$p_limit integer
$p_parameters array
$p_count integer
Résultat array

ParseConstraintsString() public static méthode

Parses the constraints string and returns an array of words
public static ParseConstraintsString ( string $p_constraintsString ) : array
$p_constraintsString string
Résultat array

ProcessConstraints() abstract protected méthode

Processes list constraints passed in an array.
abstract protected ProcessConstraints ( array $p_constraints ) : array
$p_constraints array
Résultat array

ProcessOrder() abstract protected méthode

Processes order constraints passed in an array.
abstract protected ProcessOrder ( array $p_order ) : array
$p_order array
Résultat array

ProcessParameters() abstract protected méthode

Processes the input parameters passed in an array; drops the invalid parameters and parameters with invalid values. Returns an array of valid parameters.
abstract protected ProcessParameters ( array $p_parameters ) : array
$p_parameters array
Résultat array

__construct() public méthode

constructor For blank lists the start element index ($p_start) is smaller than 0.
public __construct ( integer $p_start, string $p_parameters = [] )
$p_start integer
$p_parameters string

__get() public méthode

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

defaultIterator() public méthode

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

defaultName() public méthode

Generates a unique name for this list object.
public defaultName ( ) : string
Résultat string

getCacheKey() protected méthode

protected getCacheKey ( )

getColumn() public méthode

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

getColumns() public méthode

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

getConstraintsString() public méthode

Returns the constraints string.
public getConstraintsString ( ) : string
Résultat string

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

getName() public méthode

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

getOrderString() public méthode

Returns the order string.
public getOrderString ( ) : string
Résultat string

getRow() public méthode

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

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

setId() public méthode

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

Property Details

$m_cacheKey protected_oe property

protected $m_cacheKey

$m_columns protected_oe property

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

$m_constraints protected_oe property

The constraints array
protected array $m_constraints
Résultat array

$m_defaultIterator protected_oe property

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

$m_defaultTTL protected_oe property

protected $m_defaultTTL

$m_limit protected_oe property

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

$m_objects protected_oe property

The list of objects.
protected array $m_objects
Résultat array

$m_order protected_oe property

The order constraints array
protected array $m_order
Résultat array

$m_parameters protected_oe property

protected $m_parameters

$m_start protected_oe property

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

$m_totalCount protected_oe property

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