Files
snipe-it/app/models/Elegant.php
T
2013-11-17 21:46:19 -05:00

29 lines
539 B
PHP

<?
class Elegant extends Eloquent
{
protected $rules = array();
protected $errors;
public function validate($data)
{
// make a new validator object
$v = Validator::make($data, $this->rules);
// check for failure
if ($v->fails())
{
// set errors and return false
$this->errors = $v->errors();
return false;
}
// validation pass
return true;
}
public function errors()
{
return $this->errors;
}
}