Automator_DB_Handler_Triggers::get_sentence( int $user_id, int $trigger_log_id, int $run_number, string $meta_key )


Parameters Parameters

$user_id

(int) (Required)

$trigger_log_id

(int) (Required)

$run_number

(int) (Required)

$meta_key

(string) (Required)


Top ↑

Return Return

(string|null)


Source Source

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

	public function get_sentence( int $user_id, int $trigger_log_id, int $run_number, string $meta_key ) {
		global $wpdb;
		$tbl = Automator()->db->tables->trigger_meta;

		return $wpdb->get_var(
			$wpdb->prepare(
			//phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				"SELECT meta_value FROM {$wpdb->prefix}{$tbl}
						WHERE 1=1
						AND user_id = %d
						AND automator_trigger_log_id = %d
						AND run_number = %d
						AND meta_key LIKE %s",
				$user_id,
				$trigger_log_id,
				$run_number,
				$meta_key
			)
		);
	}