private static function calculates_average_notes(Notation $notation) { try { $result = self::$db_querier->select_rows(DB_TABLE_NOTE, array('note'), 'WHERE module_name=:module_name AND id_in_module=:id_in_module', array('module_name' => $notation->get_module_name(), 'id_in_module' => $notation->get_id_in_module())); $notes = 0; while ($row = $result->fetch()) { $notes += $row['note']; } return round($notes / $result->get_rows_count() / 0.25) * 0.25; } catch (RowNotFoundException $e) { return 0; } }