server/src/app/Libraries/RdfModel/RdfModelResource.php
author ymh <ymh.work@gmail.com>
Fri, 27 Nov 2015 17:59:36 +0100
changeset 19 eadaf0b8f02e
parent 4 f55970e41793
child 28 b0b56e0f8c7f
permissions -rw-r--r--
Bo conception step. back to ember page

<?php
namespace CorpusParole\Libraries\RdfModel;

use CorpusParole\Libraries\RdfModel\RdfModelDelta;
use EasyRdf\Resource;

/**
 *
 */
class RdfModelResource extends Resource {

    public function __construct($uri, $graph = null) {
        parent::__construct($uri, $graph);
        $this->uri = $uri;
    }

    protected $deltaList = [];
    protected $currentDelta = null;
    protected $uri = null;

    public function isDirty() {
        return !is_null($this->deltaList) && count($this->deltaList)>0;
    }

    public function deltaCount() {
        return is_null($this->deltaList)?0:count($this->deltaList);
    }

    public function getDeltaList() {
        return $this->deltaList;
    }

    public function getUri() {
        return $this->uri;
    }

    public function startDelta() {
        $this->currentDelta = new RdfModelDelta($this->getGraph()->getUri());
        array_push($this->deltaList, $this->currentDelta);
    }


}