server/src/app/Libraries/Mergers/CocoonSoundRdfMerger.php
changeset 114 8af5ed0521a2
parent 113 faff38055a07
child 117 7abc74acf392
equal deleted inserted replaced
113:faff38055a07 114:8af5ed0521a2
   125             "http://purl.org/dc/elements/1.1/title",
   125             "http://purl.org/dc/elements/1.1/title",
   126             "http://purl.org/dc/terms/extent",
   126             "http://purl.org/dc/terms/extent",
   127             "http://purl.org/dc/terms/available",
   127             "http://purl.org/dc/terms/available",
   128             "http://purl.org/dc/terms/created",
   128             "http://purl.org/dc/terms/created",
   129             "http://purl.org/dc/terms/issued",
   129             "http://purl.org/dc/terms/issued",
   130             "http://purl.org/dc/terms/modified"
       
   131         ], $targetArray, $baseRes, $srcRes);
   130         ], $targetArray, $baseRes, $srcRes);
       
   131 
       
   132         // Must handle modified
       
   133         $isBaseText = false;
       
   134         foreach ($baseRes->all("dc11:type","resource") as $resType) {
       
   135             $type = $resType->getUri();
       
   136             if($type === 'http://purl.org/dc/dcmitype/Text') {
       
   137                 $isBaseText = true;
       
   138                 break;
       
   139             }
       
   140         }
       
   141         if($isBaseText) {
       
   142             // The base is Text. In this case for http://purl.org/dc/terms/mofified,
       
   143             // the sound takes over. So we switch baseRes with srcRes in the arguments
       
   144             $this->mergeProperties([], ["http://purl.org/dc/terms/mofified"], $targetArray, $srcRes, $baseRes);
       
   145         }
   132 
   146 
   133     }
   147     }
   134 
   148 
   135     protected function mergeEdmWebResources($baseRes, $srcRes, $uri=null) {
   149     protected function mergeEdmWebResources($baseRes, $srcRes, $uri=null) {
   136         if(is_null($uri)) {
   150         if(is_null($uri)) {