Files
firefly-iii/app/Models/LimitRepetition.php

40 lines
736 B
PHP
Raw Normal View History

2015-02-27 16:48:33 +01:00
<?php namespace FireflyIII\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class LimitRepetition
*
* @package FireflyIII\Models
*/
class LimitRepetition extends Model
{
2015-05-23 17:11:16 +02:00
protected $hidden = ['amount_encrypted'];
2015-02-27 16:48:33 +01:00
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function budgetLimit()
{
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
}
2015-05-23 17:11:16 +02:00
/**
* @return array
*/
public function getDates()
{
return ['created_at', 'updated_at', 'startdate', 'enddate'];
}
2015-05-23 08:46:46 +02:00
/**
* @param $value
*/
public function setAmountAttribute($value)
{
2015-05-24 08:00:40 +02:00
$this->attributes['amount'] = strval(round($value, 2));
2015-05-23 08:46:46 +02:00
}
2015-02-27 16:48:33 +01:00
}