src/Sulu/Bundle/ContactBundle/Command/AccountRecoverCommand.php
private function fixNodesWithoutParents()
    {
        // fix nodes that have no parent but depth > 0
        $qb = $this->accountRepository->createQueryBuilder('c2')
            ->update()
            ->set('c2.depth', 0)
            ->where('c2.parent IS NULL AND depth != 0');

        $qb->getQuery()->execute();
    }
private function fixNodesWithoutParents()
    {
        // fix nodes that have no parent but depth > 0
        $qb = $this->accountRepository->createQueryBuilder('c2')
            ->update()
            ->set('c2.depth', 0)
            ->where('c2.parent IS NULL AND depth != 0');

        $qb->getQuery()->execute();
    }
private function fixNodesWithoutParents ( ) { // fix nodes that have no parent but depth > 0 $ qb = $ this -> accountRepository -> createQueryBuilder ( 'c2' ) -> update ( ) -> set ( 'c2.depth' , 0 ) -> where ( 'c2.parent IS NULL AND depth != 0' ) ; $ qb -> getQuery ( ) -> execute ( ) ; }
Set every node where depth > 0 and has no parents to depth 0.
Set every node where depth > 0 and has no parents to depth 0 .