Files
snipe-it/app/models/Depreciation.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

21 lines
502 B
PHP
Executable File

<?php
class Depreciation extends Elegant
{
// Declare the rules for the form validation
protected $rules = array(
'name' => 'required|alpha_space|min:3|max:255|unique:depreciations,name,{id}',
'months' => 'required|min:1|max:240|integer',
);
public function has_models()
{
return $this->hasMany('Model', 'depreciation_id')->count();
}
public function has_licenses()
{
return $this->hasMany('License','depreciation_id')->count();
}
}