ActionScheduler_DBStore::create_group │ protected │ WC 1.0

Create an action group.

Method of the class: ActionScheduler_DBStore{}

No Hooks.

Returns

int. Group ID.

Usage

// protected - for code of main (parent) or child class
$result = $this->create_group( $slug );
$slug(string) (required)
Group slug.

ActionScheduler_DBStore::create_group() code WC 11.2.1

protected function create_group( $slug ) {
	/**
	 * Global.
	 *
	 * @var \wpdb $wpdb
	 */
	global $wpdb;

	$wpdb->insert( $wpdb->actionscheduler_groups, array( 'slug' => $slug ) );

	$group_id = (int) $wpdb->insert_id;
	if ( $group_id ) {
		wp_cache_set( $this->get_group_cache_key( $slug ), $group_id, self::GROUP_IDS_CACHE_GROUP, 10 * MINUTE_IN_SECONDS );
	}

	return $group_id;
}