public function findAllArray($indexBy = null): array
    {
        $this->checkRepository();

        $data = $this->createQueryBuilder('object', $indexBy)->getQuery()->getArrayResult();

        if ($data && $indexBy) {
            $data = $this->sortCollection($data, $indexBy);
        }

        return $data;
    }