Class miDefaultView

Description

Handles the presentation tier

  • copyright: Copyright (c) 2003-2007 Mirchev Ideas Ltd. All rights reserved.

Located in /view/View.php (line 73)

miView
   |
   --miDefaultView
Class Constant Summary
Variable Summary
Method Summary
miDefaultView __construct ( $recordset)
void addMainPageElements (array $mainPageElements)
void addRedirectToListControllerCommand (string $msg, [int $msgType = miMessage::MSG_TYPE_ERROR])
void addTableFeatures (miTable $table)
void callPlugin (miAction $actionObj, string $actionStep)
array getDataFields ()
void getDomainObject ()
string getMessage (string $msgCode)
object Object &getRecord ()
void getRecordset ()
string getRedirectParams (string $msg, [int $msgType = miMessage::MSG_TYPE_ERROR])
object Object getTable ()
object &getTableFilterObj ()
object &getTablePagerObj ()
string getTemplateFileName (string $templateId)
void initTable (miTable $table)
void initViewMapperController ( $viewMapperController)
void initWebForm ( &$form, miWebForm $form)
void postProcess (miAction $actionObj, boolean $actionResult)
void preProcess (miAction $actionObj)
void registerPlugin (miViewPlugin $plugin)
void setDataFields (array $u)
void setMainPageElements (array $mainPageElements)
void setRecord (object $u)
void setTable (object $u)
Variables
array $_dataFields = array() (line 120)

Array that describes the output and input of each database field

  • access: protected
mixed $_defaultFilterValues = array() (line 142)

The default filter values

  • access: protected
mixed $_domainObject = null (line 104)

Reference to the domain object

  • access: protected
mixed $_mainPageElements = array() (line 135)

Stores page specific elements

  • access: protected
mixed $_persistVars = array('sortBy', 'sortDir', 'page', 'recordsPerPage') (line 154)
  • access: protected
mixed $_plugins = array() (line 152)

Plugin objects

  • access: protected
SQLRecord $_record (line 94)

Object of class miSQLRecord or its subclasses

  • access: protected
mixed $_recordset (line 147)
  • access: protected
array $_submitFields = array() (line 128)

Array that describes the output and input of each field of type FILE

  • access: protected
miTable $_table (line 112)

Object of class miTable or its subclasses

  • access: protected
array $_templates = array() (line 86)

An array of template names needed to visualize all viewes

  • access: protected
mixed $_viewMapperController = null (line 99)

Reference to the view mapper controller object

  • access: protected

Inherited Variables

Inherited from miView

miView::$_controller
miView::$_controllerCommands
Methods
Constructor __construct (line 159)

Constructor

miDefaultView __construct ( $recordset)
  • $recordset
addMainPageElements (line 381)

Adds main page elements

  • access: public
void addMainPageElements (array $mainPageElements)
  • array $mainPageElements: array with the main page elements
addRedirectToListControllerCommand (line 417)

Adds redirect to list controller command Used after dmExecCreate, dmExecEdit and dmExecDelete to prevent refreshing the page to cause repetition of the operation

  • access: public
void addRedirectToListControllerCommand (string $msg, [int $msgType = miMessage::MSG_TYPE_ERROR])
  • string $msg: message to display on the list page
  • int $msgType: the type of the message (optional)
addTableFeatures (line 221)

Adds additional table features

  • access: protected
void addTableFeatures (miTable $table)
callPlugin (line 452)

Calls each of the plugins passing the $actionObj and the $actionStep

  • access: public
void callPlugin (miAction $actionObj, string $actionStep)
  • miAction $actionObj: action object subclassed from miAction
  • string $actionStep: the particular action step
createDomainObject (line 271)
  • access: protected
void createDomainObject ()
createViewMapperController (line 285)
  • access: protected
void createViewMapperController ()
getDataFields (line 307)

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 ()
getDomainObject (line 264)
  • access: public
void getDomainObject ()
getMainPageElements (line 392)

Returns the main page elements

  • access: public
array getMainPageElements ()
getMessage (line 551)

Returns message based on code

  • return: the message
  • access: public
string getMessage (string $msgCode)
  • string $msgCode
getRecord (line 236)

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

  • return: of class miSqlRecord or its subclasses
  • access: public
object Object &getRecord ()
getRecordset (line 296)

Returns the recordset

  • access: public
void getRecordset ()
getRedirectParams (line 432)

Returns the redirect params

  • return: the redirect params url string
  • access: public
string getRedirectParams (string $msg, [int $msgType = miMessage::MSG_TYPE_ERROR])
  • string $msg: message to display on the list page
  • int $msgType: the type of the message (optional)
getTable (line 332)

Return object of class miTable or its subclasses which was set by setTable method

  • return: of class miTable or its subclasses
  • access: public
object Object getTable ()
getTableFilterObj (line 197)

Creates the table filter object. Singleton pattern

  • access: public
object &getTableFilterObj ()
getTablePagerObj (line 183)

Creates the table pager object. Singleton pattern

  • access: public
object &getTablePagerObj ()
getTemplateFileName (line 521)

Returns the template file for the $templateId

  • return: the template file name relative to the document root
  • throws: miConfigurationException
  • access: public
string getTemplateFileName (string $templateId)
  • string $templateId: the id of the template
getViewMapperController (line 276)
  • access: public
void getViewMapperController ()
initTable (line 490)

Subclasses can init the table

  • access: public
void initTable (miTable $table)
  • miTable $table: reference to the table object
initViewMapperController (line 509)

Inits the view mapper controller

  • access: public
void initViewMapperController ( $viewMapperController)
  • $viewMapperController
initWebForm (line 501)

Inits the web form

  • access: public
void initWebForm ( &$form, miWebForm $form)
postProcess (line 479)

Called after the action is executed Subclasses can add functionlity to be executed after the action

  • access: public
void postProcess (miAction $actionObj, boolean $actionResult)
  • miAction $actionObj: action object, extended from miAction
  • boolean $actionResult: the result of the action command

Redefinition of:
miView::postProcess()
preProcess (line 465)

Called before the action is executed Subclasses can add functionlity to be executed before the action

  • access: public
void preProcess (miAction $actionObj)
  • miAction $actionObj: action object, extended from miAction

Redefinition of:
miView::preProcess()
registerPlugin (line 403)

Registers new plugin

  • access: public
void registerPlugin (miViewPlugin $plugin)
setDataFields (line 319)

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 369)

Sets main page elements

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

Sets object of class miSqlRecord or its subclasses.

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

  1.  <?php
  2.  $view new miView;
  3.  $view->setRecord(new miSqlRecord('tableName''tablePrimaryKey'));
  4.  ?>

  • access: public
void setRecord (object $u)
  • object $u: Object of class miSqlRecord or its subclasses
setTable (line 357)

Sets Object of class miTable or its subclasses.

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

  1.  <?php
  2.  $view new miView;
  3.  $recordset new miSqlRecordset('tableName');
  4.  $view->setTable(new miTable($recordset));
  5.  ?>

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

Inherited Methods

Inherited From miView

miView::addControllerCommand()
miView::getController()
miView::getControllerCommands()
miView::postProcess()
miView::preProcess()
miView::setController()
Class Constants
TEMPLATE_ID_CREATE = 'create' (line 74)
TEMPLATE_ID_EDIT = 'edit' (line 75)
TEMPLATE_ID_LIST = 'list' (line 77)
TEMPLATE_ID_VIEW = 'view' (line 76)

Documentation generated on Thu, 08 May 2008 16:57:56 +0300 by phpDocumentor 1.4.1