I'm working through the API and trying to find image id's stored in albums using the album id.
ie:
GalleryCoreApi::loadEntitiesById($album_id)
I get information about the album, now I'm looking for that albums decedent albums and/or child item images id's.
Anyone have suggestions as to how I might go about this?
Thank you.
Posts: 4342
The best way to find out that kind of thing is to go through the source code and see how that handles the same issue, eg. for displaying an album.
In this case try this:
http://gallery.menalto.com/apidoc/GalleryCore/Classes/GalleryCoreApi.html#methodfetchChildItemIds
Posts: 3
Good advice. I found and tried the fetchChildItemIds() previously and was gifted with an error. Unfortunately there is no error message tagged to it and a search hasn't produced any results.
Object id #14Array
(
[0] => GalleryStatus Object
(
[_stack] =>
[_errorCode] => 17
[_errorMessage] =>
[_stackTrace] => Array
I also tried fetchChildItemIdsIgnorePermissions() and got the same error.
Posts: 4342
Then it sounds like you're not using the API correctly. You should be doing something like this:
The precise return depends on the context of your function. However, the rule that if you receive a non-null return code ($ret) from the API you should pass it back up the call chain still applies. Then your error and stack trace are printed to screen (if you're admin) correctly and you can trace the error.
This kind of structure is easily seen thousands of times over all through the Gallery code.
Posts: 3
I'm obviously just getting started on this and jumping in too quickly. I'll back up and poke around more in the future. I only have 2 hours to learn the API. Which is plenty right? ;)
Posts: 4342
No, it's good to jump straight in. But start by copying chunks of code from the existing installation.