tables
Scotte Meredith
spomacguy at gmail.com
Thu Mar 16 22:51:16 UTC 2023
> On Mar 16, 2023, at 3:39 PM, Das Goravani <goravanis at gmail.com> wrote:
>
>
> Omnis says Table Classes are a special type of Object Class, or they are similar, but tables are nice.
Yes, a table class is a type of object that makes the built-in methods of a schema (or query) class visible and changeable.
If you take a new table class and set the $sqlclassname to your schema class and open the table class, you will see in red all of the built-in schema methods. You can then override them or create your own methods in there.
If the table class is a subclass of a generic table class, you will see in blue all the methods of the parent(s) class. Again, those can be overwritten.
And for more fun, you can create object classes to combine a bunch of table classes (and other code) to take care of all the interactions between different related tables. So you could have an Invoice object class that combined a table class for the header record of the invoice and a table class for the individual lines of the invoice and saved the header first and then the individual lines while putting in the foreign key to the invoice. And have helper table classes for the lookups into vendors, receipts, checks, and anything else that needed to be linked together.
Scotte Meredith
spomacguy at gmail.com
509/998-0991
More information about the omnisdev-en
mailing list