| 1 | <?php |
||
| 5 | class ValidatorResult |
||
| 6 | { |
||
| 7 | |||
| 8 | const ERROR_NODE_HAS_EXCESSIVE_KEYS = 1; |
||
| 9 | const ERROR_NODE_HAS_NO_FIELD_TYPE = 2; |
||
| 10 | const ERROR_SCHEMA_HAS_NO_ROOT_ELEMENT = 3; |
||
| 11 | const ERROR_VALIDATOR_CLASS_NOT_FOUND = 4; |
||
| 12 | const ERROR_REQUIRED_FIELD_IS_EMPTY = 5; |
||
| 13 | const ERROR_NODE_IS_NOT_VALID = 6; |
||
| 14 | const ERROR_NESTED_ELEMENT_NOT_VALID = 7; |
||
| 15 | |||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $log = null; |
||
| 21 | /** |
||
| 22 | * Last error. |
||
| 23 | * |
||
| 24 | * @var int |
||
| 25 | */ |
||
| 26 | protected $errorCode = null; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | protected $errorMessage = null; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | protected $errorNode = null; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Gets error. |
||
| 40 | * |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | public function getErrorInfo() |
||
| 51 | |||
| 52 | |||
| 53 | /** |
||
| 54 | * Sets error. |
||
| 55 | * |
||
| 56 | * @param int $code |
||
| 57 | * @param string $message |
||
| 58 | */ |
||
| 59 | public function setError($code, $node, $message = '') |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | public function getErrorCode() |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @return string |
||
| 76 | */ |
||
| 77 | public function getErrorMessage() |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @return string |
||
| 84 | */ |
||
| 85 | public function getErrorNode() |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @return string |
||
| 92 | */ |
||
| 93 | public function getLog() |
||
| 97 | |||
| 98 | /** |
||
| 99 | * @param $log |
||
| 100 | * |
||
| 101 | * @return $this |
||
| 102 | */ |
||
| 103 | public function setLog($log) |
||
| 109 | |||
| 110 | |||
| 111 | |||
| 112 | /** |
||
| 113 | * @return bool |
||
| 114 | */ |
||
| 115 | public function isValid() |
||
| 119 | } |
||
| 120 |