src/Kunstmaan/NodeBundle/Repository/NodeVersionLockRepository.php
public function getLocksForNodeTranslation(NodeTranslation $nodeTranslation, $isPublicVersion, $threshold, BaseUser $userToExclude = null)
    {
        $qb = $this->createQueryBuilder('nvl')
            ->select('nvl')
            ->where('nvl.nodeTranslation = :nt')
            ->andWhere('nvl.publicVersion = :pub')
            ->andWhere('nvl.createdAt > :date')
            ->setParameter('nt', $nodeTranslation)
            ->setParameter('pub', $isPublicVersion)
            ->setParameter('date', new \DateTime(sprintf('-%s seconds', $threshold)))
        ;

        if (!is_null($userToExclude)) {
            $qb->andWhere('nvl.owner <> :owner')
                ->setParameter('owner', $userToExclude->getUsername())
            ;
        }

        return $qb->getQuery()->getResult();
    }
public function getLocksForNodeTranslation(NodeTranslation $nodeTranslation, $isPublicVersion, $threshold, BaseUser $userToExclude = null)
    {
        $qb = $this->createQueryBuilder('nvl')
            ->select('nvl')
            ->where('nvl.nodeTranslation = :nt')
            ->andWhere('nvl.publicVersion = :pub')
            ->andWhere('nvl.createdAt > :date')
            ->setParameter('nt', $nodeTranslation)
            ->setParameter('pub', $isPublicVersion)
            ->setParameter('date', new \DateTime(sprintf('-%s seconds', $threshold)))
        ;

        if (!is_null($userToExclude)) {
            $qb->andWhere('nvl.owner <> :owner')
                ->setParameter('owner', $userToExclude->getUsername())
            ;
        }

        return $qb->getQuery()->getResult();
    }
public function getLocksForNodeTranslation ( NodeTranslation $ nodeTranslation , $ isPublicVersion , $ threshold , BaseUser $ userToExclude = null ) { $ qb = $ this -> createQueryBuilder ( 'nvl' ) -> select ( 'nvl' ) -> where ( 'nvl.nodeTranslation = :nt' ) -> andWhere ( 'nvl.publicVersion = :pub' ) -> andWhere ( 'nvl.createdAt > :date' ) -> setParameter ( 'nt' , $ nodeTranslation ) -> setParameter ( 'pub' , $ isPublicVersion ) -> setParameter ( 'date' , new \ DateTime ( sprintf ( '-%s seconds' , $ threshold ) ) ) ; if ( ! is_null ( $ userToExclude ) ) { $ qb -> andWhere ( 'nvl.owner <> :owner' ) -> setParameter ( 'owner' , $ userToExclude -> getUsername ( ) ) ; } return $ qb -> getQuery ( ) -> getResult ( ) ; }
Check if there is a nodetranslation lock that's not passed the 30 minute threshold.

@param NodeTranslation $nodeTranslation
@param bool            $isPublicVersion
@param int             $threshold
@param BaseUser        $userToExclude

@return NodeVersionLock[]
Check if there is a nodetranslation lock that s not passed the 30 minute threshold .