I'm struggling to learn Joomla 3.x and am baffled as to how to join my record to another table and use the joined data in my view/form. I'm familiar with components that use something similar to this: (I've only included partial snippets because the approach I'm familiar with seems quite common throughout other components and my google results)
// JOIN and retrieve the data I'm interested in: function getData() $query = $db->getQuery(true); $query->select('a.name, b.lastvisitDate FROM #__mytable AS a') ->innerJoin('#__users AS b ON a.created_by = b.id');
// The data from the joined data is available for display something like this echo "<span>" . $this->item->lastvisitDate. "</span>"
Now, with Joomla 3, I see a series of function such as
As best as I can tell, it's using predefined forms/XML, fields and such that describe the primary table in great detail. I'm able to change data in
getItem that shows on the view, but am clueless about how to get usable data from the second table!
What's the best-practice way to join my primary table to another, and be able to display that information with the view. (e.g. JOIN myTable.created_by on #__users.id to get something like last visit date.)