Model
| Method Summary | |
public any |
init([struct params="#structNew()#"])
returns the properly instantiated derivative of Model |
public any |
addValidation([any code], [any message])
Adds a validation to be performed before a save is committed. |
public any |
after_insert()
Executed before the after_save() method, and after the insert. It is executed after successfully passing validation and of course, after the insert. It is not executed if validation failed. |
public any |
after_save()
Executed after the save, and after the after_insert() or after_update() methods. It is executed after successfully passing validation and of course, after the update or insert. It is not executed if validation failed. |
public any |
after_update()
Executed before the after_save() method, and after the update. It is executed after successfully passing validation and of course, after the update. It is not executed if validation failed. |
public any |
afterInsert()
Alias for after_insert(). |
public any |
afterSave()
Alias for after_save(). |
public any |
afterUpdate()
Alias for after_update().. |
public any |
autoload_relationship(any columns, any table, any joinOn, [any joinType="inner"])
|
public any |
before_insert()
Executed after the before_save() method, and before the insert. It is also executed before any validation takes place, in case something is needed to pass validation. |
public any |
before_save()
Executed before the save, and before the before_insert() or before_update() methods. It is also executed before any validation takes place, in case something is needed to pass validation. |
public any |
before_update()
Executed after the before_save() method, and before the update. It is also executed before any validation takes place, in case something is needed to pass validation. |
public any |
beforeInsert()
Alias for before_insert(). |
public any |
beforeSave()
Alias for before_save(). |
public any |
beforeUpdate()
Alias for before_update().. |
public any |
destroy()
Deletes the record for the model's current ID. |
public any |
do_delete()
Alias for destroy(). |
public any |
do_insert()
Alias for doInsert(). |
public any |
do_update()
Alias for doUpdate(). |
public any |
doDelete()
Alias for destroy(). |
public any |
doInsert()
Inserts the model's current field values into the model's table. Returns a blank string upon success, or a · (alt-250) delimited list of errors otherwise. |
public any |
doUpdate()
Updates the model's record in the table with the model's current field values, assuming the id is valid. Returns a blank string upon success, or a · (alt-250) delimited list of errors otherwise. |
public any |
exec_query(any sqlQueryText)
Alias for execute_query. |
public any |
execQuery(any sqlQueryText)
Alias for exec_query. |
public any |
execute_query(any sqlQueryText)
As a convenience only, you can just send a sql statement here and it will be executed. |
public any |
executeQuery(any sqlQueryText)
Alias for exec_query. |
public any |
find_all([any orderBy=""], [any filter])
Finds all records of the model's type |
public any |
find_by_id(any id)
Finds a record of this type given its ID. |
public any |
findAll([any orderBy=""])
Alias for find_all |
public any |
findByID(any id)
Alias for find_by_id |
public any |
get_columns_properties([string whichColumn=""])
Alias for getColumnsProperties(). |
public string |
get_human_name(string columnName)
|
public any |
get_table_name()
Alias for getTableName(). |
public any |
getColumnsProperties([string whichColumn=""])
Returns a query containing the model's columns properties: name, type, is_nullable, max_length, default_value, and priority. The records returned are sorted in order of priority, ascending. |
public any |
getPrimaryKey()
|
public any |
getTableName()
|
public any |
save()
If the id is set, updates the table with the values in the fields. Otherwise, it inserts them. |
public any |
set_human_name(string columnName, string humanName)
Sets the human name of a column. |
public any |
set_priority(string columnName, numeric priority)
Sets the priority of a column. Also increases each priority coming 'after' the value passed by one, to break any ties. In effect, this method 'inserts' the column into row specified. |
public any |
setPrimaryKey([any pkname])
|
| Method Detail |
public any addValidation([any code], [any message])
[any code] - The name of a function to run that performs the validation. The function return a true if the validation passed, or false if it failed.[any message] - A message to display upon failing the validation.public any after_insert()
public any after_save()
public any after_update()
public any afterInsert()
public any afterSave()
public any afterUpdate()
public any autoload_relationship(any columns, any table, any joinOn, [any joinType="inner"])
any columnsany tableany joinOn[any joinType="inner"]public any before_insert()
public any before_save()
public any before_update()
public any beforeInsert()
public any beforeSave()
public any beforeUpdate()
public any destroy()
public any do_delete()
public any do_insert()
public any do_update()
public any doDelete()
public any doInsert()
public any doUpdate()
public any exec_query(any sqlQueryText)
any sqlQueryText - Any legal SQL statementpublic any execQuery(any sqlQueryText)
any sqlQueryText - Any legal SQL statementpublic any execute_query(any sqlQueryText)
any sqlQueryText - Any legal SQL statementpublic any executeQuery(any sqlQueryText)
any sqlQueryText - Any legal SQL statementpublic any find_all([any orderBy=""], [any filter])
[any orderBy=""][any filter]public any find_by_id(any id)
any id - The ID of the record you want to find.public any findAll([any orderBy=""])
[any orderBy=""]public any findByID(any id)
any id - The ID of the record you want to find.public any get_columns_properties([string whichColumn=""])
[string whichColumn=""]public string get_human_name(string columnName)
string columnNamepublic any get_table_name()
public any getColumnsProperties([string whichColumn=""])
[string whichColumn=""] - Optional argument is used to specify only one column to get this information for.public any getPrimaryKey()
public any getTableName()
public any init([struct params="#structNew()#"])
[struct params="#structNew()#"] - A structure containing the values for the model's columns. It can contain more or less fields than the actual model - only those that match will be set.public any save()
public any set_human_name(string columnName, string humanName)
string columnName - The name of the column whose priority you want to set.string humanName - The new human name the column should have.public any set_priority(string columnName, numeric priority)
string columnName - The name of the column whose priority you want to set.numeric priority - The new priority number the column should have.public any setPrimaryKey([any pkname])
[any pkname]