Adds the transactions for this loan to a 'transactions' field.

        Transactions are MambuTransaction objects.

        Transactions get sorted by transaction id.

        Returns the number of requests done to Mambu.

.. todo:: since pagination logic was added, is not always true that
          just 1 request was done. It may be more! But since request
          counter singleton holds true information about how many requests
          were done to Mambu, in fact this return value may be obsolete

def setTransactions(self, *args, **kwargs):
        """Adds the transactions for this loan to a 'transactions' field.

        Transactions are MambuTransaction objects.

        Transactions get sorted by transaction id.

        Returns the number of requests done to Mambu.

.. todo:: since pagination logic was added, is not always true that
          just 1 request was done. It may be more! But since request
          counter singleton holds true information about how many requests
          were done to Mambu, in fact this return value may be obsolete
        """
        def transactionid(transaction):
            """Util function used for sorting transactions according to id"""
            try:
                return transaction['transactionId']
            except KeyError as kerr:
                return None

        try:
            trans = self.mambutransactionsclass(entid=self['id'], *args, **kwargs)
        except AttributeError as ae:
            from .mambutransaction import MambuTransactions
            self.mambutransactionsclass = MambuTransactions
            trans = self.mambutransactionsclass(entid=self['id'], *args, **kwargs)

        trans.attrs = sorted(trans.attrs, key=transactionid)
        self['transactions'] = trans

        return 1