Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
documentation:rack:reference:models [2018/05/27 03:01] – [Basic querying & filtering] Martijn Luinstra | documentation:rack:reference:models [2019/05/10 17:57] – [Functions] Martijn Luinstra |
---|
* <php>protected query($query, array $input_parameters=[])</php> Expects a query and input parameters that that can be used for [[http://php.net/manual/en/pdo.prepare.php|PDO prepared statements]]. | * <php>protected query($query, array $input_parameters=[])</php> Expects a query and input parameters that that can be used for [[http://php.net/manual/en/pdo.prepare.php|PDO prepared statements]]. |
* <php>protected query_first($query, array $input_parameters=[])</php> Same as <php>query</php>, but returns only the first result. | * <php>protected query_first($query, array $input_parameters=[])</php> Same as <php>query</php>, but returns only the first result. |
* <php>get(array $conditions=[], $get_first=false)</php> | * <php>get(array $conditions=[], array $order=[], $get_first=false)</php> |
* <php>get_by_id($id, $field='id')</php> | * <php>get_by_id($id, $field='id')</php> |
* <php>create(array $values)</php> | * <php>create(array $values)</php> Returns inserted ID. |
* <php>update(array $data, array $conditions=[])</php> Use with caution! | * <php>update(array $data, array $conditions=[])</php> Use with caution! |
* <php>update_by_id($id, array $data, $field='id')</php> | * <php>update_by_id($id, array $data, $field='id')</php> |