Database class. More...
Public Member Functions | |
factory ($model, $id=null) | |
Create an axModel instance. | |
fetchAll ($model, array $search_params=array(), array $options=array()) | |
Invoke the axModel::all() method over the specified model. |
Database class.
This class extends the native PHP PDO class so all PDO methods are available through axDatabase instances.
Delespierre 1.2.0 Copyright 2010-2011, Benjamin Delespierre (http://bdelespierre.fr) License: http://www.gnu.org/licenses/lgpl.html Lesser General Public Licence version 3
Definition at line 20 of file axDatabase.class.php.
axDatabase::factory | ( | $ | model, |
$ | id = null |
||
) |
Create an axModel instance.
If $model
is a tablename, a generic axMySQLObject will be returned, if it's an axModel class, an instance of this class will be returned. Will return false in case of error or if the class identified by $model
doesn't implement the axModel interface and a E_USER_WARNING
is emitted (we don't know its constructor and thus cannot create the object).
string | $model | The model class to use or the table name |
mixed | $id | [optional] [default null ] See axModel::__construct() more details about this parameter |
Definition at line 35 of file axDatabase.class.php.
axDatabase::fetchAll | ( | $ | model, |
array $ | search_params = array() , |
||
array $ | options = array() |
||
) |
Invoke the axModel::all() method over the specified model.
If $model
is a tablename, axMySQLObject::all() implementation will be used, if it's an axModel class, the all() implementation of this class will be used. Will return false in case of error or if the class identified by $model
doesn't implement the axModel interface and a E_USER_WARNING
is emitted (we don't know whenever it has all() method or its prototype).
string | $model | The model class to use or the table name |
array | $search_params | [optional] [default array() ] |
unknown_type | $options | [optional] [default array() ] |
Definition at line 69 of file axDatabase.class.php.