GearsORM. ResultIterator.js

Contains the ResultIterator class.

License

MIT-style license.

Summary
GearsORM. ResultIterator.jsContains the ResultIterator class.
GearsORM. ResultIteratora iterator on a Google Gears ResultSet
Functions
nextreturn the next row in the ResultSet as a model instance,if it is the last row it will return false.
eacha function to iterate the ResultSet like ruby each.
closeclose the ResultSet,this will be done automaticlly if the ResultSet is iterated to the end.
getOnereturn the first row of the ResultSet,will return false if the ResultSet is empty.
getOnereturn 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
Functions
nextreturn the next row in the ResultSet as a model instance,if it is the last row it will return false.
eacha function to iterate the ResultSet like ruby each.
closeclose the ResultSet,this will be done automaticlly if the ResultSet is iterated to the end.
getOnereturn the first row of the ResultSet,will return false if the ResultSet is empty.
getOnereturn 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.

getOne

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.