-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathValidatingModelInterface.php
More file actions
136 lines (122 loc) · 3.29 KB
/
ValidatingModelInterface.php
File metadata and controls
136 lines (122 loc) · 3.29 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
namespace Esensi\Model\Contracts;
use Watson\Validating\ValidatingInterface;
/**
* Validating Model Interface.
*
*/
interface ValidatingModelInterface extends ValidatingInterface
{
/**
* Get the default ruleset for any event. Will first search to see if a
* 'saving' ruleset exists, fallback to '$rules' and otherwise return
* an empty array.
*
* @deprecated watson/validating@0.10.9
*
* @return array
*/
public function getDefaultRules();
/**
* Get all the rulesets.
*
* @deprecated watson/validating@0.10.9
*
* @return array
*/
public function getRulesets();
/**
* Set all the rulesets.
*
* @deprecated watson/validating@0.10.9
*
* @param array $rulesets
*/
public function setRulesets(array $rulesets = null);
/**
* Get a ruleset, and merge it with saving if required.
*
* @deprecated watson/validating@0.10.9
*
* @param string $ruleset
* @param bool $mergeWithSaving
*
* @return array
*/
public function getRuleset($ruleset, $mergeWithSaving = false);
/**
* Set the rules used for a particular ruleset.
*
* @deprecated watson/validating@0.10.9
*
* @param array $rules
* @param string $ruleset
*/
public function setRuleset(array $rules, $ruleset);
/**
* Add rules to the existing rules or ruleset, overriding any existing.
*
* @deprecated watson/validating@0.10.9
*
* @param array $rules
* @param string $ruleset
*/
public function addRules(array $rules, $ruleset = null);
/**
* Remove rules from the existing rules or ruleset.
*
* @deprecated watson/validating@0.10.9
*
* @param mixed $keys
* @param string $ruleset
*/
public function removeRules($keys, $ruleset = null);
/**
* Helper method to merge rulesets, with later rules overwriting
* earlier ones.
*
* @deprecated watson/validating@0.10.9
*
* @param array $keys
*
* @return array
*/
public function mergeRulesets($keys);
/**
* Returns whether the model is valid or not.
*
* @param mixed $ruleset (@deprecated watson/validating@0.10.9)
* @param bool $mergeWithSaving (@deprecated watson/validating@0.10.9)
*
* @return bool
*/
public function isValid($ruleset = null, $mergeWithSaving = true);
/**
* Returns if the model is valid, otherwise throws an exception.
*
* @param string $ruleset (@deprecated watson/validating@0.10.9)
*
* @throws Watson\Validating\ValidationException
*
* @return bool
*/
public function isValidOrFail($ruleset = null);
/**
* Returns whether the model is invalid or not.
*
* @param mixed $ruleset (@deprecated watson/validating@0.10.9)
* @param bool $mergeWithSaving (@deprecated watson/validating@0.10.9)
*
* @return bool
*/
public function isInvalid($ruleset = null, $mergeWithSaving = true);
/**
* Update the unique rules of the given ruleset to
* include the model identifier.
*
* @deprecated watson/validating@0.10.9
*
* @param string $ruleset
*/
public function updateRulesetUniques($ruleset = null);
}