From 9031139e86398876b9ea0a6fc9bb4a25e625f84c Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Mon, 8 Oct 2018 22:20:36 -0300 Subject: [PATCH] Implement hook_islandora_solution_pack_child_relationships(). (#161) --- islandora_newspaper.module | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/islandora_newspaper.module b/islandora_newspaper.module index 971d7d3..6765cf5 100644 --- a/islandora_newspaper.module +++ b/islandora_newspaper.module @@ -666,3 +666,21 @@ function islandora_newspaper_islandora_paged_content_content_model_registry() { ), ); } + +/** + * Implements hook_islandora_solution_pack_child_relationships(). + */ +function islandora_newspaper_islandora_solution_pack_child_relationships($cmodels) { + $relationships = array('predicate' => array(), 'prefix' => array()); + + if ($cmodels === 'all' || in_array('islandora:newspaperCModel', $cmodels)) { + $relationships['predicate'][] = ''; + } + + if ($cmodels === 'all' || in_array('islandora:newspaperIssueCModel', $cmodels)) { + $relationships['prefix'][] = 'PREFIX islandora: '; + $relationships['predicate'][] = ''; + } + + return $relationships; +}