ActionScheduler_DBStore::mark_failurepublicWC 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 9.9.4

public function mark_failure( $action_id ) {
	/**
	 * Global.

	 * @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 ) ) {
		/* translators: %s is the action ID */
		throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s: we were unable to mark this action as having failed. It may may have been deleted by another process.', 'woocommerce' ), $action_id ) );
	}
}