/** Get all fields * @return an array of ProfileField (realized ProfileTemplateField) or an empty array. * The array id is the template field used for the ProfileField */ function getFields() { $db = AbstractDb::getObject(); // Init values $retval = array(); $field_rows = null; $sql = "SELECT profile_field_id, profile_template_field_id FROM profile_fields NATURAL JOIN profile_template_fields WHERE profile_id = '{$this->getId()}' ORDER BY display_order"; $db->execSql($sql, $field_rows, false); if ($field_rows != null) { foreach ($field_rows as $field_row) { $retval[$field_row['profile_template_field_id']] = ProfileField::getObject($field_row['profile_field_id']); } } return $retval; }