JTable class, can it create read update multiple tables?

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
flyingwombats
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Mar 20, 2007 10:48 pm

JTable class, can it create read update multiple tables?

Post by flyingwombats » Sun Sep 16, 2007 12:20 pm

Im working through learning joomla 1.5 extension dev. I am now making my own extensions but it uses a single table and states JTable can do all from a SINGLE table.

Can it be used with multiple tables? Im used to multi joins in procedural  php but not in a class environment, any help or suggestions gratefully received...Would another Object/class be better?

User avatar
ianmac
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 237
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: JTable class, can it create read update multiple tables?

Post by ianmac » Sun Sep 16, 2007 5:41 pm

You can override JTable to do just about anything you want, but it generally isn't the best practice.

You more likely want to build your join into your model instead.

Ian
Help test my Component XML Generator Tool!
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,1997/Itemid,35/
All feedback appreciated!

flyingwombats
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Mar 20, 2007 10:48 pm

Re: JTable class, can it create read update multiple tables?

Post by flyingwombats » Sun Sep 16, 2007 7:49 pm

So use the model to do the join then JTable to access it as if it were one table. *bangs head on table* thanks , obvious now.


Post Reply