2015-02-06 04:52:16 +01:00
|
|
|
<?php namespace FireflyIII\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
2015-02-06 05:04:06 +01:00
|
|
|
class Budget extends Model
|
|
|
|
|
{
|
2015-02-06 04:52:16 +01:00
|
|
|
|
2015-02-06 05:14:27 +01:00
|
|
|
|
|
|
|
|
public function budgetlimits()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany('BudgetLimit');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function limitrepetitions()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasManyThrough('LimitRepetition', 'BudgetLimit', 'budget_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function transactionjournals()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsToMany('TransactionJournal', 'budget_transaction_journal', 'budget_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo('User');
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-06 04:52:16 +01:00
|
|
|
|
|
|
|
|
}
|