You are here

protected function OverviewController::getRowData in MongoDB 8.2

Obtain the data from the logger.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request. Needed for paging.

Return value

\Drupal\mongodb_watchdog\EventTemplate The data array.

Throws

\ReflectionException

1 call to OverviewController::getRowData()
OverviewController::build in modules/mongodb_watchdog/src/Controller/OverviewController.php
Controller.

File

modules/mongodb_watchdog/src/Controller/OverviewController.php, line 333

Class

OverviewController
The controller for the logger overview page.

Namespace

Drupal\mongodb_watchdog\Controller

Code

protected function getRowData(Request $request) : array {
  $count = $this->watchdog
    ->templatesCount();
  $page = $this
    ->setupPager($request, $count);
  $skip = $page * $this->itemsPerPage;
  $limit = $this->itemsPerPage;
  $filters = $_SESSION[OverviewFilterForm::SESSION_KEY] ?? NULL;
  $rows = $this->watchdog
    ->templates($filters['type'] ?? [], $filters['severity'] ?? [], $skip, $limit)
    ->toArray();
  return $rows;
}