Skip to content

Commit

Permalink
Get the current set assigned to the entities
Browse files Browse the repository at this point in the history
  • Loading branch information
sunel committed Sep 9, 2018
1 parent 63b565b commit 5cbd0a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ public function __construct(array $attributes = [])

parent::__construct($attributes);
}

/**
* Get the current attribute set using one-to-one relationship for attribute.
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function currentAttributeSet()
{
return $this->hasOne(AttributeSet::class, 'attribute_set_id');
}

/**
* Get the Entity related to the model.
Expand Down

0 comments on commit 5cbd0a1

Please sign in to comment.