PHP Class ListObject

Inheritance: extends Object
Mostra file Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Property 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.

Public Methods

Method 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

Protected Methods

Method 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

Method 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 method

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
return array

ParseConstraintsString() public static method

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

ProcessConstraints() abstract protected method

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

ProcessOrder() abstract protected method

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

ProcessParameters() abstract protected method

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
return array

__construct() public method

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 method

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

defaultIterator() public method

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

defaultName() public method

Generates a unique name for this list object.
public defaultName ( ) : string
return string

getCacheKey() protected method

protected getCacheKey ( )

getColumn() public method

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

getColumns() public method

Returns the number of columns.
public getColumns ( ) : integer
return integer

getConstraintsString() public method

Returns the constraints string.
public getConstraintsString ( ) : string
return string

getCurrent() public method

Returns the current element of the default iterator.
public getCurrent ( ) : object
return object

getEnd() public method

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

getIndex() public method

Returns the index of the current element of the default iterator.
public getIndex ( ) : integer
return integer

getIterator() public method

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

getLength() public method

Returns the length of the list.
public getLength ( ) : integer
return integer

getLimit() public method

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

getName() public method

Returns the list name.
public getName ( ) : string
return string

getOrderString() public method

Returns the order string.
public getOrderString ( ) : string
return string

getRow() public method

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

getStart() public method

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

getTotalCount() public method

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

hasNextElements() public method

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
return boolean

hasPreviousElements() public method

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
return boolean

isBlank() public method

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

isEmpty() public method

Return true if the list is empty.
public isEmpty ( ) : boolean
return boolean

isLimited() public method

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

setId() public method

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
return integer

$m_constraints protected_oe property

The constraints array
protected array $m_constraints
return array

$m_defaultIterator protected_oe property

The default iterator for the current object.
protected object $m_defaultIterator
return 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
return integer

$m_objects protected_oe property

The list of objects.
protected array $m_objects
return array

$m_order protected_oe property

The order constraints array
protected array $m_order
return 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
return integer

$m_totalCount protected_oe property

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