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);
    }