mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Add some hasManyThrough references
This commit is contained in:
@@ -145,6 +145,7 @@ class Account extends Ardent
|
||||
|
||||
/**
|
||||
* TODO see if this scope is still used.
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param array $types
|
||||
*/
|
||||
@@ -157,6 +158,11 @@ class Account extends Ardent
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->hasManyThrough('TransactionJournal', 'Transaction');
|
||||
}
|
||||
|
||||
/**
|
||||
* User
|
||||
*
|
||||
|
@@ -24,6 +24,11 @@ class Budget extends Component
|
||||
{
|
||||
protected $isSubclass = true;
|
||||
|
||||
public function limitrepetitions()
|
||||
{
|
||||
return $this->hasManyThrough('LimitRepetition', 'Limit');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
|
@@ -58,7 +58,6 @@ class Component extends SingleTableInheritanceEntity
|
||||
return $this->belongsToMany('TransactionJournal', 'component_transaction_journal', 'component_id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
|
@@ -80,6 +80,7 @@ class LimitRepetition extends Ardent
|
||||
return $this->belongsTo('Limit');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO remove this method in favour of something in the FireflyIII libraries.
|
||||
*
|
||||
|
@@ -21,7 +21,7 @@ class TransactionCurrency extends Eloquent
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function transactionjournals()
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->hasMany('TransactionJournal');
|
||||
}
|
||||
|
@@ -40,8 +40,12 @@ class User extends Ardent implements UserInterface, RemindableInterface
|
||||
|
||||
|
||||
public static $rules
|
||||
= ['email' => 'required|email|unique:users,email', 'migrated' => 'required|boolean', 'password' => 'required|between:60,60',
|
||||
'reset' => 'between:32,32',];
|
||||
= [
|
||||
'email' => 'required|email|unique:users,email',
|
||||
'migrated' => 'required|boolean',
|
||||
'password' => 'required|between:60,60',
|
||||
'reset' => 'between:32,32',
|
||||
];
|
||||
protected $fillable = ['email'];
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
@@ -92,6 +96,10 @@ class User extends Ardent implements UserInterface, RemindableInterface
|
||||
{
|
||||
return $this->hasManyThrough('Piggybank', 'Account');
|
||||
}
|
||||
public function transactions()
|
||||
{
|
||||
return $this->hasManyThrough('TransactionJournal', 'Transaction');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
|
Reference in New Issue
Block a user