statusCode = $statusCode; $this->errorCode = $errorCode; } /** * Gets the status bitfield for this verification result. * * @return int status bitfield */ public function getStatusCode() { return $this->statusCode; } /** * Gets the error bitfield for this verification result. * * @return int error bitfield */ public function getErrorCode() { return $this->errorCode; } /** * Checks if this verification result has specified status code set. * * @param int $statusCode the status code to check for * @return bool true if this verification result has specified status code set */ public function hasStatus($statusCode) { return ($statusCode & $this->statusCode) > 0; } /** * Checks if this verification result has specified error code set. * * @param int $errorCode the error code to check for * @return bool */ public function hasError($errorCode) { return ($errorCode & $this->errorCode) > 0; } /** * Checks if this verification result is valid. * * @return bool true if no error codes are set */ public function isValid() { return $this->errorCode == self::NO_FAILURES; } /** * Updates this verification result status bitfield with specified status code. * * @param int $statusCode the status code to set * @return void */ public function updateStatus($statusCode) { $this->statusCode |= $statusCode; } /** * Updates this verification result error bitfield with specified error code. * * @param int $errorCode the error code to set * @return void */ public function updateErrors($errorCode) { $this->errorCode |= $errorCode; } } ?>