Automator_DB_Handler_Recipes::add( int $user_id, int $recipe_id, int $completed, int $run_number )

Inserts a new recipe run in to Recipe logs table.


Parameters Parameters

$user_id

(int) (Required)

$recipe_id

(int) (Required)

$completed

(int) (Required)

$run_number

(int) (Required)


Top ↑

Return Return

(int)


Source Source

File: src/core/lib/utilities/db/class-automator-db-handler-recipes.php

	public function add( int $user_id, int $recipe_id, int $completed, int $run_number ) {
		global $wpdb;

		$table_name = isset( Automator()->db->tables->recipe ) ? Automator()->db->tables->recipe : 'uap_recipe_log';
		$wpdb->insert(
			$wpdb->prefix . $table_name,
			array(
				'date_time'           => current_time( 'mysql' ),
				'user_id'             => $user_id,
				'automator_recipe_id' => $recipe_id,
				'completed'           => $completed,
				'run_number'          => $run_number,
			),
			array(
				'%s',
				'%d',
				'%d',
				'%d',
				'%d',
			)
		);

		return $wpdb->insert_id;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0 Introduced.