server/src/app/Models/Document.php
changeset 18 f2a40bbc27f6
parent 4 f55970e41793
child 19 eadaf0b8f02e
--- a/server/src/app/Models/Document.php	Fri Nov 13 16:45:27 2015 +0100
+++ b/server/src/app/Models/Document.php	Tue Nov 17 13:11:55 2015 +0100
@@ -3,6 +3,7 @@
 
 use Config;
 use CorpusParole\Libraries\Utils;
+use CorpusParole\Libraries\CocoonUtils;
 use CorpusParole\Libraries\RdfModel\RdfModelResource;
 use JsonSerializable;
 use Log;
@@ -26,7 +27,7 @@
 
     public function getId() {
         if(is_null($this->id)) {
-            $this->id = substr($this->uri, strlen(Config::get('corpusparole.cocoon_doc_id_base_uri')));
+            $this->id = CocoonUtils::getIdFromUri($this->uri);
         }
         return $this->id;
     }
@@ -59,7 +60,7 @@
         }
         foreach ($formats as $f) {
             $uri = $f->getUri();
-            $mimetype = Utils::get_mimetype($uri);
+            $mimetype = Utils::getMimetype($uri);
             array_push($res, ["url" => $uri, "format" => $mimetype]);
         }
 
@@ -127,13 +128,13 @@
         } else {
             $mediaArray = array_map(
                 function($m) {
-                    $f = Utils::process_literal_or_string($m['format']);
+                    $f = Utils::processLiteralOrString($m['format']);
                     return ['url' => $m['url'], 'format' => $f];},
                 $this->getMediaArray()
             );
 
             $publishers = array_map(
-                function($v) { return Utils::process_literal_or_string($v); },
+                function($v) { return Utils::processLiteralOrString($v); },
                 $this->getPublishers()
             );