Automator_Get_Data::maybe_get_meta_id_from_trigger_log( null $run_number = null, null $trigger_id = null, null $trigger_log_id = null, null $meta_key = null, null $user_id = null )


Parameters Parameters

$run_number

(null) (Optional)

Default value: null

$trigger_id

(null) (Optional)

Default value: null

$trigger_log_id

(null) (Optional)

Default value: null

$meta_key

(null) (Optional)

Default value: null

$user_id

(null) (Optional)

Default value: null


Top ↑

Return Return

(string|null)


Source Source

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

	public function maybe_get_meta_id_from_trigger_log( $run_number = null, $trigger_id = null, $trigger_log_id = null, $meta_key = null, $user_id = null ) {
		if ( is_null( $run_number ) || is_null( $trigger_id ) || is_null( $trigger_log_id ) || is_null( $meta_key ) || is_null( $user_id ) ) {
			return null;
		}

		global $wpdb;

		return $wpdb->get_var(
			$wpdb->prepare(
				"SELECT ID FROM {$wpdb->prefix}uap_trigger_log_meta
									WHERE user_id = %d
									AND automator_trigger_log_id = %d
									AND automator_trigger_id = %d
									AND meta_key = %s
									AND run_number = %d
									LIMIT 0,1",
				$user_id,
				$trigger_log_id,
				$trigger_id,
				$meta_key,
				$run_number
			)
		);
	}