public function getLogEntriesQueryRoot($entity, $rootVersion = null)
    {
        $wrapped = new EntityWrapper($entity, $this->_em);
        $objectClass = $wrapped->getMetadata()->name;
        $meta = $this->getClassMetadata();
        $dql = "SELECT log FROM {$meta->name} log";
        $dql .= " WHERE log.objectId = :objectId";
        $dql .= " AND log.objectClass = :objectClass";
        $dql .= " AND log.rootVersion <= :rootVersion";
        $dql .= " ORDER BY log.version DESC";

        $objectId = $wrapped->getIdentifier();
        $q = $this->_em->createQuery($dql);
        $q->setParameters(compact('objectId', 'objectClass', 'rootVersion'));

        return $q;
    }
public function getLogEntriesQueryRoot($entity, $rootVersion = null)
    {
        $wrapped = new EntityWrapper($entity, $this->_em);
        $objectClass = $wrapped->getMetadata()->name;
        $meta = $this->getClassMetadata();
        $dql = "SELECT log FROM {$meta->name} log";
        $dql .= " WHERE log.objectId = :objectId";
        $dql .= " AND log.objectClass = :objectClass";
        $dql .= " AND log.rootVersion <= :rootVersion";
        $dql .= " ORDER BY log.version DESC";

        $objectId = $wrapped->getIdentifier();
        $q = $this->_em->createQuery($dql);
        $q->setParameters(compact('objectId', 'objectClass', 'rootVersion'));

        return $q;
    }
public function getLogEntriesQueryRoot ( $ entity , $ rootVersion = null ) { $ wrapped = new EntityWrapper ( $ entity , $ this -> _em ) ; $ objectClass = $ wrapped -> getMetadata ( ) -> name ; $ meta = $ this -> getClassMetadata ( ) ; $ dql = "SELECT log FROM {$meta->name} log" ; $ dql .= " WHERE log.objectId = :objectId" ; $ dql .= " AND log.objectClass = :objectClass" ; $ dql .= " AND log.rootVersion <= :rootVersion" ; $ dql .= " ORDER BY log.version DESC" ; $ objectId = $ wrapped -> getIdentifier ( ) ; $ q = $ this -> _em -> createQuery ( $ dql ) ; $ q -> setParameters ( compact ( 'objectId' , 'objectClass' , 'rootVersion' ) ) ; return $ q ; }
Get the query for loading of log entries

@param object  $entity
@param integer $rootVersion

@return Query
Get the query for loading of log entries