Class miDataManager

Description

Manage which page to show

  • copyright: Mirchev Ideas Ltd. © 2003, 2004

Located in /manager/DataManager.inc (line 45)


	
			
Method Summary
 miDataManager miDataManager ()
 mixed getData (mixed $field)
 array getDataFields ()
 object Object &getRecord ()
 object Object getViewRecords ()
 boolean process ()
 void redirectToList (mixed $msg)
 void setDataFields (array $u)
 void setMainPageElements (array $mainPageElements)
 void setRecord (object $u)
 void setRecordsPerPage (int $u)
 void setViewRecords (object $u)
Methods
Constructor miDataManager (line 119)

Constructor

miDataManager miDataManager ()
getData (line 682)

Get value for a specified field.

If value of parameter "action" from the request is 'dmEdit' it returns the value of the field taken from the database. Else it returns the value of the parameter from the request.

  • return: information message with the result of execution of the command
  • access: public
mixed getData (mixed $field)
getDataFields (line 161)

Return array that describes the output and input of each database field

  • return: that describes the output and input of each database field
  • access: public
array getDataFields ()
getRecord (line 132)

Return Object of class miModelSQLRecord or its subclasses which was set by setRecord method

  • return: of class miModelSQLRecord or its subclasses
  • access: public
object Object &getRecord ()
getViewRecords (line 180)

Return Object of class miViewRecords or its subclasses which was set by setViewRecord method

  • return: of class miViewRecords or its subclasses
  • access: public
object Object getViewRecords ()
process (line 245)

Determines which page will be shown or which operation will proceed, depending on the value of the "action" parameter from the request.

Example:


1 <?php
2 $dataManager = new miDataManager;
3 .
4 . //initialization of object $dataManager
5 .
6 if (!$dataManager->process())
7 echo 'Invalid parameter';
8 ?>

  • return: false if the value is unrecognized or true if the value exist
  • access: public
boolean process ()
redirectToList (line 310)

Redirects the browser to the list of items.

Used after dmExecCreate, dmExecEdit and dmExecDelete to prevent refreshing the page to cause repetition of the operation

  • access: public
void redirectToList (mixed $msg)
setDataFields (line 170)

Sets array that describes the output and input of each database field

  • access: public
void setDataFields (array $u)
  • array $u: Array that describes the output and input of each database field
setMainPageElements (line 221)

Sets main page elements

  • access: public
void setMainPageElements (array $mainPageElements)
  • array $mainPageElements: array with the main page elements
setRecord (line 152)

Sets object of class miModelSQLRecord or its subclasses.

miModelSQLRecord object is needed to handle and manage the inserting, updating, deleting and reading of data into the database table specified by the "tableName" in miModelSQLRecord constructor. The database table primary key is also needed in miModelSQLRecord constructor. Example:


1 <?php
2 $dataManager = new miDataManager;
3 $miDataManager->setRecord(new miModelSQLRecord('tableName', 'tablePrimaryKey'));
4 ?>

  • access: public
void setRecord (object $u)
  • object $u: Object of class miModelSQLRecord or its subclasses
setRecordsPerPage (line 211)

Sets how many rows to show in each page when data is shown in table format

  • access: public
void setRecordsPerPage (int $u)
  • int $u: number of rows per page
setViewRecords (line 202)

Sets Object of class miViewRecords or its subclasses.

miViewRecords object is needed to manage the representation in table format of data, which is readed from miModelSQLRecordset object set in miViewRecords constructor. The data is readed from table specified by the "tableName" in the miModelSQLRecordset constructor. Example:


1 <?php
2 $dataManager = new miDataManager;
3 $recordset = new miModelSQLRecordset('tableName');
4 $miDataManager->setViewRecords(new miViewRecords($recordset));
5 ?>

  • access: public
void setViewRecords (object $u)
  • object $u: Object of class miViewRecords or its subclasses

Documentation generated on Mon, 18 Oct 2004 14:58:31 +0300 by phpDocumentor 1.2.3