PHP Класс Turba_List, horde

Copyright 2000-2016 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (ASL). If you did did not receive this file, see http://www.horde.org/licenses/apache.
Автор: Chuck Hagenbuch ([email protected])
Автор: Jon Parise ([email protected])
Наследование: implements Countable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$objects array The array containing the Turba_Objects represented in this list.

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

Свойство Тип Описание
$_usortCriteria string The field to compare objects by.

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

Метод Описание
__construct ( array $ids = [] ) Constructor.
count ( ) * Countable methods.
filter ( string $field, array $values ) : Turba_List Returns a filtered list of objects.
insert ( Turba_Object $object ) Inserts a new object into the list.
next ( ) : Turba_Object Returns the next Turba_Object in the list. Use this to hide internal implementation details from client objects.
reset ( ) : Turba_Object Resets our internal pointer to the beginning of the list. Use this to hide the internal storage (array, list, etc.) from client objects.
sort ( array $order = null ) Filters/Sorts the list based on the specified sort routine.

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

Метод Описание
_cmp ( Turba_Object $a, Turba_Object $b ) : integer Usort helper function.

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

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

Constructor.
public __construct ( array $ids = [] )
$ids array

_cmp() защищенный Метод

Compares two Turba_Objects based on the member variable $_usortCriteria, taking care to sort numerically if it is an integer field.
protected _cmp ( Turba_Object $a, Turba_Object $b ) : integer
$a Turba_Object The first Turba_Object to compare.
$b Turba_Object The second Turba_Object to compare.
Результат integer Comparison of the two field values.

count() публичный Метод

* Countable methods.
public count ( )

filter() публичный Метод

Returns a filtered list of objects.
public filter ( string $field, array $values ) : Turba_List
$field string The field to filter on.
$values array An array of values that $field must be equal to in order to be returned in the filtered list.
Результат Turba_List The filtered list object.

insert() публичный Метод

Inserts a new object into the list.
public insert ( Turba_Object $object )
$object Turba_Object The object to insert.

next() публичный Метод

Returns the next Turba_Object in the list. Use this to hide internal implementation details from client objects.
public next ( ) : Turba_Object
Результат Turba_Object The next object in the list.

reset() публичный Метод

Resets our internal pointer to the beginning of the list. Use this to hide the internal storage (array, list, etc.) from client objects.
public reset ( ) : Turba_Object
Результат Turba_Object The next object in the list.

sort() публичный Метод

The default sort order is by last name, ascending.
public sort ( array $order = null )
$order array Array of hashes describing sort fields. Each hash has the following fields:
ascending - (boolean) Sort direction.
field - (string) Sort field.

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

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

The field to compare objects by.
protected string $_usortCriteria
Результат string

$objects публичное свойство

The array containing the Turba_Objects represented in this list.
public array $objects
Результат array