summaryrefslogtreecommitdiffstats
path: root/lib/class/artist.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-12 02:52:50 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-05-12 02:52:50 +0000
commit693e26e2ad074f8cc9d37098a0568cd93ae30f52 (patch)
tree8588523335a337d0971df768da0456e325bb6b66 /lib/class/artist.class.php
parent003619c52c0370f03b9edb466addaaebac13ce41 (diff)
downloadampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.tar.gz
ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.tar.bz2
ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.zip
commit of the patches from codeoverload to implement tagging, will not work without manual modification of database, yes.. this commit breaks things cope
Diffstat (limited to 'lib/class/artist.class.php')
-rw-r--r--lib/class/artist.class.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index 38361194..73d5bef7 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -76,13 +76,24 @@ class Artist {
return $artist;
} // construct_from_array
-
+ public static function build_cache($ids, $fields='*') {
+ $idlist = '(' . implode(',', $ids) . ')';
+ $sql = "SELECT $fields FROM artist WHERE id in $idlist";
+ $db_results = Dba::query($sql);
+ global $artist_cache;
+ $artist_cache = array();
+ while ($results = Dba::fetch_assoc($db_results)) {
+ $artist_cache[intval($results['id'])] = $results;
+ }
+ }
/**
* _get_info
* get's the vars for $this out of the database taken from the object
*/
private function _get_info() {
-
+ global $artist_cache;
+ if (isset($artist_cache[intval($this->id)]))
+ return $artist_cache[intval($this->id)];
/* Grab the basic information from the catalog and return it */
$sql = "SELECT * FROM artist WHERE id='" . Dba::escape($this->id) . "'";
$db_results = Dba::query($sql);