public function normalizeName($name, $separator = '_')
    {
        if (strlen($separator) == 0) {
            return preg_replace('|[^a-z0-9]|i', '', $name);
        }

        $s = $separator[0];
        $name = preg_replace('|[^a-z0-9\\'.$s.']|i', $s, $name);
        $name = trim($name, $s);
        $name = preg_replace('|\\'.$s.'{2,}|', $s, $name);

        return $name;
    }