WPDK  1.5.0
WordPress Development Kit
 All Data Structures Files Functions Variables Pages
WPDKResult Class Reference
Inheritance diagram for WPDKResult:
WPDKError WPDKStatus WPDKWarning

Public Member Functions

 __construct ($code, $type=WPDKResultType::STATUS, $message= '', $data= '')
 Construct. More...
 
 display ($echo=true, $log=null)
 Display ot return output. More...
 
 getVarDump ($content)
 Do a var_dump. More...
 

Static Public Member Functions

static isError ($thing)
 Check whether variable is a WPDK result error. More...
 
static isWarning ($thing)
 Check whether variable is a WPDK result warning. More...
 
static isStatus ($thing)
 Check whether variable is a WPDK result status. More...
 

Protected Member Functions

 sanitizeCode ($code)
 Sanitize code id. More...
 

Static Protected Member Functions

static _is ($thing, $class= 'WPDKError')
 Generic object compare. More...
 

Detailed Description

The WPDKResult is an extension of WP_Error class. This class is used for subclass the three state of WPDK result. You rarely instance this class directly. The WPDK provides three classes for manage error, warning and status information feedback. Please check in wpdk-functions.php for is_wpdk_error() too.

Author
=undo= info@.nosp@m.wpxt.nosp@m.re.me
Date
2012-11-28
Version
0.8.1

Definition at line 31 of file wpdk-result.php.

Constructor & Destructor Documentation

__construct (   $code,
  $type = WPDKResultType::STATUS,
  $message = '',
  $data = '' 
)

Construct.

Create an instance of WPDKError class

Parameters
string$codeA lowercase string code id, ie. wpxcf_no_user_found
string$typeA WPDKResultType, default WPDKResultType::STATUS
string$messageError message
mixed$dataOptional. Error data.
Returns
WPDKResult

Definition at line 45 of file wpdk-result.php.

Member Function Documentation

static _is (   $thing,
  $class = 'WPDKError' 
)
staticprotected

Generic object compare.

Return true if $thing is an object of $class class name

Parameters
mixed$thingCheck if unknown variable is WPDKError object.
string$classClass name
Returns
bool

Definition at line 145 of file wpdk-result.php.

display (   $echo = true,
  $log = null 
)

Display ot return output.

Display or return a formatted output for WP_Error object. For each error in WP_Error object a formatted output is done with code error and error data.

Parameters
bool$echoTRUE to display or FALSE to get output
WPDKWatchDog$logA WPDKWatchDog object to log the display
Returns
string|void Formatted output if $echo is FALSE

Definition at line 63 of file wpdk-result.php.

getVarDump (   $content)

Do a var_dump.

Return the var_dump of mixed input

Parameters
mixed$contentMixed variable to grab
Returns
string

Definition at line 105 of file wpdk-result.php.

static isError (   $thing)
static

Check whether variable is a WPDK result error.

Looks at the object and if a WPDKError class. Does not check to see if the parent is also WPDKError or a WPDKResult, so can't inherit both the classes and still use this function.

Since
1.2.0
Parameters
mixed$thingCheck if unknown variable is WPDKError object.
Returns
bool TRUE, if WPDKError. FALSE, if not WPDKError.

Definition at line 164 of file wpdk-result.php.

static isStatus (   $thing)
static

Check whether variable is a WPDK result status.

Looks at the object and if a WPDKStatus class. Does not check to see if the parent is also WPDKStatus or a WPDKResult, so can't inherit both the classes and still use this function.

Since
1.2.0
Parameters
mixed$thingCheck if unknown variable is WPDKStatus object.
Returns
bool TRUE, if WPDKStatus. FALSE, if not WPDKStatus.

Definition at line 196 of file wpdk-result.php.

static isWarning (   $thing)
static

Check whether variable is a WPDK result warning.

Looks at the object and if a WPDKWarning class. Does not check to see if the parent is also WPDKWarning or a WPDKResult, so can't inherit both the classes and still use this function.

Since
1.2.0
Parameters
mixed$thingCheck if unknown variable is WPDKWarning object.
Returns
bool TRUE, if WPDKWarning. FALSE, if not WPDKWarning.

Definition at line 180 of file wpdk-result.php.

sanitizeCode (   $code)
protected

Sanitize code id.

The code must be a lowercase string with underscore separation.

Parameters
string$code
Returns
string

Definition at line 124 of file wpdk-result.php.


The documentation for this class was generated from the following file: