Automator_Get_Data::mayabe_get_token_meta_value_from_trigger_log( $trigger_id,  $run_number,  $recipe_id,  $meta_key,  $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_token_meta_value_from_trigger_log( $trigger_id, $run_number, $recipe_id, $meta_key, $user_id, $recipe_log_id ) {
		global $wpdb;
		$tm_table = $wpdb->prefix . Automator()->db->tables->trigger_meta;
		$t_table  = $wpdb->prefix . Automator()->db->tables->trigger;
		$qry      = $wpdb->prepare(
			"SELECT tm.meta_value
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
  AND tm.meta_key = %s",
			$trigger_id,
			$recipe_log_id,
			$recipe_id,
			$user_id,
			$run_number,
			$meta_key
		);

		return $wpdb->get_var( $qry );
	}