Prev | Current Page 567 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

For example, you might want to extract only
those authors who have the letter e in their name:
Author.manager.objects( Author.manager.select(???var_username LIKE ???%e%??™???), true );
Extending the neko.db.Manager Class
Extending the neko.db.Manager class for a specific table or group of tables opens up a whole new
world of possibilities. For one, the Manager subclass could be filled with numerous custom record
retrieval methods that you might need to use regularly. Also, the make and unmake methods called at
key times within the Manager class code provide a great way to ensure data integrity. Such calls provide
pseudo trigger functionality that you can use to handle data between trips to the database. You could
even extend the existing functions within the Manager class and provide your own event methods.
When extending the neko.db.Manager class, you need to make sure you forward the relevant neko
.db.Object subclass to the parent constructor. Once this is done, you can pretty much do what you like.
For instance, here is an example that facilitates a method returning authors with a given e - mail address:
class AuthorManager extends neko.


Pages:
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579