private static function addCustomFunctions(Configuration $config, array $options = array())
    {
        if (null !== $strFcts = Collection::get($options, 'orm:entity_managers:default:dql:string_functions')) {
            foreach ($strFcts as $name => $class) {
                if (class_exists($class)) {
                    $config->addCustomStringFunction($name, $class);
                }
            }
        }

        if (null !== $numFcts = Collection::get($options, 'orm:entity_managers:default:dql:numeric_functions')) {
            foreach ($numFcts as $name => $class) {
                if (class_exists($class)) {
                    $config->addCustomNumericFunction($name, $class);
                }
            }
        }

        if (null !== $datetimeFcts = Collection::get($options, 'orm:entity_managers:default:dql:datetime_functions')) {
            foreach ($datetimeFcts as $name => $class) {
                if (class_exists($class)) {
                    $config->addCustomDatetimeFunction($name, $class);
                }
            }
        }

        return $config;
    }