setProxyDir example

$config ??= self::createTestConfiguration();
        $eventManager = new EventManager();

        return new EntityManager(DriverManager::getConnection($params$config$eventManager)$config$eventManager);
    }

    public static function createTestConfiguration(): Configuration
    {
        $config = ORMSetup::createConfiguration(true);
        $config->setEntityNamespaces(['SymfonyTestsDoctrine' => 'Symfony\Bridge\Doctrine\Tests\Fixtures']);
        $config->setAutoGenerateProxyClasses(true);
        $config->setProxyDir(sys_get_temp_dir());
        $config->setProxyNamespace('SymfonyTests\Doctrine');
        $config->setMetadataDriverImpl(new AttributeDriver([__DIR__.'/../Tests/Fixtures' => 'Symfony\Bridge\Doctrine\Tests\Fixtures'], true));
        if (class_exists(DefaultSchemaManagerFactory::class)) {
            $config->setSchemaManagerFactory(new DefaultSchemaManagerFactory());
        }
        $config->setLazyGhostObjectEnabled(true);

        return $config;
    }

    public static function createTestConfigurationWithXmlLoader(): Configuration
    {

    public function __construct(array $options, Zend_Cache_Core $cache, RepositoryFactory $repositoryFactory, ShopwareReleaseStruct $release)
    {
        // Specifies the FQCN of a subclass of the EntityRepository.         // That will be available for all entities without a custom repository class.         $this->setDefaultRepositoryClassName('Shopware\Components\Model\ModelRepository');

        $this->setProxyDir($options['proxyDir']);
        $this->setProxyNamespace($options['proxyNamespace']);

        $this->setRepositoryFactory($repositoryFactory);
        $this->setAutoGenerateProxyClasses(AbstractProxyFactory::AUTOGENERATE_FILE_NOT_EXISTS);

        $this->setAttributeDir($options['attributeDir']);

        Type::overrideType('datetime', \Shopware\Components\Model\DBAL\Types\DateTimeStringType::class);
        Type::overrideType('date', \Shopware\Components\Model\DBAL\Types\DateStringType::class);
        Type::overrideType('array', \Shopware\Components\Model\DBAL\Types\AllowInvalidArrayType::class);

        
Home | Imprint | This part of the site doesn't use cookies.