/**
  * @param ContainerInterface $container
  * @return DoctrineAutodiscoveryModel
  */
 public function __invoke(ContainerInterface $container)
 {
     if (!$container->has('config')) {
         throw new ServiceNotCreatedException(sprintf('Cannot create %s service because config service is not present', DoctrineAutodiscoveryModel::class));
     }
     $instance = new DoctrineAutodiscoveryModel($container->get('config'));
     $instance->setServiceLocator($container);
     return $instance;
 }