/** * This global function loads the first row of a query into an object * * If an object is passed to this function, the returned row is bound to the existing elements of <var>object</var>. * If <var>object</var> has a value of null, then all of the returned query fields returned in the object. * @param string The SQL query * @param object The address of variable */ function loadObject($translate = true, $language = null) { global $mosConfig_lang, $_JOOMFISH_MANAGER; if ($language === null) { $language = $mosConfig_lang; } $object = $this->_db->loadObject(); if ($translate && isset($_JOOMFISH_MANAGER)) { $doTranslate = false; $tables = $this->_getRefTables(); foreach ($tables["fieldTablePairs"] as $i => $table) { if ($this->translatedContentAvailable($table)) { $doTranslate = true; break; } } if ($doTranslate) { JoomFish::translate($object, $this->_getTableName(), $language, $this->_getRefTables()); } } return $object; }