Dao Entity Documentation
PROPERTIES/*
* Schema is being build as list of table columns. It can be specified staticly in entity extension class
*/
protected $schema = array();
/*
* In entity extension class is necesary to specify table name which is to be used.
*/
protected $table_name = null;
/*
* Column name to be used as ID. If not speciefied 'id' is used as default.
*/
protected $id_name = 'id';
METHODS (most important)
/*
* Function performs query on database.
* @param $query string Query string made in [1] query format
* @param $arguments mixed Array
* @return null;
*/
public function Query( $query, $arguments, $class_name );
[1] Query format
To allow proper escaping and provide scalability all parameters are replaced with question mark (?). All parameters are provided in array.
Examples:
SELECT * FROM test_table WHERE id = ?
UPDATE test_table SET test_column_1 = ?, test_column_2 = ? WHERE id = ?
DELETE FROM test_table WHERE test_column_1 = ? OR id = ?