Explorar o código

fixed update() implementation
don't use dynamic because broken when overridding

Nicolas Cannasse %!s(int64=17) %!d(string=hai) anos
pai
achega
78a5ae733a
Modificáronse 1 ficheiros con 4 adicións e 6 borrados
  1. 4 6
      std/php/db/Object.hx

+ 4 - 6
std/php/db/Object.hx

@@ -58,11 +58,6 @@ class Object #if spod_rtti implements haxe.rtti.Infos #end {
 
 	private function __init_object() {
 		__noupdate__ = false;
-		var me = this;
-		update = function() {
-			if(me.__noupdate__) throw "Cannot update not locked object";
-			me.__manager__.doUpdate(me);
-		}
 
 		__manager__ = Manager.managers.get(Type.getClassName(Type.getClass(this)));
 		var rl : Array<Dynamic>;
@@ -77,7 +72,10 @@ class Object #if spod_rtti implements haxe.rtti.Infos #end {
 		__manager__.doInsert(this);
 	}
 
-	public dynamic function update();
+	public function update() {
+		if( __noupdate__ ) throw "Cannot update not locked object";
+		__manager__.doUpdate(this);
+	}
 
 	public function sync() {
 		__manager__.doSync(this);