server/src/app/Libraries/RdfModel/RdfModelResource.php
changeset 277 bd4bc1db4f40
parent 28 b0b56e0f8c7f
--- a/server/src/app/Libraries/RdfModel/RdfModelResource.php	Thu Sep 08 19:15:46 2016 +0200
+++ b/server/src/app/Libraries/RdfModel/RdfModelResource.php	Thu Sep 22 12:38:24 2016 +0200
@@ -18,16 +18,27 @@
     protected $currentDelta = null;
     protected $uri = null;
 
+    protected function additionalDeltaLists() {
+        return [];
+    }
+
     public function isDirty() {
-        return !is_null($this->deltaList) && count($this->deltaList)>0;
+        return $this->deltaCount()>0;
     }
 
     public function deltaCount() {
-        return is_null($this->deltaList)?0:count($this->deltaList);
+        $deltaList = $this->getDeltaList();
+        return is_null($deltaList)?0:count($deltaList);
     }
 
     public function getDeltaList() {
-        return $this->deltaList;
+        $deltaList = is_null($this->deltaList)?[]:$this->deltaList;
+        $additionalDeltaLists = $this->additionalDeltaLists();
+        if(!empty($additionalDeltaLists)) {
+            array_unshift($additionalDeltaLists, $deltaList);
+            $deltaList = call_user_func_array('array_merge', $additionalDeltaLists);
+        }
+        return $deltaList;
     }
 
     public function getUri() {
@@ -35,7 +46,7 @@
     }
 
     public function getCurrentDelta() {
-        return $this->getCurrentDelta;
+        return $this->currentDelta;
     }
 
     public function startDelta() {