Merge pull request #3307 from pliablepixels/optimize-event-api

API: allow option to not load the frames DB table
This commit is contained in:
Isaac Connor 2021-06-27 23:08:09 -04:00 committed by GitHub
commit 415dce6548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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);