--- a/server/src/app/Models/DocumentBase.php Wed Feb 08 15:25:24 2017 +0100
+++ b/server/src/app/Models/DocumentBase.php Wed Feb 08 16:38:09 2017 +0100
@@ -68,15 +68,15 @@
public function getCocoonId() {
if(is_null($this->cocoonId)) {
- $ids = $this->getProvidedCHO()->all('<http://purl.org/dc/elements/1.1/identifier>');
- foreach ($ids as $id) {
- if($id instanceof Literal && strpos($id->getValue(), config('corpusparole.cocoon_doc_id_base')) === 0) {
- $this->cocoonId = substr($id->getValue(), strlen(config('corpusparole.cocoon_doc_id_base')));
+ $this->cocoonId = CocoonUtils::getCocoonIdFromCorpusUri($this->uri);
+ if(is_null($this->cocoonId)) {
+ $ids = $this->getProvidedCHO()->all('<http://purl.org/dc/elements/1.1/identifier>');
+ foreach ($ids as $id) {
+ if($id instanceof Literal && strpos($id->getValue(), config('corpusparole.cocoon_doc_id_base')) === 0) {
+ $this->cocoonId = substr($id->getValue(), strlen(config('corpusparole.cocoon_doc_id_base')));
+ }
}
}
- if(is_null($this->cocoonId)) {
- $this->id = CocoonUtils::getCocoonIdFromCorpusUri($this->uri);
- }
}
return $this->cocoonId;
}