Files
snipe-it/app/models/Elegant.php
T
Brady Wetherington 1e4071b51d First stab at cleaning up Depreciation
Conflicts:
	app/models/Asset.php

It looks like the same time I pulled depreciation out of the
Asset class, uploads were being added in. It doesn't look
like a conflict to me, but git couldn't figure it out. Oh Well.
2015-02-17 17:39:39 -08:00

34 lines
654 B
PHP
Executable File

<?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;
}
public function validationRules($id = '0')
{
return str_replace("{id}", $id, $this->rules);
}
}