mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Some new code, transaction groups among them.
This commit is contained in:
38
app/models/TransactionGroup.php
Normal file
38
app/models/TransactionGroup.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
use LaravelBook\Ardent\Ardent;
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user