public function prepend(ContainerBuilder $container)
    {
        $configs = $container->getExtensionConfig($this->getAlias());
        $config = $this->processConfiguration(new Configuration(), $configs);

        $parameters = $this->getParameters($config);
        foreach ($parameters as $key => $value) {
            $container->setParameter($key, $value);
        }

        $resolvableEntities = [
            'Opifer\EavBundle\Model\AttributeInterface' => $config['attribute_class'],
            'Opifer\EavBundle\Model\OptionInterface'    => $config['option_class'],
            'Opifer\EavBundle\Model\SchemaInterface'  => $config['schema_class'],
            'Opifer\EavBundle\Model\ValueSetInterface'  => $config['valueset_class'],
        ];

        if ($config['nestable_class'] != '') {
            $resolvableEntities['Opifer\EavBundle\Model\Nestable'] = $config['nestable_class'];
        }

        if ($config['media_class'] != '') {
            $resolvableEntities['Opifer\EavBundle\Model\MediaInterface'] = $config['media_class'];
        }

        foreach ($container->getExtensions() as $name => $extension) {
            switch ($name) {
                case 'doctrine':
                    $container->prependExtensionConfig($name,  [
                        'orm' => [
                            'resolve_target_entities' => $resolvableEntities,
                        ],
                    ]);
                    break;
            }
        }
    }