Automattic\WooCommerce\Gateways\PayPal
TransactAccountManager::get_transact_account_from_cache
Get the transact account (merchant or provider) from the database cache.
Метод класса: TransactAccountManager{}
Хуков нет.
Возвращает
mixed. The transact account data, or null if the cache is empty or expired.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_transact_account_from_cache( $cache_key );
- $cache_key(строка) (обязательный)
- The cache key to get the account.
Список изменений
| С версии 10.5.0 | Введена. |
Код TransactAccountManager::get_transact_account_from_cache() TransactAccountManager::get transact account from cache WC 11.2.2
private function get_transact_account_from_cache( string $cache_key ) {
$transact_account = get_option( $cache_key, null );
if ( empty( $transact_account ) || ( isset( $transact_account['expiry'] ) && $transact_account['expiry'] < time() ) ) {
return null;
}
return $transact_account['account'] ?? null;
}