2014-11-30 07:52:17 -06:00
|
|
|
<?php
|
|
|
|
use LaravelBook\Ardent\Ardent;
|
|
|
|
|
2014-11-30 23:09:27 -06:00
|
|
|
/**
|
|
|
|
* TransactionGroup
|
|
|
|
*
|
|
|
|
* @property integer $id
|
|
|
|
* @property \Carbon\Carbon $created_at
|
|
|
|
* @property \Carbon\Carbon $updated_at
|
|
|
|
* @property integer $user_id
|
|
|
|
* @property string $relation
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
|
|
|
|
* @property-read \User $user
|
2014-12-05 15:50:26 -06:00
|
|
|
* @method static \Illuminate\Database\Query\Builder|\TransactionGroup whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\TransactionGroup whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\TransactionGroup whereUpdatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\TransactionGroup whereUserId($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\TransactionGroup whereRelation($value)
|
2014-11-30 23:09:27 -06:00
|
|
|
*/
|
2014-11-30 07:52:17 -06:00
|
|
|
class TransactionGroup extends Ardent
|
|
|
|
{
|
|
|
|
|
|
|
|
public static $rules = [
|
|
|
|
'relation' => 'required|in:balance'
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|