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
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$objects array The array containing the Turba_Objects represented in this list.

보호된 프로퍼티들

프로퍼티 타입 설명
$_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