diff options
Diffstat (limited to 'includes/concertlogs.php')
-rw-r--r-- | includes/concertlogs.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/includes/concertlogs.php b/includes/concertlogs.php index 9546d21..583cc8d 100644 --- a/includes/concertlogs.php +++ b/includes/concertlogs.php @@ -37,5 +37,25 @@ if ( !class_exists( 'GiglogAdmin_Concertlogs' ) ) return $res ? $res[0]->wpgcl_status : null; } + + public static function get_assigned_user( int $concert_id, string $role ) : ?string + { + global $wpdb; + + if ( ! in_array( $role, [ 'photo1', 'photo2', 'rev1', 'rev2' ] ) ) { + error_log(__METHOD__ . ": invalid \$role ({$role}) given."); + return null; + } + + $column = "wpgcl_{$role}"; + $q = $wpdb->prepare( + "select {$column} from wpg_concertlogs where id = %d", + $concert_id); + + $res = $wpdb->get_row($q, ARRAY_A); + var_dump($res); + + return array_shift( $res ); + } } } |