diff -r 009efee954f7 -r 17f10b56c079 server/src/app/Models/MediaResource.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/app/Models/MediaResource.php Thu Jun 02 18:24:19 2016 +0200 @@ -0,0 +1,60 @@ +dump('html')); + parent::__construct(...$args); + list(,,$master) = $args; + $this->master = $master; + } + + public function isMaster() { + return $this->master; + } + + protected function doClearMemoizationCache() { + $this->extent = -1; + $this->extentMs = -1; + } + + public function getExtent() { + if($this->extent === -1) { + $extent = $this->getLiteral(""); + $this->extent = is_null($extent)?null:$extent->getValue(); + } + + return $this->extent; + } + + public function getExtentMs() { + if($this->extentMs === -1 ) { + $this->extentMs = Utils::iso8601IntervalToMillis($this->getExtent()); + } + return $this->extentMs; + } + + + protected function jsonSerializeExtra() { + return [ + 'extent' => $this->getExtent(), + 'extent_ms' => $this->getExtentMs(), + 'master' => $this->isMaster() + ]; + } + +} \ No newline at end of file