From d30757f40a4d0e875f77ea9862eb50fb6bdfde6f Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sun, 11 Aug 2013 17:09:06 +0200 Subject: [PATCH] Applying query options before triggering beforeFind --- lib/Cake/ORM/Table.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Cake/ORM/Table.php b/lib/Cake/ORM/Table.php index edfc5429090..616fdeba9ba 100644 --- a/lib/Cake/ORM/Table.php +++ b/lib/Cake/ORM/Table.php @@ -502,14 +502,13 @@ public function belongsToMany($associated, array $options = []) { */ public function find($type, $options = []) { $query = $this->_buildQuery(); - $query->select(); + $query->select()->applyOptions($options); $event = new Event('Model.beforeFind', $this, [$query, $options]); $this->_eventManager->dispatch($event); if ($event->isStopped()) { return $query; } - $query->applyOptions($options); return $this->{'find' . ucfirst($type)}($query, $options); }