ActionScheduler_HybridStore::set_demarkation_idprivateWC 1.0

Store the demarkation id in WP options.

Method of the class: ActionScheduler_HybridStore{}

No Hooks.

Returns

Int. The new ID.

Usage

// private - for code of main (parent) class only
$result = $this->set_demarkation_id( $id );
$id(int)
The ID to set as the demarkation point between the two stores Leave null to use the next ID from the WP posts table.
Default: null

ActionScheduler_HybridStore::set_demarkation_id() code WC 10.3.3

private function set_demarkation_id( $id = null ) {
	if ( empty( $id ) ) {
		/**
		 * Global.
		 *
		 * @var \wpdb $wpdb
		 */
		global $wpdb;

		$id = (int) $wpdb->get_var( "SELECT MAX(ID) FROM $wpdb->posts" );
		$id++;
	}
	update_option( self::DEMARKATION_OPTION, $id );

	return $id;
}