Skip to content

Commit

Permalink
Update _related property so Phalcon avoids to make a lazy loading
Browse files Browse the repository at this point in the history
When using relationships lazy loading along with magic "getPropertyName" methods the relationships are lazy loaded without having the eager load in consideration. This patch fix it.

References: stibiumz/phalcon.eager-loading#12
  • Loading branch information
Surt authored Apr 6, 2017
1 parent 3f39a27 commit 6e2abc1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Library/Phalcon/Mvc/Model/EagerLoading/EagerLoad.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public function load()
if (static::$isPhalcon2) {
$record->{$alias} = null;
$record->{$alias} = $referencedModels;
$record->_related[$alias] = $referenceModels;
}
} else {
$record->{$alias} = null;
Expand Down

0 comments on commit 6e2abc1

Please sign in to comment.