limit($limit); if ($offset) { $changeHistoriesQuery->offset($offset); } if ($currentUser->isAbiturient()) { $changeHistoriesQuery->andWhere([ 'not', ['change_history.change_type' => ChangeHistory::CHANGE_HISTORY_ABITURIENT_JUXTAPOSITION] ]); } return $changeHistoriesQuery->all(); } public function getChangeHistoryByApplicationWithFiltersFromPost( User $currentUser, BachelorApplication $application ): array { $limit = $this->request->post('infiniteScrollLimit'); $offset = $this->request->post('infiniteScrollOffset'); $dateEnd = empty($this->request->post('dateEnd')) ? null : $this->request->post('dateEnd'); $dateStart = empty($this->request->post('dateStart')) ? null : $this->request->post('dateStart'); $sortDirection = (int) $this->request->post('sortDirection'); return $this->getChangeHistoryByApplicationWithFilters( $currentUser, $application, $sortDirection, $dateStart, $dateEnd, $limit, $offset ); } }