Skip to content

Commit 6e6e11f

Browse files
author
Christopher Stebe
committed
removed set of model rules in ActiveRecordAccessTrait, not necessary
1 parent 665b534 commit 6e6e11f

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

db/traits/ActiveRecordAccessTrait.php

-60
Original file line numberDiff line numberDiff line change
@@ -86,66 +86,6 @@ public static function find()
8686
return $query;
8787
}
8888

89-
/**
90-
* @inheritdoc
91-
*/
92-
public function rules()
93-
{
94-
$accessOwner = self::accessColumnAttributes()['owner'];
95-
$accessRead = self::accessColumnAttributes()['read'];
96-
$accessUpdate = self::accessColumnAttributes()['update'];
97-
$accessDelete = self::accessColumnAttributes()['delete'];
98-
$accessDomain = self::accessColumnAttributes()['domain'];
99-
100-
// safe validator
101-
$safe = [];
102-
103-
// string validator
104-
$string = [];
105-
106-
// default validator
107-
$default = [];
108-
109-
// integer validator
110-
$integer = [];
111-
112-
// add used attributes to validation rules
113-
if ($accessOwner) {
114-
array_push($safe, $accessOwner);
115-
array_push($integer, $accessOwner);
116-
}
117-
if ($accessRead) {
118-
array_push($safe, $accessRead);
119-
array_push($string, $accessRead);
120-
array_push($default, $accessRead);
121-
}
122-
if ($accessUpdate) {
123-
array_push($safe, $accessUpdate);
124-
array_push($string, $accessUpdate);
125-
array_push($default, $accessUpdate);
126-
}
127-
if ($accessDelete) {
128-
array_push($safe, $accessDelete);
129-
array_push($string, $accessDelete);
130-
array_push($default, $accessDelete);
131-
}
132-
if ($accessDomain) {
133-
array_push($safe, $accessDomain);
134-
array_push($string, $accessDomain);
135-
array_push($default, $accessDomain);
136-
}
137-
138-
return ArrayHelper::merge(
139-
parent::rules(),
140-
[
141-
[$safe, 'safe'],
142-
[$string, 'string', 'max' => 255],
143-
[$default, 'default', 'value' => null],
144-
[$integer, 'integer']
145-
]
146-
);
147-
}
148-
14989
/**
15090
* @inheritdoc
15191
*/

0 commit comments

Comments
 (0)