server/src/app/Models/TranscriptResource.php
author ymh <ymh.work@gmail.com>
Thu, 02 Jun 2016 18:24:19 +0200
changeset 168 17f10b56c079
child 521 b3c738a20af8
permissions -rw-r--r--
improve document model and propagate changes. This include the change of document fixtures to better reflect what the api is effectively returning

<?php
namespace CorpusParole\Models;

use CorpusParole\Libraries\RdfModel\RdfModelResource;
use CorpusParole\Libraries\Utils;

use JsonSerializable;
use Log;


/**
 */
class TranscriptResource extends WebResource  {

    private $conformsTo = -1;


    protected function doClearMemoizationCache() {
        $this->conformsTo = -1;
    }

    public function getConformsTo() {
        if($this->conformsTo === -1) {
            $conformsTo = $this->getResource("<http://purl.org/dc/terms/conformsTo>");
            $this->conformsTo = is_null($conformsTo)?null:$conformsTo->getUri();
        }

        return $this->conformsTo;
    }


    protected function jsonSerializeExtra() {
        return [
            'conforms-to' => $this->getConformsTo()
        ];
    }

}