server/src/app/Models/Document.php
changeset 501 7b2dcd2b31c1
parent 500 4f507ba2bb4c
child 520 d6adc4047ede
equal deleted inserted replaced
500:4f507ba2bb4c 501:7b2dcd2b31c1
    31     private $subjects = null;
    31     private $subjects = null;
    32     private $types = null;
    32     private $types = null;
    33     private $descriptions = null;
    33     private $descriptions = null;
    34     private $geoInfo = false;
    34     private $geoInfo = false;
    35     private $alternativeTitle = false;
    35     private $alternativeTitle = false;
       
    36     private $rights = false;
    36 
    37 
    37     protected function clearMemoizationCache() {
    38     protected function clearMemoizationCache() {
    38         parent::clearMemoizationCache();
    39         parent::clearMemoizationCache();
    39         $this->publishers = null;
    40         $this->publishers = null;
    40         $this->mediaArray = null;
    41         $this->mediaArray = null;
    42         $this->subjects = null;
    43         $this->subjects = null;
    43         $this->types = null;
    44         $this->types = null;
    44         $this->descriptions = null;
    45         $this->descriptions = null;
    45         $this->transcript = false;
    46         $this->transcript = false;
    46         $this->geoInfo = false;
    47         $this->geoInfo = false;
       
    48         $this->rights = false;
    47     }
    49     }
    48 
    50 
    49     protected function additionalDeltaLists() {
    51     protected function additionalDeltaLists() {
    50 
    52 
    51         $geoInfo = $this->getGeoInfo();
    53         $geoInfo = $this->getGeoInfo();
   343     public function getAlternativeTitleValue() {
   345     public function getAlternativeTitleValue() {
   344         $alternativeTitle = $this->getAlternativeTitle();
   346         $alternativeTitle = $this->getAlternativeTitle();
   345         return is_null($alternativeTitle)?null:$alternativeTitle->getValue();
   347         return is_null($alternativeTitle)?null:$alternativeTitle->getValue();
   346     }
   348     }
   347 
   349 
       
   350 
       
   351     /**
       
   352      * Get Rights
       
   353      */
       
   354     public function getRights() {
       
   355         if($this->rights === false) {
       
   356             try {
       
   357                 $this->rights = $this->getResource('<http://www.europeana.eu/schemas/edm/rights>');
       
   358             } catch(\Exception $e) {
       
   359                 $this->rights = null;
       
   360             }
       
   361         }
       
   362         return $this->rights;
       
   363     }
       
   364 
       
   365     public function getRightsValue() {
       
   366         $rights = $this->getRights();
       
   367         return is_null($rights)?null:$rights->getUri();
       
   368     }
       
   369 
   348     public function isIsomorphic($doc) {
   370     public function isIsomorphic($doc) {
   349         return Isomorphic::isomorphic($this->graph, $doc->graph);
   371         return Isomorphic::isomorphic($this->graph, $doc->graph);
   350     }
   372     }
   351 
   373 
   352     /*
   374     /*
   406                 'transcript' => $transcript,
   428                 'transcript' => $transcript,
   407                 'mediaArray'=> $mediaArray,
   429                 'mediaArray'=> $mediaArray,
   408                 'geoInfo' => $geoInfo,
   430                 'geoInfo' => $geoInfo,
   409                 'descriptions' => $descriptions,
   431                 'descriptions' => $descriptions,
   410                 'alternativeTitle' => $this->getAlternativeTitleValue(),
   432                 'alternativeTitle' => $this->getAlternativeTitleValue(),
       
   433                 'rights' => $this->getRightsValue()
   411             ]);
   434             ]);
   412 
   435 
   413         }
   436         }
   414         return $res;
   437         return $res;
   415 
   438