private function getContentTypeFilterCriteria(ParameterCollectionInterface $parameterCollection): ?Criterion
    {
        if ($parameterCollection->getParameter('filter_by_content_type')->getValue() !== true) {
            return null;
        }

        $contentTypes = $parameterCollection->getParameter('content_types')->getValue() ?? [];
        if (count($contentTypes) === 0) {
            return null;
        }

        $contentTypeFilter = new Criterion\ContentTypeId(
            $this->getContentTypeIds($contentTypes)
        );

        if ($parameterCollection->getParameter('content_types_filter')->getValue() === 'exclude') {
            $contentTypeFilter = new Criterion\LogicalNot($contentTypeFilter);
        }

        return $contentTypeFilter;
    }