LLMS_Order::get_last_transaction( array|string $status = 'any', array|string $type = 'any' )

Retrieve the last (most recent) transaction processed for the order


Parameters Parameters

$status

(array|string) (Optional) Filter by status (see transaction statuses). By default looks for any status.

Default value: 'any'

$type

(array|string) (Optional) Filter by type [recurring|single|trial]. By default looks for any type.

Default value: 'any'


Top ↑

Return Return

(LLMS_Transaction|false) instance of the LLMS_Transaction or false if none found


Top ↑

Source Source

File: includes/models/model.llms.order.php

854
855
856
857
858
859
860
861
862
863
864
865
866
*/
public function get_last_transaction( $status = 'any', $type = 'any' ) {
    $txns = $this->get_transactions(
        array(
            'per_page'      => 1,
            'status'        => $status,
            'type'          => $type,
            'no_found_rows' => true,
        )
    );
    if ( $txns['count'] ) {
        return array_pop( $txns['transactions'] );
    }


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.