function people($pDepth = 1, $pReload = FALSE) { if (!$this->isSaved()) { return NULL; } if ($pReload || is_null($this->_people)) { $cache = Zupal_Media_MusicBrainz_Cache::getInstance(); $key = 'artist_people_' . $this->identity(); if (!$cache->test($key) || $pReload) { $sql = 'SELECT laa.link0 AS id, laa.link_type AS link_type' . ' FROM l_artist_artist laa LEFT JOIN artist a ON a.id = link0 ' . ' WHERE (link1 = ?) and (a.type = 1) ORDER BY a.begindate'; // error_log(__METHOD__ . ': ' . $sql); $data = $this->table()->getAdapter()->fetchAssoc($sql, array($this->identity())); $cache->save($data, $key); } $data = $cache->load($key); $people = array(); if ($data) { foreach ($data as $keys) { extract($keys); $artist = new Zupal_Musicbrainz_Artist($id); $link = new Zupal_Musicbrainz_Lt_Artist_Artist($link_type); $group = new stdClass(); $group->artist = $artist; $group->type = $link; $people[] = $group; } } $this->_people = $people; } return $this->_people; }