--- a/server/src/app/Libraries/Mergers/CocoonSoundRdfMerger.php Wed Feb 08 16:38:09 2017 +0100
+++ b/server/src/app/Libraries/Mergers/CocoonSoundRdfMerger.php Thu Feb 09 15:05:36 2017 +0100
@@ -159,7 +159,7 @@
"http://purl.org/dc/terms/issued",
], $targetArray, $baseRes, $srcRes);
- // Must handle modified
+ // Must handle modified and created
$isBaseText = false;
foreach ($baseRes->all("dc11:type","resource") as $resType) {
$type = $resType->getUri();
@@ -171,7 +171,22 @@
if($isBaseText) {
// The base is Text. In this case for http://purl.org/dc/terms/mofified,
// the sound takes over. So we switch baseRes with srcRes in the arguments
+ //print_r($targetArray);
+ //print_r($srcRes->get("<http://purl.org/dc/terms/created>"));
$this->mergeProperties([], ["http://purl.org/dc/terms/mofified"], $targetArray, $srcRes, $baseRes);
+ // created must be handled separately
+ $srcCreated = $srcRes->get("<http://purl.org/dc/terms/created>");
+ $baseCreated = $baseRes->get("<http://purl.org/dc/terms/created>");
+
+ if(is_null($srcCreated) && !is_null($baseCreated)) {
+ // There is no created in sound. Remove created info from targetArray
+ unset($targetArray['http://purl.org/dc/terms/created']);
+ } elseif (!is_null($srcCreated) && !is_null($baseCreated)) {
+ // Force Sound value into target array
+ $targetArray['http://purl.org/dc/terms/created'] = [
+ $srcCreated->toRdfPhp()
+ ];
+ }
}
}