Created
July 19, 2015 14:39
-
-
Save mjordan/4ae7724d5b3ffe38207f to your computer and use it in GitHub Desktop.
Islandora Dev 101 Exercise 3: Two sample implementations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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