Skip to content

Instantly share code, notes, and snippets.

@jonathangreen
Last active May 1, 2018 19:33
Show Gist options
  • Save jonathangreen/447b47ddaf2aa23ade75556ad9311be8 to your computer and use it in GitHub Desktop.
Save jonathangreen/447b47ddaf2aa23ade75556ad9311be8 to your computer and use it in GitHub Desktop.
Tuque datastream versions
<?php
// Some docs here:
// https://github.com/Islandora/islandora/wiki/Working-With-Fedora-Objects-Programmatically-Via-Tuque
// https://github.com/Islandora/islandora/wiki/Build,-Access,-Modify-and-Delete-Fedora-objects-with-the-Tuque-interface
$object = islandora_object_load('my:pid');
$dsid = $object['DSID'];
$number_of_versions = count($dsid);
foreach ($dsid as $version) {
print $version->createdDate->format('Y-m-d H:i:s');
}
$my_ds_content = $dsid[2]->content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment