ActionScheduler_DBStore::mark_complete() public WC 1.0
Mark an action as complete.
{} It's a method of the class: ActionScheduler_DBStore{}
No Hooks.
Return
null.
Usage
$ActionScheduler_DBStore = new ActionScheduler_DBStore(); $ActionScheduler_DBStore->mark_complete( $action_id );
- $action_id(int) (required)
- Action ID.
Code of ActionScheduler_DBStore::mark_complete() ActionScheduler DBStore::mark complete WC 5.0.0
public function mark_complete( $action_id ) {
/** @var \wpdb $wpdb */
global $wpdb;
$updated = $wpdb->update(
$wpdb->actionscheduler_actions,
[
'status' => self::STATUS_COMPLETE,
'last_attempt_gmt' => current_time( 'mysql', true ),
'last_attempt_local' => current_time( 'mysql' ),
],
[ 'action_id' => $action_id ],
[ '%s' ],
[ '%d' ]
);
if ( empty( $updated ) ) {
throw new \InvalidArgumentException( sprintf( __( 'Unidentified action %s', 'woocommerce' ), $action_id ) );
}
}