[joomla] JTable method
Donna Marie Vincent
donnamarievincent at yahoo.com
Tue Jul 28 12:02:09 EDT 2009
Sometimes it's easier to make the direct calls, sometimes not, depending on what other data you need.
If the table's key consists of more than one field you cannot use JTable.
The table class for that example is probably in administrator/components/com_reviews/tables/reviews.php.
I have that book, too, and didn't get it from reading the book. I didn't get it until I had to do it for real. And it's faster to do $row->store than make db update calls.
________________________________
From: Mark Simko <masimko at verizon.net>
To: JoomlaList <joomla at lists.nyphp.org>
Sent: Tuesday, July 28, 2009 11:17:09 AM
Subject: [joomla] JTable method
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/joomla/attachments/20090728/ace42261/attachment.html>
More information about the Joomla
mailing list