mojavi
[ class tree: mojavi ] [ index: mojavi ] [ all elements ]

Class: Context

Source Location: /core/Context.class.php

Class Overview

MojaviObject
   |
   --Context

Context provides information about the current application context, such as the module and action names and the module directory. References to the current controller, request, and user implementation instances are also provided.


Author(s):

  • Sean Kerr (skerr@mojavi.org)

Version:

  • $Id: Context.class.php 704 2004-12-28 14:23:12Z seank $

Copyright:

Variables

Methods


Inherited Methods

Class: MojaviObject

MojaviObject::toString()
Retrieve a string representation of this object.

Class Details

[line 26]
Context provides information about the current application context, such as the module and action names and the module directory. References to the current controller, request, and user implementation instances are also provided.



Tags:

version:  $Id: Context.class.php 704 2004-12-28 14:23:12Z seank $
since:  3.0.0
copyright:  (c) Sean Kerr, http://www.mojavi.org
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]


Class Variables

$controller =  null

[line 35]


Type:   mixed


[ Top ]

$databaseManager =  null

[line 36]


Type:   mixed


[ Top ]

$request =  null

[line 37]


Type:   mixed


[ Top ]

$storage =  null

[line 38]


Type:   mixed


[ Top ]

$user =  null

[line 39]


Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 57]

Context __construct( Controller $controller, Request $request, User $user, Storage $storage, DatabaseManager $databaseManager)

Class constructor.



Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Parameters:

Controller   $controller   The current Controller implementation instance.
Request   $request   The current Request implementation instance.
User   $user   The current User implementation instance.
Storage   $storage   The current Storage implementation instance.
DatabaseManager   $databaseManager   The current DatabaseManager instance.

[ Top ]

method getActionName [line 83]

string getActionName( )

Retrieve the action name for this context.



Tags:

return:  The currently executing action name, if one is set, otherwise null.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getController [line 103]

Controller getController( )

Retrieve the controller.



Tags:

return:  The current Controller implementation instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getDatabaseConnection [line 130]

mixed getDatabaseConnection( [name $name = 'default'])

Retrieve a database connection from the database manager.

This is a shortcut to manually getting a connection from an existing database implementation instance.

If the MO_USE_DATABASE setting is off, this will return null.




Tags:

return:  A Database instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  DatabaseException If the requested database name does not exist.


Parameters:

name   $name   A database name.

[ Top ]

method getDatabaseManager [line 154]

DatabaseManager getDatabaseManager( )

Retrieve the database manager.



Tags:

return:  The current DatabaseManager instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getModuleDirectory [line 172]

string getModuleDirectory( )

Retrieve the module directory for this context.



Tags:

return:  An absolute filesystem path to the directory of the currently executing module, if one is set, otherwise null.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getModuleName [line 193]

string getModuleName( )

Retrieve the module name for this context.



Tags:

return:  The currently executing module name, if one is set, otherwise null.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getRequest [line 213]

Request getRequest( )

Retrieve the request.



Tags:

return:  The current Request implementation instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getStorage [line 230]

Storage getStorage( )

Retrieve the storage.



Tags:

return:  The current Storage implementation instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method getUser [line 247]

User getUser( )

Retrieve the user.



Tags:

return:  The current User implementation instance.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]


Documentation generated on Tue, 21 Feb 2006 01:45:13 +0900 by phpDocumentor 1.3.0RC5