protected static function _getJeaRowIfExists($tableName = '', $fieldName = '', $fieldValue = '') { if (self::$_tables == null) { $db = JFactory::getDbo(); self::$_tables = array('amenities' => array(), 'areas' => array(), 'conditions' => array(), 'departments' => array(), 'heatingtypes' => array(), 'hotwatertypes' => array(), 'properties' => array(), 'slogans' => array(), 'towns' => array(), 'types' => array()); foreach (self::$_tables as $tableName => $value) { // Get all JEA datas $db->setQuery('SELECT * FROM #__jea_' . $tableName); self::$_tables[$tableName] = $db->loadObjectList('id'); } } if (empty(self::$_tables[$tableName]) || empty($fieldName) || empty($fieldValue)) { return false; } foreach (self::$_tables[$tableName] as $row) { if (!isset($row->{$fieldName})) { return false; } if ($row->{$fieldName} == $fieldValue) { return $row; } } return false; }