File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,22 @@ class TimedBehavior extends Behavior
3030 *
3131 * @param \Cake\Event\EventInterface $event The beforeFind event
3232 * @param \Cake\ORM\Query\SelectQuery $query SelectQuery
33- * @return \Cake\ORM\Query\SelectQuery
33+ * @return void
3434 */
35- public function beforeFind (EventInterface $ event , SelectQuery $ query ): SelectQuery
35+ public function beforeFind (EventInterface $ event , SelectQuery $ query ): void
3636 {
3737 /** @var \Cake\Datasource\RepositoryInterface $table */
3838 $ table = $ event ->getSubject ();
3939 $ alias = $ table ->getAlias ();
4040 DebugTimer::start ($ alias . '_find ' , $ alias . '->find() ' );
4141
42- return $ query ->formatResults (function ($ results ) use ($ alias ) {
42+ $ formattedQuery = $ query ->formatResults (function ($ results ) use ($ alias ) {
4343 DebugTimer::stop ($ alias . '_find ' );
4444
4545 return $ results ;
4646 });
47+
48+ $ event ->setResult ($ formattedQuery );
4749 }
4850
4951 /**
You can’t perform that action at this time.
0 commit comments