/** * Initialize the pagination, search and order of the table * @param zibo\library\html\table\ExtendedTable $table * @param int $page The current page * @param int $rowsPerPage Number or rows to display on each page * @param string $orderMethod Name of the order method to use * @param string $orderDirection Name of the order direction * @param string $searchQuery Value for the search query * @return null */ protected function initializeTable(ExtendedTable $table, $page, $rowsPerPage, $orderMethod, $orderDirection, $searchQuery) { parent::initializeTable($table, $page, $rowsPerPage, $orderMethod, $orderDirection, $searchQuery); $session = $this->getSession(); $include = $session->get(self::SESSION_FILTER_INCLUDE); $dataModel = $session->get(self::SESSION_FILTER_DATA_MODEL); $dataId = $session->get(self::SESSION_FILTER_DATA_ID); $dataField = $session->get(self::SESSION_FILTER_DATA_FIELD); $this->filterForm = new LogFilterForm($this->request->getBasePath(), $include, $dataModel, $dataId, $dataField); $query = $table->getModelQuery(); if ($include) { $conditions = array(); foreach ($include as $key => $action) { $conditions[] = '{action} = %' . $key . '%'; } $query->addConditionWithVariables(implode(' OR ', $conditions), $include); } if ($dataModel) { $query->addCondition('{dataModel} = %1%', $dataModel); } if ($dataId) { $query->addCondition('{dataId} = %1%', $dataId); } if ($dataField) { $query->addCondition('{changes.fieldName} = %1%', $dataField); } }