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