public function loadState(array $params) { if (isset($params['dirId'])) { $this->dir = $this->dirRepository->find($params['dirId']); } elseif ($this->root) { $this->dir = $this->root; } if (isset($params['fileId'])) { $this->file = $this->fileRepository->find($params['fileId']); $this->dir = $this->file->getParent(); } parent::loadState($params); }