public function getChangeLogEntryQuery($contentType, $contentId, $id, $cmpOp)
    {
        $alias = $this->getAlias();
        $contentTypeTableName = $this->em->getRepository($contentType)->getTableName();

        // Build base query
        $qb = $this->createQueryBuilder();
        $qb->select("$alias.*")
            ->leftJoin($alias, $contentTypeTableName, 'content', "content.id = $alias.contentid")
            ->where("$alias.id $cmpOp :logid")
            ->andWhere("$alias.contentid = :contentid")
            ->andWhere('contenttype = :contenttype')
            ->setParameters([
                ':logid'       => $id,
                ':contentid'   => $contentId,
                ':contenttype' => $contentType,
            ]);

        // Set ORDER BY
        if ($cmpOp === '<') {
            $qb->orderBy('date', 'DESC');
        } elseif ($cmpOp === '>') {
            $qb->orderBy('date');
        }

        return $qb;
    }