|
Previous Page |
Solar_Example_Model_Metas |
Next Page |
__call()
public
mixed
__call (
string $method,
array $params
)
Magic call implements "fetchOneBy...()" and "fetchAllBy...()" for columns listed in the method name.
Inherited from Solar_Sql_Model.
Parameters
- (string)
$method: The virtual method name, composed of "fetchOneBy" or "fetchAllBy", with a series of column names joined by "And". - (array)
$params: Parameters to pass to the method: one for each column, plus an optional one for extra fetch parameters.
Returns
- (mixed)
Description
Magic call implements "fetchOneBy...()" and "fetchAllBy...()" for columns listed in the method name.
You have to specify params for all of the named columns.
Optionally, you can pass a final array for the "extra" paramters to the fetch ('order', 'group', 'having', etc.)
Example:
<?php
// fetches one record by status
$model->fetchOneByStatus('draft');
// fetches all records by area_id and owner_handle
$model->fetchAllByAreaIdAndOwnerHandle($area_id, $owner_handle);
// fetches all records by area_id and owner_handle,
// with ordering and page-limiting
$extra = array('order' => 'area_id DESC', 'page' => 2);
$model->fetchAllByAreaIdAndOwnerHandle($area_id, $owner_handle, $extra);
?> Local
- Overview
- Constants
- Properties
- Methods
- __call()
- __construct()
- __destruct()
- __get()
- _addFilter()
- _addRelated()
- _belongsTo()
- _createTableAndIndexes()
- _exception()
- _fetchAll()
- _fetchAssoc()
- _fixFilters()
- _fixIndex()
- _fixModelName()
- _fixOrder()
- _fixPropertyCols()
- _fixStack()
- _fixTableCols()
- _fixTableName()
- _hasMany()
- _hasOne()
- _setup()
- apiVersion()
- countPages()
- countPagesRelated()
- delete()
- dump()
- fetch()
- fetchAll()
- fetchAssoc()
- fetchCol()
- fetchNew()
- fetchOne()
- fetchPairs()
- fetchRelatedArray()
- fetchRelatedObject()
- fetchValue()
- fixSelectParams()
- getPaging()
- getRelated()
- insert()
- locale()
- newCollection()
- newRecord()
- newSelect()
- serializeCols()
- setPaging()
- unserializeCols()
- update()