Overview

Namespaces

  • SKJ
    • AppException
      • HTTP
      • Logic
      • Runtime

Exceptions

  • AbstractContainerException
  • AbstractDateTimeException
  • AbstractHttpException
  • AbstractValidationException
  • HttpException
  • LogicException
  • RuntimeException
  • Overview
  • Namespace
  • Class

Class AbstractValidationException

バリデーションエラー実行例外の抽象クラス

バリデーション処理がに失敗した場合に使用する例外です

◆詳細◆

  • このクラスは抽象クラスです
Exception
Extended by SKJ\AppException implements SKJ\AppExceptionInterface uses SKJ\AppExceptionMethods
Extended by SKJ\AppException\RuntimeException
Extended by SKJ\AppException\AbstractValidationException

Direct known subclasses

SKJ\AppException\Runtime\ValidationException
Namespace: SKJ\AppException
Package: SKJ\AppException
Copyright: 2019 Seikouhou.
License: MIT
Author: y3high y3public@49364.net
Version: 0.8.0
Since: Class available since Release 0.8.0
Located at exceptions/AbstractValidationException.php
Methods summary
public SKJ\AppException\AbstractValidationException
# setCodeToAll( integer $code )

連結された例外も対象とし、例外コードを変更

連結された例外も対象とし、例外コードを変更

Parameters

$code
例外コード

Returns

SKJ\AppException\AbstractValidationException
自分自身を返す

Api

public static|null
# extractBy( array $fields = [], boolean $multiField = true )

指定されたフィールド名に関する例外のみを抽出

指定されたフィールド名に関する例外のみを抽出

第1引数仕様 - 抽出フィールド名

[
    (string)抽出対象のフィールド => (string|null)変更したいフィールド名,...
                                ※フィールド名の変更の必要が無ければnull
]

Parameters

$fields
抽出フィールド名
$multiField
複数フィールド間に渡ったエラーも対象とするか

Returns

static|null
抽出された例外、抽出結果がない場合はnull

Api

public boolean
# hasErrorOn( string|array $fields, boolean $multiField = true )

指定されたフィールドにエラーが発生したかを調べる

指定されたフィールドにエラーが発生したかを調べる

Parameters

$fields
調べたいフィールド名、配列で複数指定も可
$multiField
複数フィールド間に渡ったエラーも対象とするか

Returns

boolean
フィールドにエラーがあれば真、無ければ偽

Api

public array
# getMessageArray( array $renameFields = [] )

発生したエラーメッセージを配列にまとめて返す

発生したエラーメッセージを配列にまとめて返す

同一フィールドに複数メッセージが設定されている場合は最初に発生したものが返される

戻り値仕様 - エラーメッセージ配列

[
    (string)フィールド名 => (string)エラーメッセージ,...
]

Parameters

$renameFields
変更したいフィールド名が入った配列(※フィールド名が違う可能性もある)

Returns

array
エラーメッセージ配列

Api

Methods inherited from SKJ\AppException
__construct(), getCallerVars(), getGlobalVars()
Methods inherited from Exception
__toString(), __wakeup(), getCode(), getFile(), getLine(), getMessage(), getPrevious(), getTrace(), getTraceAsString()
Methods inherited from SKJ\AppExceptionInterface
disableSkipContainer(), enableSkipContainer(), forge(), getBaseExceptionCode(), getCallQueue(), getClass(), getExceptionLog(), getFields(), getFuncArgsInCurrentContext(), getFunction(), getFunctionInCurrentContext(), getLineInCurrentContext(), getOriginalClassName(), getOriginalException(), getStatusCode(), isExtension(), renew(), resetFilter(), setCode(), setFields(), setFile(), setFilter(), setLine(), setMessage(), setSortOrder(), setStatusCode(), wasCreatedInCurrentContext()
Methods inherited from IteratorAggregate
getIterator()
Methods used from SKJ\AppExceptionMethods
disableSkipContainer(), enableSkipContainer(), forge(), getBaseExceptionCode(), getCallQueue(), getClass(), getExceptionLog(), getFields(), getFuncArgsInCurrentContext(), getFunction(), getFunctionInCurrentContext(), getLineInCurrentContext(), getOriginalClassName(), getOriginalException(), getStatusCode(), isExtension(), renew(), resetFilter(), setCode(), setFields(), setFile(), setFilter(), setLine(), setMessage(), setSortOrder(), setStatusCode(), wasCreatedInCurrentContext()
Constants inherited from SKJ\AppException
OPT_CALLER_VARS_SNAPSHOT, OPT_GLOBAL_VARS_SNAPSHOT
Constants inherited from SKJ\AppExceptionInterface
SORT_ORDER_ASC, SORT_ORDER_DESC
Properties summary
protected integer $iteratorSortOrder

エラーとして発生順の早いものから返す

エラーとして発生順の早いものから返す

Uses

self::SORT_ORDER_ASC 初期値として使用

Api

# self::SORT_ORDER_ASC
Properties inherited from SKJ\AppException\RuntimeException
$defCode, $defMessage, $messageTemplate, $statusCode
Properties inherited from SKJ\AppException
$enableCallerVarsSnapShot, $enableGlobalVarsSnapShot
Properties inherited from Exception
$code, $file, $line, $message
API documentation generated by ApiGen