Class Nexista_Builder

Description

This class Nexista_provides abstract functionality to build the cached php gate files for each action based on the sitemap.

It should be extended for each possible tags in the sitemap. In your class extend the getCodeStart() and getCodeEnd() functions. The attributes of the tag are available in the $params array

If your tag does not allow nesting of other tag (such as validate, if) then you can disregard the getCodeEnd() method . You should also add any required files into the $required array by extending it and setting new values in your class.

Located in /kernel/builder.php (line 32)


	
			
Direct descendents
Class Description
 class Nexista_XmlBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_ValidateBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_QueryBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_ScriptBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_ValidBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_BlockBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_DefaultBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_PluginBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_XslBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_IfBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_DebugBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_InvalidBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_SetBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_RawBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_OutputBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_TrueBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_InsertBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_ActionBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_FalseBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_CaseBuilder This class handles the tag by the same name in the sitemap building process
 class Nexista_SwitchBuilder This class handles the tag by the same name in the sitemap building process
Variable Summary
 DOMElement $action
 string $matchType
 array $params
Method Summary
 string addErrorHandler ([string $content = ''], [string $message = ''], [string $code = 'NX_ERROR_FATAL'], [mixed $errorHandler = null])
 string getCodeEnd ()
 string getCodeStart ()
 array getRequired ()
 void reset ()
Variables
DOMElement $action (line 50)

Reference to current DOMElement action tag object in current gate

  • access: public
string $matchType (line 59)

Determines if we allow regex in some attributes based on gate match

  • access: public
array $params = array() (line 41)

Holds the tag attributes from sitemap

  • access: public
Methods
addErrorHandler (line 136)

Inserts whatever exception handling is desired at build time

This allows any code in the getCode() class Nexista_to use error handling without worrying about future changes (such as no error handling) The relevant code in the getCode() method would be written as

$this->addErrorHandling('someaction()', Ooops', 'NX_ERROR_FATAL');

This will result in something like:

  1. if(!someaction()) {
  2.      Nexista_Error::init('Ooops'NX_ERROR_FATAL);
  3.  }

  • return: error ready code
  • access: public
string addErrorHandler ([string $content = ''], [string $message = ''], [string $code = 'NX_ERROR_FATAL'], [mixed $errorHandler = null])
  • string $content: function to insert in error handler
  • string $message: message for error handler - optional
  • string $code: valid error code IN QUOTES! (i.e. NX_ERROR_FATAL)
  • mixed $errorHandler: valid php callback to deal with exception
getCodeEnd (line 109)

Returns end code for this tag.

This method returns ending/closing code for nesting tags such as if,validate. If the tag is self closing, this method does not need to be extended.

  • return: tag code to insert in gate
  • access: public
string getCodeEnd ()

Redefined in descendants as:
getCodeStart (line 93)

Returns start code for this tag.

This is the main function used to write tag code. It either holds the entire snippet in case of a self closing tag (query,xsl) or the start code for nesting tags (if,validate)

  • return: tag code to insert in gate
  • access: public
string getCodeStart ()

Redefined in descendants as:
getRequired (line 78)

Returns array of required files to insert in require_once fields

This method should be extended to return an array of all files necessary for this tag to run. Each file will be called in a require_once field on top of gate code.

Example:

  1.  $req[NX_PATH_HANDLERS.'script.handler.php';
  2.  return $req;

  • return: required files
  • access: public
array getRequired ()

Redefined in descendants as:
reset (line 152)

Resets class Nexista_attributes between tags

  • access: public
void reset ()

Documentation generated on Tue, 11 Mar 2008 23:22:54 -0400 for Nexista 0.2.0