-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSC_ElementValidationException.php
More file actions
49 lines (45 loc) · 1.33 KB
/
SC_ElementValidationException.php
File metadata and controls
49 lines (45 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/*
Sow Peace License (MIT-Compatible with Attribution Visit)
Copyright (c) 2025 Ruben Schaffer Levine and Luca Lauretta
https://simplonphp.org/Sow-PeaceLicense.txt
*/
/**
* Exception class for element validation errors.
*
* @version 1b.1.0
* @package SimplOn\Core
* @author Luca Lauretta
*/
class SC_ElementValidationException extends \SC_Exception {
/**
* @var array An array to store validation messages.
*/
protected $datasValidationMessages = array();
/**
* Constructor.
*
* @param array $datasValidationMessages An array of validation messages.
* @param string $message The exception message.
* @param int $code The exception code.
* @param \Throwable $previous The previous throwable used for the exception chaining.
*/
public function __construct(){
$args = func_get_args();
$this->datasValidationMessages(array_shift($args));
call_user_func_array(array('parent', '__construct'), $args);
}
/**
* Get or set the data validation messages.
*
* @param array $array Optional. An array of validation messages to set. If empty, the current messages are returned.
* @return array The data validation messages.
*/
public function datasValidationMessages($array = array()){
if(empty($array)){
return $this->datasValidationMessages;
}else{
$this->datasValidationMessages = $array;
}
}
}