Yoast\WP\SEO\Expiring_Store\Application\Ports

Expiring_Store_Repository_Interface::insert_if_absentpublicYoast 1.0

Inserts a value only if the key does not already exist or has expired.

Метод класса: Expiring_Store_Repository_Interface{}

Хуков нет.

Возвращает

true|false. True if the value was inserted or an expired row was replaced, false if the key already exists and is not expired.

Использование

$Expiring_Store_Repository_Interface = new Expiring_Store_Repository_Interface();
$Expiring_Store_Repository_Interface->insert_if_absent( $key, $json_value, $expiration_datetime, $current_datetime ): bool;
$key(строка) (обязательный)
The key to store.
$json_value(строка) (обязательный)
The JSON-encoded value.
$expiration_datetime(строка) (обязательный)
The expiration datetime in 'Y-m-d H:i:s' format.
$current_datetime(строка) (обязательный)
The current datetime in 'Y-m-d H:i:s' format.

Код Expiring_Store_Repository_Interface::insert_if_absent() Yoast 27.7

public function insert_if_absent( string $key, string $json_value, string $expiration_datetime, string $current_datetime ): bool;