2014-11-30 07:52:17 -06:00
|
|
|
<?php
|
2014-12-06 05:12:55 -06:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletingTrait;
|
|
|
|
use Watson\Validating\ValidatingTrait;
|
2014-12-20 08:00:53 -06:00
|
|
|
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
2014-11-30 07:52:17 -06:00
|
|
|
|
2014-12-13 14:59:02 -06:00
|
|
|
/**
|
|
|
|
* Class TransactionGroup
|
|
|
|
*/
|
2014-12-06 05:12:55 -06:00
|
|
|
class TransactionGroup extends Eloquent
|
2014-11-30 07:52:17 -06:00
|
|
|
{
|
2014-12-06 05:12:55 -06:00
|
|
|
use SoftDeletingTrait, ValidatingTrait;
|
2014-11-30 07:52:17 -06:00
|
|
|
|
2014-12-06 05:12:55 -06:00
|
|
|
public static $rules
|
|
|
|
= [
|
|
|
|
'relation' => 'required|in:balance'
|
|
|
|
];
|
2014-11-30 07:52:17 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getDates()
|
|
|
|
{
|
|
|
|
return ['created_at', 'updated_at'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
*/
|
|
|
|
public function transactionjournals()
|
|
|
|
{
|
|
|
|
return $this->belongsToMany('TransactionJournal');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* User
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
|
|
|
public function user()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('User');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-01-01 23:16:49 -06:00
|
|
|
}
|