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;
    }
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;
    }
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 ; }
Build query to get one changelog entry from the database.

@param string $contentType
@param int    $contentId
@param int    $id
@param string $cmpOp

@return QueryBuilder
Build query to get one changelog entry from the database .