public function findWithStatus()
    {
        $scales = $this->createQueryBuilder('s')
            ->select('s.id', 's.name', 'COUNT(c) AS competencies')
            ->leftJoin('s.competencies', 'c')
            ->groupBy('s')
            ->getQuery()
            ->getArrayResult();

        $abilityCounts = $this->createQueryBuilder('s')
            ->select('s.id', 'COUNT (ca) AS abilities')
            ->leftJoin('s.levels', 'l')
            ->leftJoin('l.competencyAbilities', 'ca')
            ->groupBy('s')
            ->getQuery()
            ->getArrayResult();

        return array_map(function ($element) use ($abilityCounts) {
            foreach ($abilityCounts as $counts) {
                if ($counts['id'] === $element['id']) {
                    $element['abilities'] = $counts['abilities'];

                    return $element;
                }
            }
        }, $scales);
    }
public function findWithStatus()
    {
        $scales = $this->createQueryBuilder('s')
            ->select('s.id', 's.name', 'COUNT(c) AS competencies')
            ->leftJoin('s.competencies', 'c')
            ->groupBy('s')
            ->getQuery()
            ->getArrayResult();

        $abilityCounts = $this->createQueryBuilder('s')
            ->select('s.id', 'COUNT (ca) AS abilities')
            ->leftJoin('s.levels', 'l')
            ->leftJoin('l.competencyAbilities', 'ca')
            ->groupBy('s')
            ->getQuery()
            ->getArrayResult();

        return array_map(function ($element) use ($abilityCounts) {
            foreach ($abilityCounts as $counts) {
                if ($counts['id'] === $element['id']) {
                    $element['abilities'] = $counts['abilities'];

                    return $element;
                }
            }
        }, $scales);
    }
public function findWithStatus ( ) { $ scales = $ this -> createQueryBuilder ( 's' ) -> select ( 's.id' , 's.name' , 'COUNT(c) AS competencies' ) -> leftJoin ( 's.competencies' , 'c' ) -> groupBy ( 's' ) -> getQuery ( ) -> getArrayResult ( ) ; $ abilityCounts = $ this -> createQueryBuilder ( 's' ) -> select ( 's.id' , 'COUNT (ca) AS abilities' ) -> leftJoin ( 's.levels' , 'l' ) -> leftJoin ( 'l.competencyAbilities' , 'ca' ) -> groupBy ( 's' ) -> getQuery ( ) -> getArrayResult ( ) ; return array_map ( function ( $ element ) use ( $ abilityCounts ) { foreach ( $ abilityCounts as $ counts ) { if ( $ counts [ 'id' ] === $ element [ 'id' ] ) { $ element [ 'abilities' ] = $ counts [ 'abilities' ] ; return $ element ; } } } , $ scales ) ; }
Returns an array representation of registered scales, including
information about linked frameworks and abilities.

@return array
Returns an array representation of registered scales including information about linked frameworks and abilities .