Bolt\Controller\Backend\Log::changeRecordListing PHP Method

changeRecordListing() public method

Show a list of changelog entries.
public changeRecordListing ( Request $request, string $contenttype, integer $contentid ) : TemplateResponse
$request Symfony\Component\HttpFoundation\Request
$contenttype string ContentType slug
$contentid integer Content record ID
return Bolt\Response\TemplateResponse
    public function changeRecordListing(Request $request, $contenttype, $contentid)
    {
        // We have to handle three cases here:
        // - $contenttype and $contentid given: get changelog entries for *one* content item
        // - only $contenttype given: get changelog entries for all items of that type
        // - neither given: get all changelog entries
        $page = $request->get('page');
        $pagination = $this->getPagination($page);
        $queryOptions = $this->getQueryOptions($pagination);
        if (empty($contenttype)) {
            // Case 1: No content type given, show from *all* items. This is easy:
            $data = ['title' => Trans::__('logs.change-log.contenttypes.all'), 'entries' => $this->changeLogRepository()->getChangeLog($queryOptions), 'count' => $this->changeLogRepository()->countChangeLog()];
        } else {
            $contenttype = $this->getContentType($contenttype);
            $data = $this->manager()->getListingData($contenttype, $contentid, $queryOptions);
        }
        $context = ['contenttype' => $contenttype, 'entries' => $data['entries'], 'content' => $data['content'], 'title' => $data['title'], 'currentpage' => $pagination['page'], 'pagecount' => $pagination['limit'] ? ceil($data['count'] / $pagination['limit']) : null];
        return $this->render('@bolt/changelog/changelog_record_all.twig', $context);
    }