src/Sulu/Bundle/ContactBundle/Command/AccountRecoverCommand.php
private function findInitialWrongDepthGap()
    {
        // get nodes where difference to parents depth > 1
        $qb = $this->accountRepository->createQueryBuilder('c2')
            ->select('count(c2.id) as results')
            ->join('c2.parent', 'c1')
            ->where('(c2.depth - 1) <> c1.depth');
        $depthGapResult = $qb->getQuery()->getSingleScalarResult();

        return $depthGapResult;
    }
private function findInitialWrongDepthGap()
    {
        // get nodes where difference to parents depth > 1
        $qb = $this->accountRepository->createQueryBuilder('c2')
            ->select('count(c2.id) as results')
            ->join('c2.parent', 'c1')
            ->where('(c2.depth - 1) <> c1.depth');
        $depthGapResult = $qb->getQuery()->getSingleScalarResult();

        return $depthGapResult;
    }
private function findInitialWrongDepthGap ( ) { // get nodes where difference to parents depth > 1 $ qb = $ this -> accountRepository -> createQueryBuilder ( 'c2' ) -> select ( 'count(c2.id) as results' ) -> join ( 'c2.parent' , 'c1' ) -> where ( '(c2.depth - 1) <> c1.depth' ) ; $ depthGapResult = $ qb -> getQuery ( ) -> getSingleScalarResult ( ) ; return $ depthGapResult ; }
Find number of nodes where difference to parents depth > 1.

@return int Number of affected rows
Find number of nodes where difference to parents depth > 1 .