logs = $logs; $this->masker = $masker; } /** * Execute the §12.2 list-logs query. * * Calls {@see LogRepository::findPaginated()} with the supplied * query VO, projects every returned * {@see \Affilun\Infrastructure\Persistence\LogRecord} * through {@see LogMasker::maskRecord()}, and wraps the result * in a {@see ListLogsResult} carrying the pagination axes * echoed back from the query. * * @param LogListQuery $query Validated list-query inputs. */ public function execute( LogListQuery $query ): ListLogsResult { $page = $this->logs->findPaginated( $query ); $items = array(); foreach ( $page->items() as $record ) { $items[] = $this->masker->maskRecord( $record ); } return new ListLogsResult( $items, $page->total(), $page->page(), $page->perPage(), $page->pageCount() ); } }