--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
* Override JModelList 's getItems to insert unit name
*
@see JModelList::getItems()*/
function getItems() { if ($result = parent::getItems()) {$db = JFactory::getDbo();
$query =
"SELECT id, title FROM #__asterman_units"; if ($units = $db->setQuery($query)->loadAssocList('id')) { foreach ($result as $item) { if (empty($item->unit_id)) {$item->
unit_name = 'NA';}
else{$item->
unit_name = $units[$item->unit_id]['title'];}
}
}
return $result;}
}