12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php namespace System\Validation\Rules;
- use System\Validation\Nullable_Rule;
- class Exclusion_Of extends Nullable_Rule {
-
- public $reserved;
-
- public function check($attribute, $attributes)
- {
- if ( ! is_null($nullable = parent::check($attribute, $attributes)))
- {
- return $nullable;
- }
- return ! in_array($attributes[$attribute], $this->reserved);
- }
-
- public function from($reserved)
- {
- $this->reserved = $reserved;
- return $this;
- }
- }
|