PHP 클래스 WPDKResult

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.
저자: =undo= ([email protected])
상속: extends WP_Error
파일 보기 프로젝트 열기: wpxtreme/wpdk 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $code, string $type = WPDKResultType::STATUS, string $message = '', mixed $data = '' ) : WPDKResult Create an instance of WPDKError class
display ( boolean $echo = true, WPDKWatchDog $log = null ) : string | void 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.
getVarDump ( mixed $content ) : string Return the var_dump of mixed input
isError ( mixed $thing ) : boolean 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.
isStatus ( mixed $thing ) : boolean 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.
isWarning ( mixed $thing ) : boolean 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.

보호된 메소드들

메소드 설명
_is ( mixed $thing, string $class = 'WPDKError' ) : boolean Return true if $thing is an object of $class class name
sanitizeCode ( string $code ) : string The code must be a lowercase string with underscore separation.

메소드 상세

__construct() 공개 메소드

Create an instance of WPDKError class
public __construct ( string $code, string $type = WPDKResultType::STATUS, string $message = '', mixed $data = '' ) : WPDKResult
$code string A lowercase string code id, ie. wpxcf_no_user_found
$type string A WPDKResultType, default WPDKResultType::STATUS
$message string Error message
$data mixed Optional. Error data.
리턴 WPDKResult

_is() 보호된 정적인 메소드

Return true if $thing is an object of $class class name
protected static _is ( mixed $thing, string $class = 'WPDKError' ) : boolean
$thing mixed Check if unknown variable is WPDKError object.
$class string Class name
리턴 boolean

display() 공개 메소드

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.
public display ( boolean $echo = true, WPDKWatchDog $log = null ) : string | void
$echo boolean TRUE to display or FALSE to get output
$log WPDKWatchDog A WPDKWatchDog object to log the display
리턴 string | void Formatted output if $echo is FALSE

getVarDump() 공개 메소드

Return the var_dump of mixed input
public getVarDump ( mixed $content ) : string
$content mixed Mixed variable to grab
리턴 string

isError() 공개 정적인 메소드

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.
부터: 1.2.0
public static isError ( mixed $thing ) : boolean
$thing mixed Check if unknown variable is WPDKError object.
리턴 boolean TRUE, if WPDKError. FALSE, if not WPDKError.

isStatus() 공개 정적인 메소드

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.
부터: 1.2.0
public static isStatus ( mixed $thing ) : boolean
$thing mixed Check if unknown variable is WPDKStatus object.
리턴 boolean TRUE, if WPDKStatus. FALSE, if not WPDKStatus.

isWarning() 공개 정적인 메소드

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.
부터: 1.2.0
public static isWarning ( mixed $thing ) : boolean
$thing mixed Check if unknown variable is WPDKWarning object.
리턴 boolean TRUE, if WPDKWarning. FALSE, if not WPDKWarning.

sanitizeCode() 보호된 메소드

The code must be a lowercase string with underscore separation.
protected sanitizeCode ( string $code ) : string
$code string
리턴 string