firefly-iii/app/Models/AccountType.php

60 lines
1.3 KiB
PHP
Raw Normal View History

2016-05-20 01:57:45 -05:00
<?php
/**
* AccountType.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
2017-03-24 09:15:12 -05:00
declare(strict_types=1);
2016-05-20 01:57:45 -05:00
namespace FireflyIII\Models;
2015-02-27 09:48:33 -06:00
use Illuminate\Database\Eloquent\Model;
2016-04-06 02:27:45 -05:00
use Illuminate\Database\Eloquent\Relations\HasMany;
2015-02-27 09:48:33 -06:00
2016-11-18 13:06:08 -06:00
/**
* Class AccountType
*
* @package FireflyIII\Models
*/
2015-02-27 09:48:33 -06:00
class AccountType extends Model
{
2016-05-13 08:53:39 -05:00
const DEFAULT = 'Default account';
const CASH = 'Cash account';
const ASSET = 'Asset account';
const EXPENSE = 'Expense account';
const REVENUE = 'Revenue account';
const INITIAL_BALANCE = 'Initial balance account';
const BENEFICIARY = 'Beneficiary account';
const IMPORT = 'Import account';
2015-02-27 09:48:33 -06:00
2016-12-24 10:36:51 -06:00
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts
= [
'created_at' => 'date',
'updated_at' => 'date',
];
/** @var array */
2016-01-15 15:32:21 -06:00
protected $dates = ['created_at', 'updated_at'];
2015-02-27 09:48:33 -06:00
//
2017-03-24 09:15:12 -05:00
2015-02-27 09:48:33 -06:00
/**
2016-04-06 02:27:45 -05:00
* @return HasMany
2015-02-27 09:48:33 -06:00
*/
2016-04-06 02:27:45 -05:00
public function accounts(): HasMany
2015-02-27 09:48:33 -06:00
{
return $this->hasMany('FireflyIII\Models\Account');
}
}