src/Kunstmaan/NodeBundle/Repository/NodeTranslationRepository.php
public function getMaxChildrenWeight(Node $parentNode = null, $lang = null)
    {
        $maxWeight = $this->getNodeTranslationsQueryBuilder($lang)
            ->select('max(nt.weight)')
            ->andWhere('n.parent = :parentNode')
            ->setParameter('parentNode', $parentNode)
            ->getQuery()
            ->getSingleScalarResult();

        return (int) $maxWeight;
    }
public function getMaxChildrenWeight(Node $parentNode = null, $lang = null)
    {
        $maxWeight = $this->getNodeTranslationsQueryBuilder($lang)
            ->select('max(nt.weight)')
            ->andWhere('n.parent = :parentNode')
            ->setParameter('parentNode', $parentNode)
            ->getQuery()
            ->getSingleScalarResult();

        return (int) $maxWeight;
    }
public function getMaxChildrenWeight ( Node $ parentNode = null , $ lang = null ) { $ maxWeight = $ this -> getNodeTranslationsQueryBuilder ( $ lang ) -> select ( 'max(nt.weight)' ) -> andWhere ( 'n.parent = :parentNode' ) -> setParameter ( 'parentNode' , $ parentNode ) -> getQuery ( ) -> getSingleScalarResult ( ) ; return ( int ) $ maxWeight ; }
Get max children weight

@param Node   $parentNode
@param string $lang       (optional) Only return max weight for the
given language

@return int
Get max children weight