/** * Init function. * * @param $code * @param $message * @param $data */ function __construct($code = 'types_error', $message = '', $data = '') { parent::__construct($code, $message, $data); $this->clearErrors(); }
/** * Class constructor. * * @since 0.5.0 * @param string $code the error code * @param string $message the error message * @param string $data additional data for the error * @param string $scope the error scope */ public function __construct($code = '', $message = '', $data = '', $scope = '') { parent::__construct($code, $message, $data); $this->scope = $scope; }
/** * Create an instance of WPDKError class * * @brief Construct * * @param string $code A lowercase string code id, ie. wpxcf_no_user_found * @param string $type A WPDKResultType, default WPDKResultType::STATUS * @param string $message Error message * @param mixed $data Optional. Error data. * * @return WPDKResult */ public function __construct($code, $type = WPDKResultType::STATUS, $message = '', $data = '') { $new_code = sprintf('%s-%s', $type, $code); $sanitize_code = $this->sanitizeCode($new_code); parent::__construct($sanitize_code, $message, $data); }