Method |
Description |
|
__call ( $method, $parameters ) |
Overrides __call to check for filter_$method names defined
You can now define filters methods on the Granada Model as
public static function filter_{filtermethodname} and call it from a static call
ModelName::filtermethodname->. |
|
assoc_to_keyval ( $assoc = null, boolean | string $key_field = null, boolean | string $val_field = null ) : array |
Converts a multi-dimensional associative array into an array of key => values with the provided field names |
|
create ( $data = null ) |
Wrap Idiorm's create method to return an
empty instance of the class associated with
this wrapper instead of the raw ORM class. |
|
filter ( ) |
Add a custom filter to the method chain specified on the
model class. This allows custom queries to be added
to models. The filter should take an instance of the
ORM wrapper as its first argument and return an instance
of the ORM wrapper. Any arguments passed to this method
after the name of the filter will be passed to the called
filter function as arguments after the ORM class. |
|
find_many ( ) : array | Granada\ResultSet |
Tell the ORM that you are expecting multiple results
from your query, and execute it. Will return an array
of instances of the ORM class, or an empty array if
no rows were returned. |
|
find_one ( integer $id = null ) |
Wrap Idiorm's find_one method to return
an instance of the class associated with
this wrapper instead of the raw ORM class. |
|
find_pairs ( $key = false, $value = false ) |
Added: Return pairs as result array('keyrecord_value'=>'valuerecord_value',. |
|
for_table ( $table_name, $connection_name = parent::DEFAULT_CONNECTION ) |
Factory method, return an instance of this
class bound to the supplied table name. |
|
group_by_raw ( $expr ) |
Add an unquoted expression to the list of columns to GROUP BY |
|
insert ( $rows, $ignore = false ) |
To create and save multiple elements, easy way
Using an array with rows array(array('name'=>'value',. |
|
order_by_raw ( $clause ) |
Add an unquoted expression as an ORDER BY clause |
|
pluck ( string $column ) : mixed |
Pluck a single column from the result. |
|
raw_join ( $join ) |
Create raw_join |
|
reset_relation ( ) : Wrapper |
Added: Reset relation deletes the relationship "where" condition. |
|
select_raw ( $expr, $alias = null ) |
Overload select_expr name |
|
set_class_name ( string $class_name ) |
Set the name of the class which the wrapped
methods should return instances of. |
|
where_id_in ( $ids ) |
Special method to query the table by its primary key |
|
with ( ) : Wrapper |
Added: Set the eagerly loaded models on the queryable model. |
|