Der AnnotationDriver für Doctrine, Psc, Whatever

@return Doctrine\ORM\Mapping\Driver\AnnotationDriver
766481
public function getAnnotationDriver() {
    if (!isset($this->annotationDriver)) {
      $this->annotationDriver = new AnnotationDriver($this->getDefaultAnnotationReader(),
                                                     array((string) $this->getEntitiesPath())
                                                    );
    }
    
    return $this->annotationDriver;
  }
650757
public function bootstrap($bootFlags = 0x000000) {
    if (!isset($this->configuration))
      $this->configuration = new Configuration();
    
    /* Custom Functions */
    $this->configuration->addCustomDatetimeFunction('month', 'Psc\Doctrine\Functions\Month');
    $this->configuration->addCustomDatetimeFunction('year', 'Psc\Doctrine\Functions\Year');
    $this->configuration->addCustomDatetimeFunction('day', 'Psc\Doctrine\Functions\Day');
    $this->configuration->addCustomStringFunction('soundex', 'Psc\Doctrine\Functions\Soundex');

    /* Annotations */
    // Register the ORM Annotations in the AnnotationRegistry
    AnnotationRegistry::registerFile(
      $this->project->dir('vendor')->getFile('doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php')
    );

    \Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('chainable');

    if (!isset($this->driverChain))
      $this->driverChain = new MappingDriverChain();

    $this->driverChain->addDriver(
      $this->getAnnotationDriver(),
      $this->entitiesNamespace
    );
    $this->configuration->setMetadataDriverImpl($this->driverChain);

    // Metadatadriver für einzelne Entities
    $this->registerEntityClassesMetadataDriver(array(), 'Psc', $this->getDefaultAnnotationReader());      
    
    /* Ci-Ca-Caches */
    if (($cache = $this->project->getConfiguration()->get('doctrine.cache')) != NULL) {
      $this->useCache($cache);
    }
    $this->configuration->setMetadataCacheImpl($this->getCache());
    $this->configuration->setQueryCacheImpl($this->getCache());
    $this->configuration->setResultCacheImpl($this->getResultCache()); // das ist wichtig, damit dieselben abfragen pro result gecached werden
    
    $this->configuration->setProxyDir($this->project->dir('cache')->sub('Proxies/')->create());
    $this->configuration->setProxyNamespace('Proxies');
    $this->configuration->setAutoGenerateProxyClasses(TRUE);
    
    $this->registerDefaultTypes();
    $this->registerCustomTypes();
    
    $this->dispatchBootstrapped();
    
    return $this;
  }
156495
public function newDefaultAnnotationDriver(array $paths = []) : AnnotationDriver
    {
        AnnotationRegistry::registerFile(__DIR__ . '/Annotation/DoctrineAnnotations.php');

        $reader = new CachedReader(new AnnotationReader(), new ArrayCache());

        return new AnnotationDriver($reader, $paths);
    }
195166
public function setDriver($driver)
    {
        $class = $this->wei->getClass($driver);

        if (!class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('Cache driver class "%s" not found', $class));
        }

        if (!is_subclass_of($class, 'Wei\BaseCache')) {
            throw new \InvalidArgumentException(sprintf('Cache driver class "%s" must extend "Wei\BaseCache"', $class));
        }

        $this->driver = $driver;
        $this->object = $this->wei->get($driver);
        return $this;
    }
1226947
public function getCLIApplication()
    {
        $application = new Application('Doctrine Manager Builder Command Line Interface');
        $application->setCatchExceptions(true);

        foreach ($this->builders as $builder) {
            foreach ($builder->getConsoleCommands() as $command) {
                $helperSet = $command->getHelperSet();

                $application->add($command)->setHelperSet($helperSet);
            }
        }

        $this->registerGlobalAnnotationLoader();

        return $application;
    }
79911
public function getMetadataDriverImpl()
    {
        if (!isset($this->attributes['concreteMetadataDriver'])) {
            $this->attributes['concreteMetadataDriver'] = $this->newDefaultAnnotationDriver();
        }

        return $this->attributes['concreteMetadataDriver'];
    }
43879
public function getEntityManager()
    {
        if (!isset($this->_entityManager)) {
            $this->_entityManager = $this->getServiceLocator()
                    ->get('Doctrine\ORM\EntityManager');
        }
        return $this->_entityManager;
    }
838180
public function createDriver() : Driver
    {
        $classname = '\ntentan\atiaa\drivers\\'.Text::ucamelize($this->config['driver']).'Driver';

        return new $classname($this->config);
    }
489778
public function getSessionDriver()
    {
        if (null == $this->sessionDriver) {
            $this->setSessionDriver(Application::container()->get('session'));
        }
        return $this->sessionDriver;
    }
434591
private function addDriverInDriverChain(
        ContainerBuilder $container,
        EntityMapping $entityMapping
    ) {
        $chainDriverDefinition = $container
            ->getDefinition(
                'doctrine.orm.' . $entityMapping->getEntityManagerName() . '_metadata_driver'
            );

        $container->setParameter(
            'doctrine.orm.metadata.driver_chain.class',
            'Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain'
        );

        $chainDriverDefinition->addMethodCall('addDriver', [
            new Reference(
                'doctrine.orm.' . $entityMapping->getUniqueIdentifier() . '_metadata_driver'
            ),
            $entityMapping->getEntityNamespace(),
        ]);
    }
1093663
public function getDriver()
    {
        if ($this->driver === null) {
            $this->driver = $this->getPDO()->getAttribute(PDO::ATTR_DRIVER_NAME);
        }

        return $this->driver;
    }
1105061
public function getDoctrineConnection()
    {
        $driver = $this->getDoctrineDriver();

        $data = array('pdo' => $this->pdo, 'dbname' => $this->getConfig('database'));

        return new DoctrineConnection($data, $driver);
    }
187535
public function getDriver() {
        if ($this->_driver) {
            return $this->_driver;
        }

        return $this->_driver = $this->getDatabase()->getDriver($this->getConnectionKey());
    }
236149
public function getDriver()
    {
        if(!$this->__driver instanceof DatabaseDriverInterface)
        {
            $this->__driver = $this->getObject($this->__driver);

            if(!$this->__driver instanceof DatabaseDriverInterface)
            {
                throw new \UnexpectedValueException(
                    'Driver: '.get_class($this->__driver).' does not implement DatabaseDriverInterface'
                );
            }
        }

        return $this->__driver;
    }
1237641
public function getDriverManager(): Interfaces\JavaObject
    {
        if ($this->driverManager === null) {
            $this->driverManager = $this->ba->javaClass('java.sql.DriverManager');
        }

        return $this->driverManager;
    }
1185757
public function getDoctrineConnection()
    {
        if (is_null($this->doctrineConnection)) {
            $data                     = ['pdo' => $this->getPdo(), 'user' => $this->getConfig('username')];
            $this->doctrineConnection = new DoctrineConnection(
                $data,
                $this->getDoctrineDriver()
            );
        }

        return $this->doctrineConnection;
    }
1069837
public function getDefaultDriverClass()
    {
        $oDriver          = $this->getDefaultDriver();
        $sDriverNamespace = ArrayHelper::getFromArray('namespace', (array) $oDriver->data);
        $sDriverClass     = ArrayHelper::getFromArray('class', (array) $oDriver->data);
        return '\\' . $sDriverNamespace . $sDriverClass;
    }