Public Member Functions |
| | __construct (Closure $finder=null, Array $options=null, SimpleORMap $record=null) |
| | offsetSet ($index, $newval) |
| | setClassName ($class_name) |
| | setRelatedRecord (SimpleORMap $record) |
| | getClassName () |
| | refresh () |
| | sendMessage ($method, $params=array()) |
| | __call ($method, $params) |
| | find ($value) |
| | toGroupedArray ($group_by= 'id', $only_these_fields=null, Closure $group_func=null) |
| | unsetByPk ($id) |
| | __construct ($data=array()) |
| | exchangeArray (Array $input) |
| | toArray () |
| | append ($newval) |
| | offsetUnset ($index) |
| | setFinder (Closure $finder) |
| | getDeleted () |
| | findBy ($key, $values, $op= '==') |
| | findOneBy ($key, $values, $op= '==') |
| | each (Closure $func) |
| | map (Closure $func) |
| | filter (Closure $func=null, $limit=null) |
| | pluck ($columns) |
| | first () |
| | last () |
| | val ($key) |
| | unsetBy ($key, $values, $op= '==') |
| | orderBy ($order, $sort_flags=SORT_LOCALE_STRING) |
| | limit ($arg1, $arg2=null) |
| | __construct ($input=array(), $flags=self::STD_PROP_LIST, $iteratorClass= 'ArrayIterator') |
| | __isset ($key) |
| | __set ($key, $value) |
| | __unset ($key) |
| | __get ($key) |
| | asort () |
| | count () |
| | exchangeArray ($data) |
| | getArrayCopy () |
| | getFlags () |
| | getIterator () |
| | getIteratorClass () |
| | ksort () |
| | natcasesort () |
| | natsort () |
| | offsetExists ($key) |
| | offsetGet ($key) |
| | serialize () |
| | setFlags ($flags) |
| | setIteratorClass ($class) |
| | uasort ($function) |
| | uksort ($function) |
| | unserialize ($data) |
Constructor & Destructor Documentation
| __construct |
( |
Closure |
$finder = null, |
|
|
Array |
$options = null, |
|
|
SimpleORMap |
$record = null |
|
) |
| |
Constructor
- Parameters
-
| Closure | $finder | callable to fill collection |
| array | $options | relationship options |
| SimpleORMap | $record | related record |
Member Function Documentation
| __call |
( |
|
$method, |
|
|
|
$params |
|
) |
| |
magic version of sendMessage calls undefineds methods on all elements of the collection But beware of the dark side...
- Parameters
-
| string | $method | methodname to call |
| array | $params | parameters for methodcall |
- Returns
- array of all return values
| static createFromArray |
( |
Array |
$data, |
|
|
|
$strict = true |
|
) |
| |
|
static |
creates a collection from an array of objects all objects should be of the same type
- Exceptions
-
| InvalidArgumentException | if first entry is not SimpleOrMap |
- Parameters
-
| array | $data | array with SimpleORMap objects |
| bool | $strict | check every element for correct type and unique pk |
- Returns
- SimpleORMapCollection
returns element with given primary key value
- Parameters
-
| string | $value | primary key value to search for |
- Returns
- SimpleORMap
gets the allowed classname
- Returns
- string
| offsetSet |
( |
|
$index, |
|
|
|
$newval |
|
) |
| |
Sets the value at the specified index checks if the value is an object of specified class
- See Also
- ArrayObject::offsetSet()
- Exceptions
-
| InvalidArgumentException | if the given model does not fit (wrong type or id) |
Reimplemented from SimpleCollection.
reloads the elements of the collection by calling the finder function
- Exceptions
-
- Returns
- number of records after refresh
Reimplemented from SimpleCollection.
| sendMessage |
( |
|
$method, |
|
|
|
$params = array() |
|
) |
| |
calls the given method on all elements of the collection
- Parameters
-
| string | $method | methodname to call |
| array | $params | parameters for methodcall |
- Returns
- array of all return values
| setClassName |
( |
|
$class_name | ) |
|
sets the allowed class name
- Parameters
-
sets the related record
- Parameters
-
| toGroupedArray |
( |
|
$group_by = 'id', |
|
|
|
$only_these_fields = null, |
|
|
Closure |
$group_func = null |
|
) |
| |
returns the collection as grouped array first param is the column to group by, it becomes the key in the resulting array, default is pk. Limit returned fields with second param The grouped entries can optoionally go through the given callback. If no callback is provided, only the first grouped entry is returned, suitable for grouping by unique column
- Parameters
-
| string | $group_by | the column to group by, pk if ommitted |
| mixed | $only_these_fields | limit returned fields |
| Closure | $group_func | closure to aggregate grouped entries |
- Returns
- array assoc array
Reimplemented from SimpleCollection.
mark element(s) for deletion element(s) with given primary key are moved to internal deleted collection
- Parameters
-
| string | $id | primary key of element |
- Returns
- number of unsetted elements
Field Documentation
| $relation_options = array() |
|
protected |
The documentation for this class was generated from the following file: