ActionScheduler_DBStore::mark_failure()publicWC 1.0

Mark an action as failed.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$ActionScheduler_DBStore = new ActionScheduler_DBStore();
$ActionScheduler_DBStore->mark_failure( $action_id );
$action_id(int) (обязательный)
Action ID.

Код ActionScheduler_DBStore::mark_failure() WC 8.7.0

public function mark_failure( $action_id ) {
	/** @var \wpdb $wpdb */
	global $wpdb;
	$updated = $wpdb->update(
		$wpdb->actionscheduler_actions,
		array( 'status' => self::STATUS_FAILED ),
		array( 'action_id' => $action_id ),
		array( '%s' ),
		array( '%d' )
	);
	if ( empty( $updated ) ) {
		throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) ); //phpcs:ignore WordPress.WP.I18n.MissingTranslatorsComment
	}
}