NYCPHP Meetup

NYPHP.org

[joomla] JTable method

Mitch Pirtle mitch.pirtle at gmail.com
Tue Jul 28 11:33:48 EDT 2009


I have a love/hate relationship with JTable. It was created primarily
as a way for simple, canned access to database objects, like a
simplistic ORM of sorts. However it has some glaring shortcomings due
to the "no sharp corners allowed" approach.

I find myself jumping to good ol' JFactory::getDBO() more often than
not, as I'm happy doing it myself.

JTable is also very handy for whipping together admin screens,
assuming you have a very flat schema ;-)

-- Mitch

On Tue, Jul 28, 2009 at 11:17 AM, Mark Simko<masimko at verizon.net> wrote:
> I'm currently struggling through Packt Publishing's 'Learning Joomla 1.5
> Extension Development', and I'm finding that the text frequently uses
> code that remains unexplained. The author also makes method calls to
> classes that get defined in the next file he covers, but at that point
> it's not explained. I wouldn't recommend this book, but enough rant.
>
> Here's my question:
>
> He uses this code:
>
> $row =& JTable::getInstance('Review', 'Table');
>
> The $row object gets passed to a class in another file, so I wanted to
> know what this object was, and how it is being created. I have no idea
> what the 'Review' and 'Table' parameters are. So I tried looking them up
> here: http://docs.joomla.org/JTable/getInstance . If you look there, you
> may understand why I'm having trouble understanding even the official
> documentation.
>
> If anyone can give a brief 'splanation of this method's usage, I'd be
> much obliged.
>
> I'm also wondering if I'd be better off just using the direct calls to
> the database from a database object created with JFactory rather than
> use this class.
>
> And just to throw a log on the fire, I'm not all that big a fan of MVC,
> all the time. I think sometimes it just makes the code much harder to
> follow. ;)
>
> Thanks,
> Mark
>
>
>
> --
> Mark Simko
> ======================
> Digifix
> 659 Wool Ave.
> Franklin Square, NY 11010
> =======================
> 516 376 5564
> 516 292 0223
> =======================
> msimko at digifix.us
> masimko at verizon.net
> www.digifix.us
>
> _______________________________________________
> New York PHP SIG: Joomla! Mailing List
> http://lists.nyphp.org/mailman/listinfo/joomla
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



More information about the Joomla mailing list