Closed nleonar25 closed 2 years ago
Will check that soon @nleonar25. Thank you for your interest.
Hello @nleonar25. I just pushed a fix on master that updates the documentation.
The getTracks
method has been replaced with getTracksPerCd
but I forgot to update the documentation.
Working sample is:
use DedexBundle\Controller\ErnParserController;
use DedexBundle\Simplifiers\SimpleAlbum;
$xml_path = "tests/samples/with_assets/004_complete/1199119911991.xml";
$parser = new ErnParserController();
$ern = $parser->parse($xml_path);
$album = new SimpleAlbum($ern);
// Then you can access high level property of this album
$release_date = $album->getOriginalReleaseDate();
$artists_at_album_level = $album->getArtists();
$tracks_for_cd_1 = $album->getTracksPerCd()[1];
// You can also access exact XML mapping by getting
// ddex objects at album or track level
$ddex_release = $album->getDdexRelease();
$ddex_release->getReleaseId()[0]->getICPN()->value(); // direct access
$ddex_track = $tracks_for_cd_1[1]->getDdexSoundRecording()->getDuration(); // direct access
Thank you for the update and thank you for putting this library together. It has saved me so much time.
On Sat, Apr 9, 2022, 4:11 AM Mickaël A. @.***> wrote:
Hello @nleonar25 https://github.com/nleonar25. I just pushed a fix on master that updates the documentation. The getTracks method has been replaced with getTracksPerCd but I forgot to update the documentation.
Working sample is:
use DedexBundle\Controller\ErnParserController;use DedexBundle\Simplifiers\SimpleAlbum; $xml_path = "tests/samples/with_assets/004_complete/1199119911991.xml";$parser = new ErnParserController();$ern = $parser->parse($xml_path);$album = new SimpleAlbum($ern); // Then you can access high level property of this album$release_date = $album->getOriginalReleaseDate();$artists_at_album_level = $album->getArtists();$tracks_for_cd_1 = $album->getTracksPerCd()[1]; // You can also access exact XML mapping by getting // ddex objects at album or track level$ddex_release = $album->getDdexRelease();$ddex_release->getReleaseId()[0]->getICPN()->value(); // direct access$ddex_track = $tracks_for_cd_1[1]->getDdexSoundRecording()->getDuration(); // direct access
— Reply to this email directly, view it on GitHub https://github.com/miqwit/dedex/issues/11#issuecomment-1093834642, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLUIFOY33MFVNL6S36MOW3VEFCTZANCNFSM5RMB2S5A . You are receiving this because you were mentioned.Message ID: @.***>
Hello, When I use the following code example, I get the Uncaught Error: Call to undefined method DedexBundle\Simplifiers\SimpleAlbum::getTracks()
I checked SimpleAlbum class/file, there is no getTracks() method
Thanks