src/services/Invoices.php
public function getSubscriptionInvoices(int $subscriptionId): array
    {
        $results = $this->_createInvoiceQuery()
            ->where(['subscriptionId' => $subscriptionId])
            ->orderBy(['dateCreated' => SORT_DESC])
            ->all();

        $invoices = [];

        foreach ($results as $result) {
            $result['invoiceData'] = Json::decodeIfJson($result['invoiceData']);
            $invoices[] = new Invoice($result);
        }

        return $invoices;
    }
public function getSubscriptionInvoices(int $subscriptionId): array
    {
        $results = $this->_createInvoiceQuery()
            ->where(['subscriptionId' => $subscriptionId])
            ->orderBy(['dateCreated' => SORT_DESC])
            ->all();

        $invoices = [];

        foreach ($results as $result) {
            $result['invoiceData'] = Json::decodeIfJson($result['invoiceData']);
            $invoices[] = new Invoice($result);
        }

        return $invoices;
    }
public function getSubscriptionInvoices ( int $ subscriptionId ) : array { $ results = $ this -> _createInvoiceQuery ( ) -> where ( [ 'subscriptionId' => $ subscriptionId ] ) -> orderBy ( [ 'dateCreated' => SORT_DESC ] ) -> all ( ) ; $ invoices = [ ] ; foreach ( $ results as $ result ) { $ result [ 'invoiceData' ] = Json :: decodeIfJson ( $ result [ 'invoiceData' ] ) ; $ invoices [ ] = new Invoice ( $ result ) ; } return $ invoices ; }
Returns a customer by gateway and user id.

@param int $subscriptionId The subscription id.
@return Invoice[]
Returns a customer by gateway and user id .