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.
|
* TODO see if this scope is still used.
|
||||||
|
*
|
||||||
* @param Builder $query
|
* @param Builder $query
|
||||||
* @param array $types
|
* @param array $types
|
||||||
*/
|
*/
|
||||||
@@ -157,6 +158,11 @@ class Account extends Ardent
|
|||||||
$query->whereIn('account_types.type', $types);
|
$query->whereIn('account_types.type', $types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function transactionjournals()
|
||||||
|
{
|
||||||
|
return $this->hasManyThrough('TransactionJournal', 'Transaction');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User
|
* User
|
||||||
*
|
*
|
||||||
|
@@ -3,16 +3,16 @@
|
|||||||
/**
|
/**
|
||||||
* Budget
|
* Budget
|
||||||
*
|
*
|
||||||
* @property integer $id
|
* @property integer $id
|
||||||
* @property \Carbon\Carbon $created_at
|
* @property \Carbon\Carbon $created_at
|
||||||
* @property \Carbon\Carbon $updated_at
|
* @property \Carbon\Carbon $updated_at
|
||||||
* @property string $name
|
* @property string $name
|
||||||
* @property integer $user_id
|
* @property integer $user_id
|
||||||
* @property string $class
|
* @property string $class
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Limit[] $limits
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Limit[] $limits
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
|
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
|
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
|
||||||
* @property-read \User $user
|
* @property-read \User $user
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Budget whereId($value)
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereId($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Budget whereCreatedAt($value)
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereCreatedAt($value)
|
||||||
* @method static \Illuminate\Database\Query\Builder|\Budget whereUpdatedAt($value)
|
* @method static \Illuminate\Database\Query\Builder|\Budget whereUpdatedAt($value)
|
||||||
@@ -24,6 +24,11 @@ class Budget extends Component
|
|||||||
{
|
{
|
||||||
protected $isSubclass = true;
|
protected $isSubclass = true;
|
||||||
|
|
||||||
|
public function limitrepetitions()
|
||||||
|
{
|
||||||
|
return $this->hasManyThrough('LimitRepetition', 'Limit');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
|
@@ -58,7 +58,6 @@ class Component extends SingleTableInheritanceEntity
|
|||||||
return $this->belongsToMany('TransactionJournal', 'component_transaction_journal', 'component_id');
|
return $this->belongsToMany('TransactionJournal', 'component_transaction_journal', 'component_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
*/
|
*/
|
||||||
|
@@ -80,6 +80,7 @@ class LimitRepetition extends Ardent
|
|||||||
return $this->belongsTo('Limit');
|
return $this->belongsTo('Limit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO remove this method in favour of something in the FireflyIII libraries.
|
* 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
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function transactionjournals()
|
public function transactionJournals()
|
||||||
{
|
{
|
||||||
return $this->hasMany('TransactionJournal');
|
return $this->hasMany('TransactionJournal');
|
||||||
}
|
}
|
||||||
|
@@ -40,9 +40,13 @@ class User extends Ardent implements UserInterface, RemindableInterface
|
|||||||
|
|
||||||
|
|
||||||
public static $rules
|
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',
|
||||||
protected $fillable = ['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.
|
* 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');
|
return $this->hasManyThrough('Piggybank', 'Account');
|
||||||
}
|
}
|
||||||
|
public function transactions()
|
||||||
|
{
|
||||||
|
return $this->hasManyThrough('TransactionJournal', 'Transaction');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
Reference in New Issue
Block a user