summaryrefslogtreecommitdiffstats
path: root/lib/class
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class')
-rw-r--r--lib/class/artist.class.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 7116d979..552d9645 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -94,6 +94,24 @@ class Artist {
} // _get_info
/**
+ * get_from_name
+ * This gets an artist object based on the artist name
+ */
+ public static function get_from_name($name) {
+
+ $name = Dba::escape($name);
+ $sql = "SELECT `id` FROM `artist` WHERE `name`='$name'";
+ $db_results = Dba::query($sql);
+
+ $row = Dba::fetch_assoc($db_results);
+
+ $object = new Artist($row['id']);
+
+ return $object;
+
+ } // get_from_name
+
+ /**
* get_albums
* gets the album ids that this artist is a part
* of