def create_limit_arg(self, stuf_entiteit, parameters_obj):
        """
        Based on the 'maximumAantal' variable in the parameters element return the number of objects to be returned

        Returns 0 if 'maximumAantal' is missing, and raises an error if a non-positive integer is used is provided.
        """
        if not parameters_obj or not getattr(parameters_obj, 'maximumAantal', None):
            return 0
        para_model = self.get_input_parameters_model()()
        if not getattr(para_model, 'maximumAantal', None):
            return 0
        limit = settings.ZAAKMAGAZIJN_DEFAULT_MAX_NR_RESULTS
        try:
            limit = int(parameters_obj.maximumAantal)
        except ValueError:
            raise StUFFault(ClientFoutChoices.stuf055)
        if limit < 0:
            raise EmptyResultError()
        return limit
    def create_order_args(self, stuf_entiteit, parameters_obj):
        """
        Based on the 'sortering' variable in the parameters element return a list of model fields for ordering.

        Returns an empty list if 'sortering' is missing, and raises an error if an invalid sortering variable
        is provided.
        """
        if not parameters_obj or not getattr(parameters_obj, 'sortering', None):
            return []
        para_model = self.get_input_parameters_model()()
        if not getattr(para_model, 'ordering', None):
            return []
        order_args = []
        if parameters_obj.sortering not in para_model.ordering.keys():
            raise StUFFault(ServerFoutChoices.stuf133)
        # Map sorting number versus the Entity-specific type of ordering
        ordering_fields = para_model.ordering[parameters_obj.sortering]
        for field in ordering_fields:
            order_args += [field]
        return order_args