Skip to content
Permalink
Browse files

Applying query options before triggering beforeFind

  • Loading branch information...
lorenzo committed Aug 11, 2013
1 parent e0cad2a commit d30757f40a4d0e875f77ea9862eb50fb6bdfde6f
Showing with 1 addition and 2 deletions.
  1. +1 −2 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);
}

0 comments on commit d30757f

Please sign in to comment.
You can’t perform that action at this time.