Models a UI component which is derived from a data model object Designed to be a dumb 'container' object - Ui_Mapper should be doing all the heavy lifting.
More...
Public Member Functions |
| __construct ($table_name=null) |
| Class constructor.
|
| set_table_properties () |
| Set table properties (based on schema information in core_table).
|
| get_fields ($view=null) |
| Gets required fields, and sorts it so it's in the right order.
|
| get_name () |
| Get the model name.
|
| set_field_properties () |
| Set the field properties (based on core_field information).
|
| set_relational_fields () |
| Set the relational fields.
|
| get_save_values ($record) |
| Get the values to save as an array.
|
| get_labels ($view='') |
| Get an array of field labels.
|
| get_user () |
| Gets the current user as stored in the session – NB this should probably be moved to a separate area of the application.
|
| has_field_access ($field, $view='') |
| Does this view have access to the field?
|
| export_csv ($sql=null) |
| Export records to CSV.
|
| set_fields () |
| Gets information on fields in a table.
|
| set_relations () |
| Gets information on relations between the selected table and others (one-to-many and many-to-one).
|
| get_field_properties ($db_model, $map_table) |
| Get the field properties.
|
| get ($id=null) |
| Get a record.
|
| first ($where=array(), $order_by=array()) |
| Get the first record matching criteria.
|
| all ($where=array(), $order_by=array(), $limit=array()) |
| Get an array of all records matching criteria.
|
| is_field ($field_name) |
| Does the field exist?
|
| get_field ($field_name) |
| Get a field.
|
| has_children () |
| Is this model recursive?
|
| has_parent () |
| Is this model recursive?
|
| get_parent_field_name () |
| For recursive models, Get the field name which stores the parent ID.
|
| save (Db_Record &$record) |
| Save a record.
|
| delete ($where=array()) |
| Delete one or more records.
|
| set_default () |
| Update the singleton record of the model to this one for future use.
|
| sql () |
| Get the SQL data.
|
| root () |
| For recursive models, get the root node of a tree.
|
| __call ($function, $params) |
| The 'magic' call method will get/set for us invoked when the interpreter can not find a method the user is asking for.
|
| set_parameters ($arguments) |
| Set variables from an array to member fields requires $this->optional_arguments or $this->required_arguments to have been set by the subclass.
|
Models a UI component which is derived from a data model object Designed to be a dumb 'container' object - Ui_Mapper should be doing all the heavy lifting.