Prev | Current Page 555 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


From here, the Manager class is ready to accept requests. In this particular instance, you have used the
neko.db.Manager.get method, which retrieves a record based on its id and returns it in its mapped
object type, provided the id field is of a type that can map freely to the haXe integer type. If the type of
the id field is not mappable to an integer or multiple fields are required for the id, then the neko.
db.Manager.getWithKeys method may be used instead. Both of these methods will be discussed in a
little more detail, later.
From this point on, you are free to modify and use the object as you would any other object, with the
exception that you are provided with several methods that provide a direct link to the data contained in
the object with the data contained in the database. As you can see in the example, the insert and
update methods may be used depending on the availability of a record with the given id.
Finally, when all your work has completed, the Manager class ??™ s cleanup method is called and the
database connection closed.


Pages:
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567