attributes = $attributes; } /** * Run the validation rule. * * @param array $attributes * @param Error_Collector $errors * @return void */ public function validate($attributes, $errors) { foreach ($this->attributes as $attribute) { $this->error = null; if ( ! $this->check($attribute, $attributes)) { $errors->add($attribute, Message::get($this, $attribute)); } } } /** * Set the validation error message. * * @param string $message * @return Rule */ public function message($message) { $this->message = $message; return $this; } }