server/src/app/Models/Document.php
changeset 498 265992e5b379
parent 497 f3474aeec884
child 500 4f507ba2bb4c
equal deleted inserted replaced
497:f3474aeec884 498:265992e5b379
    28     private $mediaArray = null;
    28     private $mediaArray = null;
    29     private $transcript = false;
    29     private $transcript = false;
    30     private $contributors = null;
    30     private $contributors = null;
    31     private $subjects = null;
    31     private $subjects = null;
    32     private $types = null;
    32     private $types = null;
       
    33     private $descriptions = null;
    33     private $geoInfo = false;
    34     private $geoInfo = false;
    34 
    35 
    35     protected function clearMemoizationCache() {
    36     protected function clearMemoizationCache() {
    36         parent::clearMemoizationCache();
    37         parent::clearMemoizationCache();
    37         $this->publishers = null;
    38         $this->publishers = null;
    38         $this->mediaArray = null;
    39         $this->mediaArray = null;
    39         $this->contributors = null;
    40         $this->contributors = null;
    40         $this->subjects = null;
    41         $this->subjects = null;
    41         $this->types = null;
    42         $this->types = null;
       
    43         $this->descriptions = null;
    42         $this->transcript = false;
    44         $this->transcript = false;
    43         $this->geoInfo = false;
    45         $this->geoInfo = false;
    44     }
    46     }
    45 
    47 
    46     protected function additionalDeltaLists() {
    48     protected function additionalDeltaLists() {
   308             $this->getPublishers()
   310             $this->getPublishers()
   309         );
   311         );
   310     }
   312     }
   311 
   313 
   312 
   314 
       
   315     /**
       
   316      * Get subjects list
       
   317      */
       
   318     public function getDescriptions() {
       
   319         if(is_null($this->descriptions)) {
       
   320             $this->descriptions = [];
       
   321             $this->descriptions = array_merge($this->descriptions, $this->getProvidedCHO()->all('<http://purl.org/dc/elements/1.1/description>'));
       
   322             $this->descriptions = array_merge($this->descriptions, $this->getProvidedCHO()->all('<http://purl.org/dc/terms/abstract>'));
       
   323             $this->descriptions = array_merge($this->descriptions, $this->getProvidedCHO()->all('<http://purl.org/dc/terms/tableOfContents>'));
       
   324         }
       
   325         return $this->descriptions;
       
   326     }
       
   327 
   313 
   328 
   314     public function isIsomorphic($doc) {
   329     public function isIsomorphic($doc) {
   315         return Isomorphic::isomorphic($this->graph, $doc->graph);
   330         return Isomorphic::isomorphic($this->graph, $doc->graph);
   316     }
   331     }
   317 
   332 
   357             );
   372             );
   358             $types = array_map(
   373             $types = array_map(
   359                 function($s) { return Utils::processLiteralResourceOrString($s); },
   374                 function($s) { return Utils::processLiteralResourceOrString($s); },
   360                 $this->getTypes()
   375                 $this->getTypes()
   361             );
   376             );
       
   377             $descriptions = array_map(
       
   378                 function($s) { return Utils::processLiteralResourceOrString($s); },
       
   379                 $this->getDescriptions()
       
   380             );
   362 
   381 
   363             $res = array_merge($res, [
   382             $res = array_merge($res, [
   364                 'publishers' => $publishers,
   383                 'publishers' => $publishers,
   365                 'contributors' => $contributors,
   384                 'contributors' => $contributors,
   366                 'subjects' => $subjects,
   385                 'subjects' => $subjects,
   367                 'types' => $types,
   386                 'types' => $types,
   368                 'transcript' => $transcript,
   387                 'transcript' => $transcript,
   369                 'mediaArray'=> $mediaArray,
   388                 'mediaArray'=> $mediaArray,
   370                 'geoInfo' => $geoInfo
   389                 'geoInfo' => $geoInfo,
       
   390                 'descriptions' => $descriptions
   371             ]);
   391             ]);
   372 
   392 
   373         }
   393         }
   374         return $res;
   394         return $res;
   375 
   395