Class controller

Description

controller class

The controller class controls the execution of the actions.

Located in /controller.class.php (line 37)


	
			
Variable Summary
Method Summary
controller __construct ()
void connect_datamodel_to_database (string $DMName, string $DBName)
void disconnect_datamodel_from_database (string $DMName)
string|void execute ([array $ajaxVars = null])
void executeactions ()
void is_database_registered (string $DBName)
void is_datamodel_registered (string $DMName)
void register_database (string $DBName)
void register_datamodel (string $DMName, datamodel $datamodel)
void set_sub_views ()
void unregister_database (string $DBName)
void unregister_datamodel (string $DMName)
void update_datamodel_from_post (string $DMName)
Variables
array $registered_databases (line 44)
  • access: protected
array $registered_datamodels (line 43)
  • access: protected
array $sub_views (line 45)
  • access: protected
SmartyObject $template (line 52)
  • access: protected
string $view (line 58)
  • access: protected
Methods
Constructor __construct (line 66)

Constructs the controller

The constructor starts the session and sets up the protected varibles.

  • access: protected
controller __construct ()
connect_datamodel_to_database (line 340)

connects datamodel to database

connect_datamodel_to_database connects a registered datamodel to a registered database

  • access: protected
void connect_datamodel_to_database (string $DMName, string $DBName)
  • string $DBName: name that refers to the database
  • string $DMName: name that refers to the datamodel
disconnect_datamodel_from_database (line 354)

disconnects datamodel from database

disconnect_datamodel_from_database disconnects a registered datamodel from a registered database. Must be used if one does not want the datamodel to reconnect to a particular database in subsequent controllers.

  • access: protected
void disconnect_datamodel_from_database (string $DMName)
  • string $DMName: name that refers to the datamodel
execute (line 88)

Processes the current data and displays/returns the results.

Execute controls the order of execution with in the controller. It is the only function that needs to be called from an instantiated controller object. It retrieves the registered databases and datamodels from the session then executes the action function from the post. It then sets the subviews, saves the registered databases and datamodels to the session and then displays the view.

  • return: returns null if no ajax vars are passed in otherwise it returns the html from the view.
  • access: public
string|void execute ([array $ajaxVars = null])
  • array $ajaxVars: ajaxVars are optional and are used populated the interal variales when the post array is not available
executeactions (line 123)

execute the current action

Executeactions calls the function that is passed in the post array or if the action is not present it executes the init function

  • access: protected
void executeactions ()
insert_databases_into_session (line 305)

inserts databases into session

insert_databases_into_session will insert the registered databases into the session.

  • access: protected
void insert_databases_into_session ()
insert_datamodels_into_session (line 241)

inserts datamodels into session

insert_datamodels_into_session will insert the registered datamodel into the session.

  • access: protected
void insert_datamodels_into_session ()
is_database_registered (line 189)

checks to see if a database is registered

is_database_registered is used to check to see whether a particular database is registered.

  • access: protected
void is_database_registered (string $DBName)
  • string $DBName: the name that refers to the database.
is_datamodel_registered (line 170)

checks to see if a datamodel is registered

is_datamodel_registered is used to check to see whether a particular datamodel is registered.

  • access: protected
void is_datamodel_registered (string $DMName)
  • string $DMName: the name that refers to the datamodel.
register_database (line 261)

registers a database

register_database registers a database with the controller so it can be used by the controller.

  • access: protected
void register_database (string $DBName)
  • string $DBName: name that will be used to refer to the database
register_datamodel (line 143)

registers a datamodel

register_datamodel registers a datamodel with the controller so it can be used by the controller.

  • access: protected
void register_datamodel (string $DMName, datamodel $datamodel)
  • string $DMName: the name that will be used to refer to the datamodel.
  • datamodel $datamodel: datamodel object
retrieve_databases_from_session (line 286)

retrieves databases from session

retrieve_databases_from_session will fetch the registered databases from the session.

  • access: protected
void retrieve_databases_from_session ()
retrieve_datamodels_from_session (line 218)

retrieves datamodels from session

retrieve_datamodels_from_session will fetch the registered datamodels from the session.

  • access: protected
void retrieve_datamodels_from_session ()
save_data_to_session (line 326)

saves data to session

save_data_to_session calls insert_datamodels_into_session and insert_databases_into_session to save the current controller data to the session.

  • access: protected
void save_data_to_session ()
set_sub_views (line 207)

sets sub views

set_sub_views assigns the sub_views array to the template so the view knows which sub views to show.

  • access: protected
void set_sub_views ()
unregister_database (line 274)

unregisters a database

unregister_database unregisters a database. Must be used if one does not want reconnect to a particular database in subsequent controllers.

  • access: protected
void unregister_database (string $DBName)
  • string $DBName: name that refers to the database
unregister_datamodel (line 157)

unregisters a datamodel

unregister_datamodel unregisters a datamodel when is is no longer needed.

  • access: protected
void unregister_datamodel (string $DMName)
  • string $DMName: the name that will be used to refer to the datamodel.
update_datamodels_from_post (line 385)

updates datamodels from post

update_datamodels_from_post updates all datamodels from post

  • access: protected
void update_datamodels_from_post ()
update_datamodel_from_post (line 367)

updates datamodel from post

update_datamodel_from_post updates a particular datamodel from post

  • access: protected
void update_datamodel_from_post (string $DMName)
  • string $DMName: name that refers to the datamodel

Documentation generated on Wed, 07 Sep 2005 22:55:18 -0400 by phpDocumentor 1.3.0RC3