firefly-iii/app/Models/PiggyBank.php
2015-02-11 07:35:10 +01:00

55 lines
1.2 KiB
PHP

<?php namespace FireflyIII\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class PiggyBank
*
* @package FireflyIII\Models
*/
class PiggyBank extends Model
{
use SoftDeletes;
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function account()
{
return $this->belongsTo('FireflyIII\Models\Account');
}
/**
* @return array
*/
public function getDates()
{
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function piggyBankEvents()
{
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function piggyBankRepetitions()
{
return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
}
/**
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function reminders()
{
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
}
}