Skip to content

Instantly share code, notes, and snippets.

@jordandukart
Created November 15, 2017 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordandukart/b488ea8bdfe62a90754f9578ece1acb0 to your computer and use it in GitHub Desktop.
Save jordandukart/b488ea8bdfe62a90754f9578ece1acb0 to your computer and use it in GitHub Desktop.
Example derivative
<?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';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment