/** * Check whether the autoEagerLoading feature has to be applied. * * @param string $fetch */ protected function applyAutoEagerLoading($fetch = 'unit') { if (!empty($this->eagerLoad)) { return; } if ($this->enableAutoEagerLoading && $fetch == 'unit') { $this->eagerLoad = $this->model->unitRelations(); } elseif ($this->enableAutoEagerLoading && $fetch == 'list') { $this->eagerLoad = $this->model->listRelations(); } }