Created
November 15, 2017 13:53
-
-
Save jordandukart/b488ea8bdfe62a90754f9578ece1acb0 to your computer and use it in GitHub Desktop.
Example derivative
This file contains 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
<?php | |
/** | |
* Implements hook_islandora_derivative(). | |
*/ | |
function test_islandora_derivative(AbstractObject $object) { | |
return array( | |
'source_dsid' => 'TEST', | |
'destination_dsid' => 'TEST', | |
'function' => 'test_test_derivative', | |
); | |
} | |
/** | |
* Example callback for derivative recursion. | |
*/ | |
function test_test_derivative(AbstractObject $object, $force = FALSE) { | |
if (isset($object['TEST'])) { | |
$content = $object['TEST']->content; | |
if ($content != 'om') { | |
$object['TEST']->content = 'om'; | |
} | |
} | |
} |
This file contains 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
nom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment