Skip to content

Commit

Permalink
# Changed is_callable check to method_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
bpanatta committed Jul 30, 2018
1 parent d8914c4 commit 50fe1d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RelationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function loadToRelation($isHasMany, $relName, $v)
$relObj = new $relModelClass;
}
// If object has a relationIndexingAttribute, set the key in the attribute
if (is_callable([$relObj, 'relationIndexingAttribute']))
if (method_exists($relObj, 'relationIndexingAttribute'))
$relPost[$relObj->relationIndexingAttribute()] = $relKey;
$relObj->load($relPost, '');
$container[$relKey] = $relObj;
Expand All @@ -140,7 +140,7 @@ private function loadToRelation($isHasMany, $relName, $v)
$relObj = new $relModelClass();
}
// If object has a relationIndexingAttribute, set the key in the attribute
if (is_callable([$relObj, 'relationIndexingAttribute']))
if (method_exists($relObj, 'relationIndexingAttribute'))
$relPost[$relObj->relationIndexingAttribute()] = $relKey;
$relObj->load($relPost, '');
$container[$relKey] = $relObj;
Expand Down

0 comments on commit 50fe1d5

Please sign in to comment.