Automator_Get_Data::mayabe_get_real_trigger_log_id( $trigger_id,  $run_number,  $recipe_id,  $user_id,  $recipe_log_id )


Parameters Parameters

$trigger_id

(Required)

$run_number

(Required)

$recipe_id

(Required)

$meta_key

(Required)

$user_id

(Required)

$recipe_log_id

(Required)


Top ↑

Return Return

(string|null)


Source Source

File: src/core/lib/utilities/class-automator-get-data.php

	public function mayabe_get_real_trigger_log_id( $trigger_id, $run_number, $recipe_id, $user_id, $recipe_log_id ) {
		global $wpdb;
		$tm_table = $wpdb->prefix . Automator()->db->tables->trigger_meta;
		$t_table  = $wpdb->prefix . Automator()->db->tables->trigger;

		return $wpdb->get_var(
			$wpdb->prepare(
				"SELECT tm.automator_trigger_log_id
FROM $tm_table tm
LEFT JOIN $t_table t
ON tm.automator_trigger_log_id = t.ID
WHERE t.automator_trigger_id = %d
  AND t.automator_recipe_log_id = %d
  AND t.automator_recipe_id = %d
  AND t.user_id = %d
  AND tm.run_number = %d",
				$trigger_id,
				$recipe_log_id,
				$recipe_id,
				$user_id,
				$run_number
			)
		);
	}