2015-02-06 04:52:16 +01:00
|
|
|
<?php namespace FireflyIII\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2015-02-07 23:19:28 +01:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2015-02-06 04:52:16 +01:00
|
|
|
|
2015-02-11 07:35:10 +01:00
|
|
|
/**
|
|
|
|
* Class PiggyBank
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Models
|
|
|
|
*/
|
2015-02-06 05:04:06 +01:00
|
|
|
class PiggyBank extends Model
|
|
|
|
{
|
2015-02-07 23:19:28 +01:00
|
|
|
use SoftDeletes;
|
2015-02-06 04:52:16 +01:00
|
|
|
|
2015-02-11 07:35:10 +01:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
2015-02-06 05:14:27 +01:00
|
|
|
public function account()
|
|
|
|
{
|
2015-02-06 05:35:00 +01:00
|
|
|
return $this->belongsTo('FireflyIII\Models\Account');
|
2015-02-06 05:14:27 +01:00
|
|
|
}
|
2015-02-06 04:52:16 +01:00
|
|
|
|
2015-02-11 07:35:10 +01:00
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
2015-02-07 13:15:40 +01:00
|
|
|
public function getDates()
|
|
|
|
{
|
|
|
|
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
|
|
|
|
}
|
|
|
|
|
2015-02-11 07:35:10 +01:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2015-02-06 05:14:27 +01:00
|
|
|
public function piggyBankEvents()
|
|
|
|
{
|
2015-02-06 05:35:00 +01:00
|
|
|
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
2015-02-06 05:14:27 +01:00
|
|
|
}
|
|
|
|
|
2015-02-11 07:35:10 +01:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
2015-02-06 05:14:27 +01:00
|
|
|
public function piggyBankRepetitions()
|
|
|
|
{
|
2015-02-06 05:35:00 +01:00
|
|
|
return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
|
2015-02-06 05:14:27 +01:00
|
|
|
}
|
|
|
|
|
2015-02-11 07:35:10 +01:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
|
|
|
*/
|
2015-02-06 05:14:27 +01:00
|
|
|
public function reminders()
|
|
|
|
{
|
2015-02-06 05:35:00 +01:00
|
|
|
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
|
2015-02-06 05:14:27 +01:00
|
|
|
}
|
2015-02-06 04:52:16 +01:00
|
|
|
}
|