Skip to content

Commit

Permalink
Query transformation should happen after beforeFind is triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Nov 9, 2014
1 parent 2a9dd22 commit 33595f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ORM/Query.php
Expand Up @@ -607,15 +607,15 @@ public function all() {
* {@inheritDoc}
*/
public function sql(ValueBinder $binder = null) {
$this->_transformQuery();

if (!$this->_beforeFindFired && $this->_type === 'select') {
$table = $this->repository();
$table->dispatchEvent('Model.beforeFind', [$this, $this->_options, !$this->eagerLoaded()]);
$this->_beforeFindFired = true;
}

return parent::sql($binder);
$this->_transformQuery();
$sql = parent::sql($binder);
return $sql;
}

/**
Expand Down

0 comments on commit 33595f3

Please sign in to comment.