From 0b76892ddfbcedf2436e8f59db59754585c577dc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 27 Jun 2021 23:08:09 -0400 Subject: [PATCH] Merge pull request #3307 from pliablepixels/optimize-event-api API: allow option to not load the frames DB table --- web/api/app/Controller/EventsController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/api/app/Controller/EventsController.php b/web/api/app/Controller/EventsController.php index d18409387..c2daece16 100644 --- a/web/api/app/Controller/EventsController.php +++ b/web/api/app/Controller/EventsController.php @@ -143,6 +143,10 @@ class EventsController extends AppController { $mon_options = ''; } + $noFrames = $this->request->query('noframes'); + if ($noFrames=='true') + $this->Event->unbindModel(array('hasMany' => array('Frame'))); + $options = array('conditions' => array(array('Event.' . $this->Event->primaryKey => $id), $mon_options)); $event = $this->Event->find('first', $options);