private function getUsersByCriteria(Criteria $criteria)
    {
        $repository = $this->om->getRepository($this->modelName);

        if ($repository instanceof Selectable) {
            $filteredUsers = $repository->matching($criteria);
        } else {
            $allUsers = new ArrayCollection($repository->findAll());
            $filteredUsers = $allUsers->matching($criteria);
        }

        return $filteredUsers->toArray();
    }