firefly-iii/app/Models/AccountMeta.php
2015-02-07 13:15:40 +01:00

30 lines
518 B
PHP

<?php namespace FireflyIII\Models;
use Illuminate\Database\Eloquent\Model;
class AccountMeta extends Model
{
public function account()
{
return $this->belongsTo('FireflyIII\Models\Account');
}
public function getDataAttribute($value)
{
return json_decode($value);
}
public function getDates()
{
return ['created_at', 'updated_at'];
}
public function setDataAttribute($value)
{
$this->attributes['data'] = json_encode($value);
}
}