GearsORM. ResultIterator.js

Contains the ResultIterator class.

License

MIT-style license.

Summary
Contains the ResultIterator class.
a iterator on a Google Gears ResultSet
return the next row in the ResultSet as a model instance,if it is the last row it will return false.
a function to iterate the ResultSet like ruby each.
close the ResultSet,this will be done automaticlly if the ResultSet is iterated to the end.
return the first row of the ResultSet,will return false if the ResultSet is empty.
return the ResultSet as Array of model instances

GearsORM. ResultIterator

a iterator on a Google Gears ResultSet

Parameters

resultthe ResultSet to iterate
modelClassthe model class used to map the results
Summary
return the next row in the ResultSet as a model instance,if it is the last row it will return false.
a function to iterate the ResultSet like ruby each.
close the ResultSet,this will be done automaticlly if the ResultSet is iterated to the end.
return the first row of the ResultSet,will return false if the ResultSet is empty.
return the ResultSet as Array of model instances

Functions

next

next:function()

return the next row in the ResultSet as a model instance,if it is the last row it will return false.

each

each:function(fn,
bind)

a function to iterate the ResultSet like ruby each.

Parameters

fnfunction to be called for each row in the ResultSet
bindthis will be used as this for the function,optional

close

close:function()

close the ResultSet,this will be done automaticlly if the ResultSet is iterated to the end. if you don`t finish iterate the ResultSet this need to be called manually.

getOne

getOne:function()

return the first row of the ResultSet,will return false if the ResultSet is empty.

toArray

toArray:function()

return the ResultSet as Array of model instances

next:function()
return the next row in the ResultSet as a model instance,if it is the last row it will return false.
each:function(fn,
bind)
a function to iterate the ResultSet like ruby each.
close:function()
close the ResultSet,this will be done automaticlly if the ResultSet is iterated to the end.
getOne:function()
return the first row of the ResultSet,will return false if the ResultSet is empty.
toArray:function()
return the ResultSet as Array of model instances