firefly-iii/app/models/TransactionCurrency.php

30 lines
759 B
PHP
Raw Normal View History

<?php
use Illuminate\Database\Eloquent\Model as Eloquent;
2014-12-06 05:12:55 -06:00
use Illuminate\Database\Eloquent\SoftDeletingTrait;
use Watson\Validating\ValidatingTrait;
2014-12-24 05:32:18 -06:00
2014-12-13 14:59:02 -06:00
/**
* Class TransactionCurrency
*/
class TransactionCurrency extends Eloquent
{
2014-12-06 05:12:55 -06:00
use SoftDeletingTrait, ValidatingTrait;
2014-12-24 05:32:18 -06:00
protected $fillable = ['name', 'symbol', 'code'];
2014-12-24 07:02:21 -06:00
protected $rules = [
'code' => 'required|alpha|between:3,3|min:3|max:3',
'name' => 'required|between:3,48|min:3|max:48',
'symbol' => 'required|between:1,8|min:1|max:8',
2014-12-24 05:32:18 -06:00
];
2014-08-10 11:22:42 -05:00
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
2014-11-21 04:11:52 -06:00
public function transactionJournals()
{
return $this->hasMany('TransactionJournal');
}
2015-01-01 23:16:49 -06:00
}