Class WFErrorsException

Description

A special WFException subclass meant for carrying multiple WFError objects.

WFPage automatically catches WFErrorsException's thrown from action methods and displays the errors.

WFErrorsException knows how to handle the multi-level error structure used by WFKeyValueCoding::validateObject().

Located in /framework/WFError.php (line 75)

Exception
   |
   --WFException
      |
      --WFErrorsException
Variable Summary
mixed $errors
Method Summary
WFErrorsException __construct ( $errors)
array allErrors ()
void errorCodesForKey ( $key)
array errors ()
array errorsForKey ( $key)
array generalErrors ()
void propagateErrorsForKeyToWidget (string $key, object WFWidget $widget, [bolean $prune = true])
Variables
mixed $errors (line 77)
  • access: protected
Methods
Constructor __construct (line 79)
WFErrorsException __construct ( $errors)
  • $errors
allErrors (line 122)

Get all errors in the current exception.

  • return: An array of all WFError objects.
  • access: public
array allErrors ()
errorCodesForKey (line 152)
  • access: public
void errorCodesForKey ( $key)
  • $key
errors (line 95)

Get all errors in the format prescribed by WFKeyValueCoding::validateObject()

  • access: public
array errors ()
errorsForKey (line 143)

Get all errors for the given key.

  • return: An array of all WFError objects.
  • access: public
array errorsForKey ( $key)
  • $key
generalErrors (line 105)

Get the errors that are not mapped to specific properties.

  • return: An array of WFError objects.
  • access: public
array generalErrors ()
propagateErrorsForKeyToWidget (line 171)

Inform a widget of all errors for the given key.

Optionally [and by default], prune the errors that have been propagated from the current list. Since the caller will typically re-throw this exception to be caught by the WFPage, the auto-pruning prevents errors from appearing twice, as the WFPage will automatically detect and report all errors as well (although not linked to widgets).

  • access: public
void propagateErrorsForKeyToWidget (string $key, object WFWidget $widget, [bolean $prune = true])
  • string $key: The key which generated the errors
  • object WFWidget $widget: The widget that the errors should be reported to.
  • bolean $prune: Prune errors for this key from the exception object.

Documentation generated on Thu, 14 May 2009 16:19:59 -0400 by phpDocumentor 1.4.2