2014-06-29 22:12:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
2014-07-03 21:31:32 +02:00
|
|
|
class TransactionJournal extends Elegant
|
|
|
|
{
|
2014-06-29 22:12:33 +02:00
|
|
|
|
2014-07-03 21:31:32 +02:00
|
|
|
public static $rules
|
|
|
|
= [
|
|
|
|
'transaction_type_id' => 'required|exists:transaction_types,id',
|
|
|
|
'transaction_currency_id' => 'required|exists:transaction_currencies,id',
|
|
|
|
'description' => 'between:1,255',
|
|
|
|
'date' => 'date',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function transactionType()
|
|
|
|
{
|
2014-06-29 22:12:33 +02:00
|
|
|
return $this->belongsTo('TransactionType');
|
|
|
|
}
|
2014-07-03 21:31:32 +02:00
|
|
|
|
|
|
|
public function transactionCurrency()
|
|
|
|
{
|
2014-06-29 22:12:33 +02:00
|
|
|
return $this->belongsTo('TransactionCurrency');
|
|
|
|
}
|
|
|
|
|
2014-07-03 21:31:32 +02:00
|
|
|
public function transactions()
|
|
|
|
{
|
2014-06-29 22:12:33 +02:00
|
|
|
return $this->hasMany('Transaction');
|
|
|
|
}
|
|
|
|
|
2014-07-03 21:31:32 +02:00
|
|
|
public function getDates()
|
|
|
|
{
|
|
|
|
return array('created_at', 'updated_at', 'date');
|
|
|
|
}
|
|
|
|
|
2014-06-29 22:12:33 +02:00
|
|
|
}
|