server/src/app/Libraries/RdfModel/RdfModelResource.php
changeset 4 f55970e41793
child 28 b0b56e0f8c7f
equal deleted inserted replaced
3:2b3247d02769 4:f55970e41793
       
     1 <?php
       
     2 namespace CorpusParole\Libraries\RdfModel;
       
     3 
       
     4 use CorpusParole\Libraries\RdfModel\RdfModelDelta;
       
     5 use EasyRdf\Resource;
       
     6 
       
     7 /**
       
     8  *
       
     9  */
       
    10 class RdfModelResource extends Resource {
       
    11 
       
    12     public function __construct($uri, $graph = null) {
       
    13         parent::__construct($uri, $graph);
       
    14         $this->uri = $uri;
       
    15     }
       
    16 
       
    17     protected $deltaList = [];
       
    18     protected $currentDelta = null;
       
    19     protected $uri = null;
       
    20 
       
    21     public function isDirty() {
       
    22         return !is_null($this->deltaList) && count($this->deltaList)>0;
       
    23     }
       
    24 
       
    25     public function deltaCount() {
       
    26         return is_null($this->deltaList)?0:count($this->deltaList);
       
    27     }
       
    28 
       
    29     public function getDeltaList() {
       
    30         return $this->deltaList;
       
    31     }
       
    32 
       
    33     public function getUri() {
       
    34         return $this->uri;
       
    35     }
       
    36 
       
    37     public function startDelta() {
       
    38         $this->currentDelta = new RdfModelDelta($this->getGraph()->getUri());
       
    39         array_push($this->deltaList, $this->currentDelta);
       
    40     }
       
    41 
       
    42 
       
    43 }