public function getAllResultsAsArray(): array
    {
        $result = array();

        $entities = $this->getAllResults();

        // Convert search results to array
        foreach ($entities as $entity) {
            if (is_object($entity) && method_exists($entity, 'getValues')) {
                $result[] = $entity->getValues();
            } else {
                $result[] = (array)$entity;
            }
        }

        return $result;
    }