Skip to content

Instantly share code, notes, and snippets.

@mjordan
Created July 19, 2015 14:39
Show Gist options
  • Save mjordan/4ae7724d5b3ffe38207f to your computer and use it in GitHub Desktop.
Save mjordan/4ae7724d5b3ffe38207f to your computer and use it in GitHub Desktop.
Islandora Dev 101 Exercise 3: Two sample implementations
/**
* Implements hook_islandora_datastream_access().
*/
function islandora_dev101_islandora_datastream_access($op, $object, $user) {
if ($op == 'view fedora repository objects') {
foreach ($object as $ds) {
if ($ds->id == 'DC') {
// file_put_contents('/tmp/myfile.txt', $ds->content);
dd($ds->content);
}
}
}
return NULL;
}
/**
* Implements hook_islandora_view_object().
*
* Note: Changes to this function may not take effect until
* you clear your cache (e.g., 'drush cc all').
*/
function islandora_dev101_islandora_view_object(AbstractObject $object) {
if (isset($object['DC'])) {
// file_put_contents('/tmp/myfile.txt', $object['DC']->content);
dd($object['DC']->content);
}
return array();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment