Automattic\WooCommerce\Admin\API

MobileAppQRLogin::get_token_record_ttlprivateWC 1.0

Get the remaining storage TTL for a token record.

Method of the class: MobileAppQRLogin{}

No Hooks.

Returns

Int. Remaining TTL in seconds.

Usage

// private - for code of main (parent) class only
$result = $this->get_token_record_ttl( $token_data );
$token_data(array) (required)
.

MobileAppQRLogin::get_token_record_ttl() code WC 11.0.1

private function get_token_record_ttl( array $token_data ) {
	return max(
		1,
		isset( $token_data['expires_at'] ) ? (int) $token_data['expires_at'] - time() : self::TOKEN_TTL
	);
}