University of Southern California

Public Member Functions | Protected Attributes

Model Class Reference

Inheritance diagram for Model:
SQLDb Transform

List of all members.

Public Member Functions

 Model ($conf=NULL)
 get ($key)
 getKeys ()
 set ($key, $value=NULL, $is_js_attribute=false)
 remove ($key)
 version ()
 error ($msg)
 errorCount ()
 errors ($prefix="\nWARNING: ", $separator="\n\t")
 errorReset ()
 toJS ($js_object_name)

Protected Attributes

 $version_msg = "2.0rc"
 $attributes = array()
 $js_attributes = array()
 $error_msgs = array()
 $confpath = ""

Detailed Description

Model is the base widget class for Model Objects. It provides default error message behavior, some introspection and finally set and get methods for setting Object attributes.

Definition at line 20 of file Model.php.


Member Function Documentation

Model::error ( msg )

error - store an error message for later processing in the object.

Parameters:
$msg- the error message you want to record.
Returns:
true if successful, false otherwise

Definition at line 149 of file Model.php.

Referenced by SQLDb::execute(), SQLDb::getRow(), Model(), and SQLDb::open().

Model::errorCount (  )

errorCount - return error count, 0 if no errors are found

Returns:
error count, zero if no errors stored.

Definition at line 158 of file Model.php.

Referenced by SQLDb::execute(), SQLDb::getRow(), and SQLDb::open().

Model::errorReset (  )

errorReset - reset the errors and error count stored with this object.

Returns:
true always

Definition at line 179 of file Model.php.

Model::errors ( prefix = "\nWARNING: ",
separator = "\n\t" 
)

errors - return a string with all the errors stored in this object prefixed by $prefix

Parameters:
$prefix- message prefix to display
Returns:
the error formatted error string

Definition at line 170 of file Model.php.

Model::get ( key )

get - Get the value of an attribute in he widget

Parameters:
$key- the name of the attribute you wish to get.
Returns:
return the attribute by key or false if not found.

Definition at line 85 of file Model.php.

Model::getKeys (  )

getKeys - get the attribute keys for configuration

Returns:
a list of keys as an array

Definition at line 96 of file Model.php.

Model::Model ( conf = NULL )

Model - The Root level Model for Model Objects

Parameters:
$conf- can be a filename or another object with getKeys and get methods.

Definition at line 32 of file Model.php.

References error().

Referenced by SQLDb::SQLDb(), and Transform::Transform().

Model::remove ( key )

remove - Remove an attribute from Object

Parameters:
$key- the key of the attribute you wish to remove
Returns:
true if successful, false otherwise.

Definition at line 132 of file Model.php.

Model::set ( key,
value = NULL,
is_js_attribute = false 
)

set - Set an attribute

Parameters:
$key- the attribute you wish to set
$value- the value you wish to save, if NULL then unset value
$is_js_attribute- if true then allow to pass via toJS to JavaScript
Returns:
true if stored false otherwise.

Definition at line 107 of file Model.php.

Model::toJS ( js_object_name )

toJS - generates the text of a Javascript object from the instance's attributes

Parameters:
$js_object_name- The name of the JavaScript object you are creating
Returns:
text suitable to eval via the JavaScript interpreter

Definition at line 191 of file Model.php.

Model::version (  )

version - return a string of the version of this object

Returns:
string with version message

Definition at line 140 of file Model.php.


The documentation for this class was generated from the following file: