PHP Class lithium\data\collection\DocumentArray

Inheritance: extends lithium\data\Collection
Exibir arquivo Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
__isset ( $name ) : boolean PHP magic method used to check the presence of a field as document properties, i.e.
__unset ( unknown_type $name ) : void PHP magic method used when unset() is called on a Document instance.
current ( )
export ( Source $dataSource, array $options = [] )
next ( ) : object | null Returns the next document in the set, and advances the object's internal pointer. If the end of the set is reached, a new document will be fetched from the data source connection handle ($_handle). If no more documents can be fetched, returns null.
offsetGet ( string $offset ) : mixed Returns the value at specified offset.
offsetSet ( $offset, $data )
rewind ( ) : object Rewinds the collection of sub-Documents to the beginning and returns the first one found.

Protected Methods

Method Description
_populate ( $data = null, $key = null )

Method Details

__isset() public method

$document->_id.
public __isset ( $name ) : boolean
$name The field name, as specified with an object property.
return boolean Returns `true` if the field specified in `$name` exists, otherwise `false`.

__unset() public method

Use case for this would be when you wish to edit a document and remove a field, i.e.: {{{ $doc = Post::find($id); unset($doc->fieldName); $doc->save(); }}}
public __unset ( unknown_type $name ) : void
$name unknown_type
return void

_populate() protected method

protected _populate ( $data = null, $key = null )

current() public method

public current ( )

export() public method

public export ( Source $dataSource, array $options = [] )
$dataSource lithium\data\Source
$options array

next() public method

Returns the next document in the set, and advances the object's internal pointer. If the end of the set is reached, a new document will be fetched from the data source connection handle ($_handle). If no more documents can be fetched, returns null.
public next ( ) : object | null
return object | null Returns the next document in the set, or `null`, if no more documents are available.

offsetGet() public method

Returns the value at specified offset.
public offsetGet ( string $offset ) : mixed
$offset string The offset to retrieve.
return mixed Value at offset.

offsetSet() public method

public offsetSet ( $offset, $data )

rewind() public method

Rewinds the collection of sub-Documents to the beginning and returns the first one found.
public rewind ( ) : object
return object Returns the first `Document` object instance in the collection.