public function findPaginatedByOrFail(array $criteria, array $orderBy = null, int $itemsPerPage = 10): Paginator
    {
        $paginator = $this->findPaginatedBy($criteria, $orderBy, $itemsPerPage);

        if ($paginator->count() === 0) {
            throw new FindException('FindPaginatedBy did not return any results');
        }

        return $paginator;
    }
public function findPaginatedByOrFail(array $criteria, array $orderBy = null, int $itemsPerPage = 10): Paginator
    {
        $paginator = $this->findPaginatedBy($criteria, $orderBy, $itemsPerPage);

        if ($paginator->count() === 0) {
            throw new FindException('FindPaginatedBy did not return any results');
        }

        return $paginator;
    }
public function findPaginatedByOrFail ( array $ criteria , array $ orderBy = null , int $ itemsPerPage = 10 ) : Paginator { $ paginator = $ this -> findPaginatedBy ( $ criteria , $ orderBy , $ itemsPerPage ) ; if ( $ paginator -> count ( ) === 0 ) { throw new FindException ( 'FindPaginatedBy did not return any results' ) ; } return $ paginator ; }
Return paginated elements filtered by criteria or throw an exception if none found.

@param array      $criteria
@param array|null $orderBy
@param int        $itemsPerPage

@throws FindException

@return Paginator
Return paginated elements filtered by criteria or throw an exception if none found .