PHP Class lithium\data\collection\DocumentSet

Inheritance: extends lithium\data\Collection
显示文件 Open project: unionofrad/lithium Class Usage Examples

Protected Properties

Property Type Description
$_original array Contains the original database value of the array. This value will be compared with the current value ($_data) to calculate the changes that should be sent to the database.

Public Methods

Method Description
export ( array $options = [] )
modified ( ) : boolean Determines if the DocumentSet has been modified since it was last saved
sync ( $id = null, array $data = [], array $options = [] )
to ( string $format, array $options = [] ) : mixed Adds conversions checks to ensure certain class types and embedded values are properly cast.

Protected Methods

Method Description
_init ( )
_populate ( ) : mixed Extract the next item from the result ressource and wraps it into a Document object.
_set ( mixed $data = null, null | integer | string $offset = null, array $options = [] ) : mixed Helper method to normalize and set data.

Method Details

_init() protected method

protected _init ( )

_populate() protected method

Extract the next item from the result ressource and wraps it into a Document object.
protected _populate ( ) : mixed
return mixed Returns the next `Document` if exists. Returns `null` otherwise

_set() protected method

Helper method to normalize and set data.
protected _set ( mixed $data = null, null | integer | string $offset = null, array $options = [] ) : mixed
$data mixed
$offset null | integer | string
$options array
return mixed The (potentially) cast data.

export() public method

public export ( array $options = [] )
$options array

modified() public method

Determines if the DocumentSet has been modified since it was last saved
public modified ( ) : boolean
return boolean

sync() public method

public sync ( $id = null, array $data = [], array $options = [] )
$data array
$options array

to() public method

Adds conversions checks to ensure certain class types and embedded values are properly cast.
public to ( string $format, array $options = [] ) : mixed
$format string Currently only `array` is supported.
$options array
return mixed

Property Details

$_original protected_oe property

Contains the original database value of the array. This value will be compared with the current value ($_data) to calculate the changes that should be sent to the database.
protected array $_original
return array