server/src/app/Models/Document.php
changeset 377 52169c718513
parent 371 0365fd9977a4
child 497 f3474aeec884
equal deleted inserted replaced
376:02f113d43f18 377:52169c718513
    98         return $this->getProvidedCHO()->all('dc11:type');
    98         return $this->getProvidedCHO()->all('dc11:type');
    99     }
    99     }
   100 
   100 
   101     public function getDiscourseTypes() {
   101     public function getDiscourseTypes() {
   102         return array_values(array_filter($this->getTypes(), function($v) {
   102         return array_values(array_filter($this->getTypes(), function($v) {
   103             return $v instanceof Resource && preg_match(config('corpusparole.bnf_ark_url_regexp'), $v->getUri());
   103             return $v instanceof Resource
       
   104                 && preg_match(config('corpusparole.bnf_ark_url_regexp'), $v->getUri())
       
   105                 && array_key_exists($v->getUri(), config('corpusparole.corpus_discourse_type'));
   104         }));
   106         }));
   105     }
   107     }
   106 
   108 
   107     public function getOtherTypes() {
   109     public function getOtherTypes() {
   108         $res = array_values(array_filter($this->getTypes(), function($v) {
   110         $res = array_values(array_filter($this->getTypes(), function($v) {
   109             return !($v instanceof Resource) || !preg_match(config('corpusparole.bnf_ark_url_regexp'), $v->getUri());
   111             return !($v instanceof Resource)
       
   112                 || !preg_match(config('corpusparole.bnf_ark_url_regexp'), $v->getUri())
       
   113                 || !array_key_exists($v->getUri(), config('corpusparole.corpus_discourse_type'));
   110         }));
   114         }));
   111         return $res;
   115         return $res;
   112     }
   116     }
   113 
   117 
   114     public function getTranscript() {
   118     public function getTranscript() {