Ejemplo n.º 1
0
 public function equals(phpBrainz_Release $compareObj)
 {
     if ($this->id == $compareObj->getId() && phpBrainz::isValidMBID($this->id) || $this->artist->equals($compareObj->getArtist()) && $this->title == $compareObj->getTitle()) {
         return true;
     }
     return false;
 }
 private function parseReleaseXML($release)
 {
     $releaseObj = new phpBrainz_Release();
     $artistObj = $this->parseArtistXML($release->artist);
     $attrNS = $release->attributes("http://musicbrainz.org/ns/ext-1.0#");
     $releaseObj->setScore((string) $attrNS->score);
     $releaseObj->setArtist($artistObj);
     $releaseObj->setId((string) $release['id']);
     $releaseObj->setTitle((string) $release->title);
     $releaseObj->setTracksCount((string) $release->{'track-list'}['count']);
     $releaseObj->setTracksOffset((string) $release->{'track-list'}['offset']);
     $releaseObj->setDiscCount((string) $release->{'disc-list'}['count']);
     if (isset($release->{'track-list'})) {
         foreach ($release->{'track-list'}->track as $trackXML) {
             $releaseObj->addTrack($this->parseTrackXML($trackXML));
         }
     }
     if (isset($release->asin)) {
         $releaseObj->setASIN((string) $release->asin);
     }
     return $releaseObj;
 }