Added some basic methods to the models to get roperties from related models or

the related models themselfes.
This commit is contained in:
Lukas Halbritter
2018-09-14 11:27:08 +02:00
parent 11775170d6
commit ac080eb485
5 changed files with 176 additions and 14 deletions
+19 -1
View File
@@ -6,5 +6,23 @@ use Illuminate\Database\Eloquent\Model;
class AccountType extends Model
{
//
/*
* Get the account class of the account type.
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function accountClass()
{
return $this->belongsTo('App\AccountClass');
}
/*
* Get the IO-type of the account type.
*
* @return Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function ioType()
{
return $this->accountClass->ioType();
}
}