summaryrefslogtreecommitdiffstats
path: root/includes/concert.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-06 14:24:18 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-06 14:24:18 +0200
commitd35fe29a0ef9fadfe8141b6428b510860f35c3d0 (patch)
tree756e5c5aef7ee04980056473cf02da972b70b391 /includes/concert.php
parent658e452b19b2061d00112b3f608f5fae33724eca (diff)
downloadgigologadmin-d35fe29a0ef9fadfe8141b6428b510860f35c3d0.tar.gz
gigologadmin-d35fe29a0ef9fadfe8141b6428b510860f35c3d0.tar.bz2
gigologadmin-d35fe29a0ef9fadfe8141b6428b510860f35c3d0.zip
Use wpdb::get_row in Concert::get()
Makes it clearer that we're just fetching _one_ row from the database. Also updated doc comment to hopefully be a bit clearer.
Diffstat (limited to 'includes/concert.php')
-rw-r--r--includes/concert.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/concert.php b/includes/concert.php
index 04305ce..ed22117 100644
--- a/includes/concert.php
+++ b/includes/concert.php
@@ -74,7 +74,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
}
/**
- * Get concert with given id.
+ * Return the concert with the given id.
*
* @param int $id.
* @return null|self.
@@ -86,14 +86,14 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
$query = self::BASE_QUERY
. 'WHERE ' . $wpdb->prepare('wpg_concerts.id = %d', $id);
- $results = $wpdb->get_results($query);
+ $res= $wpdb->get_row($query);
- if ( !$results ) {
+ if ( !$res) {
$wpdb->print_error( __METHOD__ );
return null;
}
- return new GiglogAdmin_Concert($results[0]);
+ return new GiglogAdmin_Concert($res);
}
public static function create(string $name, $venue, string $date, string $ticketlink, string $eventlink): ?self