ActionScheduler_DBStore::mark_failure
Mark an action as failed.
Method of the class: ActionScheduler_DBStore{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ActionScheduler_DBStore = new ActionScheduler_DBStore(); $ActionScheduler_DBStore->mark_failure( $action_id );
- $action_id(int) (required)
- Action ID.
ActionScheduler_DBStore::mark_failure() ActionScheduler DBStore::mark failure code WC 10.8.1
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 ) );
}
}