From: Maxime Bourget Date: Mon, 27 May 2013 19:25:15 +0000 (+0100) Subject: db_query works. Returned object needs to be warped. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=894277e0a367e49630572681f89afa8415e49699;p=order_line_extra.git db_query works. Returned object needs to be warped. --- diff --git a/haxe/ItemScheduler.hx b/haxe/ItemScheduler.hx index cec9f27..8efb21a 100644 --- a/haxe/ItemScheduler.hx +++ b/haxe/ItemScheduler.hx @@ -16,11 +16,11 @@ class QueryIterator { private function fetch() { var next : Dynamic = untyped __call__('db_fetch', this.result); - this.nextValue = if(next) Just(next) else Nothing; + nextValue = if(next) Just(next) else Nothing; } public function hasNext() : Bool { - return this.nextValue == Nothing; + return this.nextValue != Nothing; } public function next() : T { @@ -35,7 +35,7 @@ class QueryIterator { } class FA { static public function query(sql: String) { - var result = untyped __call__('db_query', sql); + var result = untyped __call__('db_query', sql, sql); return new QueryIterator(result); } } @@ -56,7 +56,8 @@ class ItemScheduler { } function formatRow(row) { - php.Lib.print('helli'); + var array = php.Lib.hashOfAssociativeArray(row); + php.Lib.print(''+array.get('stock_id')+''); }