Added some basic methods to the models to get roperties from related models or
the related models themselfes.
This commit is contained in:
+19
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user