This commit is contained in:
Shoghi Cervantes 2013-06-05 18:25:16 +02:00
parent 89ef299333
commit 1f4df559e0

View File

@ -50,17 +50,13 @@ class EntityAPI{
$l = $this->server->query("SELECT EID FROM entities WHERE hasUpdate = 1;"); $l = $this->server->query("SELECT EID FROM entities WHERE hasUpdate = 1;");
if($l !== false and $l !== true){ if($l !== false and $l !== true){
$q = "";
while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){ while(($e = $l->fetchArray(SQLITE3_ASSOC)) !== false){
$e = $this->get($e["EID"]); $e = $this->get($e["EID"]);
if($e instanceof Entity){ if($e instanceof Entity){
$e->update(); $e->update();
$q .= "UPDATE entities SET hasUpdate = 0 WHERE EID = ".$e->eid.";"; $this->server->query("UPDATE entities SET hasUpdate = 0 WHERE EID = ".$e->eid.";");
} }
} }
if($q !== ""){
$this->server->query("BEGIN TRANSACTION;".$q."COMMIT;");
}
} }
} }