Interface for all model entities. More...
Public Member Functions | |
__construct (PDO $pdo, $id=null) | |
Constructor. | |
create (array $data) | |
Create a record. | |
retrieve ($id) | |
Fetches data from a record according to its id. | |
update (array $data=array()) | |
Update a record, optionaly added with the $data parameter. | |
delete () | |
Delete a record. | |
getTable () | |
Get the record's original table name. | |
getColumns () | |
Get the record's original table columns. | |
getData () | |
Get the record's native data. | |
Static Public Member Functions | |
static | all (PDO $pdo, array $search_params=array(), array $options=array()) |
Get a list of records, optionaly filtered by $search_params and $options parameters. |
Interface for all model entities.
A model entity consist in a single row, extracted from an RDBMS table.
Definition at line 21 of file axModel.class.php.
axModel::__construct | ( | PDO $ | pdo, |
$ | id = null |
||
) |
Constructor.
PDO | $pdo | The database connection instance |
mixed | $id | [optional] [default null ] The ID of the row to match |
Implemented in axMySQLObject, and axBaseModel.
static axModel::all | ( | PDO $ | pdo, |
array $ | search_params = array() , |
||
array $ | options = array() |
||
) | [static] |
Get a list of records, optionaly filtered by $search_params
and $options
parameters.
Returns the list as an instance of axPDOStatementIterator in case of success, false on failure.
PDO | $pdo | |
array | $search_params | [optional] [default array() ] The filtering parameters |
array | $options | [optional] [default array() ] The options parameters |
Implemented in axMySQLObject.
axModel::create | ( | array $ | data | ) |
Create a record.
Returns the current record in case of success (instance of axModel) or false on failure.
array | $data | The data to be recorded |
Implemented in axBaseModel.
axModel::delete | ( | ) |
axModel::getData | ( | ) |
axModel::retrieve | ( | $ | id | ) |
Fetches data from a record according to its id.
Returns the current record in case of success (instance of axModel) or false on failure.
mixed | $id | The ID of the record |
Implemented in axBaseModel.
axModel::update | ( | array $ | data = array() | ) |
Update a record, optionaly added with the $data
parameter.
Returns the current record in case of success (instance of axModel) or false on failure.
array | $data | [optional] [default array() ] The data to add to the record |
Implemented in axBaseModel.