2016-12-22 09:36:56 -06:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* AvailableBudget.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-04-09 00:44:22 -05:00
|
|
|
declare(strict_types=1);
|
2016-12-22 09:36:56 -06:00
|
|
|
|
|
|
|
namespace FireflyIII\Models;
|
|
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class AvailableBudget
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Models
|
|
|
|
*/
|
|
|
|
class AvailableBudget extends Model
|
|
|
|
{
|
|
|
|
use SoftDeletes;
|
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',
|
|
|
|
'deleted_at' => 'date',
|
|
|
|
'start_date' => 'date',
|
2016-12-30 06:47:23 -06:00
|
|
|
'end_date' => 'date',
|
2016-12-24 10:36:51 -06:00
|
|
|
];
|
2016-12-30 06:47:23 -06:00
|
|
|
/** @var array */
|
|
|
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
|
|
|
/** @var array */
|
|
|
|
protected $fillable = ['user_id', 'transaction_currency_id', 'amount', 'start_date', 'end_date'];
|
2016-12-24 10:36:51 -06:00
|
|
|
|
2016-12-22 09:36:56 -06:00
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
|
|
|
public function transactionCurrency()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('FireflyIII\Models\TransactionCurrency');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return BelongsTo
|
|
|
|
*/
|
|
|
|
public function user(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo('FireflyIII\User');
|
|
|
|
}
|
2016-12-22 12:42:45 -06:00
|
|
|
}
|