Skip to content

Commit

Permalink
Fixing bug where beforeFind was being triggered for delete queries
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Nov 9, 2014
1 parent 3fa354c commit 2a9dd22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ORM/Query.php
Expand Up @@ -609,7 +609,7 @@ public function all() {
public function sql(ValueBinder $binder = null) {
$this->_transformQuery();

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

0 comments on commit 2a9dd22

Please sign in to comment.