Files
firefly-iii/app/models/BudgetLimit.php

50 lines
989 B
PHP
Raw Normal View History

<?php
2014-12-06 12:12:55 +01:00
use Watson\Validating\ValidatingTrait;
2014-12-13 21:59:02 +01:00
/**
* Class Limit
*/
class BudgetLimit extends Eloquent
{
2014-12-06 12:12:55 +01:00
use ValidatingTrait;
public static $rules
2014-11-18 09:47:50 +01:00
= [
'budget_id' => 'required|exists:budgets,id',
'startdate' => 'required|date',
'amount' => 'numeric|required|min:0.01',
'repeats' => 'required|boolean',
'repeat_freq' => 'required|in:daily,weekly,monthly,quarterly,half-year,yearly'
];
2014-08-10 18:22:42 +02:00
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
2014-07-30 22:31:35 +02:00
public function budget()
{
return $this->belongsTo('Budget');
2014-07-30 22:31:35 +02:00
}
2014-08-10 18:22:42 +02:00
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
2014-07-23 06:57:51 +02:00
public function limitrepetitions()
{
return $this->hasMany('LimitRepetition');
}
2014-08-09 19:10:31 +02:00
2014-08-10 18:22:42 +02:00
/**
* @return array
*/
public function getDates()
{
return ['created_at', 'updated_at', 'startdate', 'enddate'];
}
2015-01-02 06:16:49 +01:00
}