Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctrine-orm-2.9 #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ and the possiblity to install only the needed vendors make the difference to the

* [doctrine/dbal][20]: ^2.11
* [doctrine/mongodb-odm][21]: ^2.1.2
* [doctrine/orm][22]: ^2.7.3
* [doctrine/orm][22]: ^2.9.1
* [mongodb/mongodb][23]: ^1.5.2

## Installation

Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-laminas-config-doctrine][1].

```sh
composer require chubbyphp/chubbyphp-laminas-config-doctrine "^1.2"
composer require chubbyphp/chubbyphp-laminas-config-doctrine "^1.3"
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"conflict": {
"doctrine/dbal": "<2.11 || >=3.0",
"doctrine/mongodb-odm": "<2.1.2 || >=3.0",
"doctrine/orm": "<2.7.3 || >=2.9",
"doctrine/orm": "<2.9.1 || >=3.0",
"mongodb/mongodb": "<1.5.2 || >=2.0"
},
"autoload": {
Expand All @@ -61,7 +61,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
"dev-master": "1.3-dev"
}
},
"scripts": {
Expand Down
61 changes: 0 additions & 61 deletions src/ORM/Tools/Console/Command/EntityManagerCommand.php

This file was deleted.

25 changes: 25 additions & 0 deletions src/ORM/Tools/Console/EntityManagerProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console;

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Console\EntityManagerProvider as DoctrineEntityManagerProvider;
use Psr\Container\ContainerInterface;

final class EntityManagerProvider implements DoctrineEntityManagerProvider
{
private ContainerInterface $container;

public function getDefaultManager(): EntityManagerInterface
{
return $this->container->get(EntityManager::class);
}

public function getManager(string $name): EntityManagerInterface
{
return $this->container->get(EntityManager::class.$name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command\ClearCache;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\ClearCache\CollectionRegionCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class CollectionRegionCommandFactory
final class CollectionRegionCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): CollectionRegionCommand
{
return new EntityManagerCommand(new CollectionRegionCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new CollectionRegionCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command\ClearCache;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\ClearCache\EntityRegionCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class EntityRegionCommandFactory
final class EntityRegionCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): EntityRegionCommand
{
return new EntityManagerCommand(new EntityRegionCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new EntityRegionCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command\ClearCache;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class MetadataCommandFactory
final class MetadataCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): MetadataCommand
{
return new EntityManagerCommand(new MetadataCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new MetadataCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command\ClearCache;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class QueryCommandFactory
final class QueryCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): QueryCommand
{
return new EntityManagerCommand(new QueryCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new QueryCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command\ClearCache;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryRegionCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class QueryRegionCommandFactory
final class QueryRegionCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): QueryRegionCommand
{
return new EntityManagerCommand(new QueryRegionCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new QueryRegionCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command\ClearCache;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class ResultCommandFactory
final class ResultCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): ResultCommand
{
return new EntityManagerCommand(new ResultCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new ResultCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\EntityManagerProviderFactory;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class ConvertMappingCommandFactory
final class ConvertMappingCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): ConvertMappingCommand
{
return new EntityManagerCommand(new ConvertMappingCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new ConvertMappingCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\EntityManagerProviderFactory;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class EnsureProductionSettingsCommandFactory
final class EnsureProductionSettingsCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): EnsureProductionSettingsCommand
{
return new EntityManagerCommand(new EnsureProductionSettingsCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new EnsureProductionSettingsCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class GenerateProxiesCommandFactory
final class GenerateProxiesCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): GenerateProxiesCommand
{
return new EntityManagerCommand(new GenerateProxiesCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new GenerateProxiesCommand($entityManagerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@

namespace Chubbyphp\Laminas\Config\Doctrine\ServiceFactory\ORM\Tools\Console\Command;

use Chubbyphp\Laminas\Config\Doctrine\ORM\Tools\Console\Command\EntityManagerCommand;
use Chubbyphp\Laminas\Config\Factory\AbstractFactory;
use Doctrine\ORM\Tools\Console\Command\InfoCommand;
use Doctrine\ORM\Tools\Console\EntityManagerProvider;
use Psr\Container\ContainerInterface;

final class InfoCommandFactory
final class InfoCommandFactory extends AbstractFactory
{
public function __invoke(ContainerInterface $container): EntityManagerCommand
public function __invoke(ContainerInterface $container): InfoCommand
{
return new EntityManagerCommand(new InfoCommand(), $container);
/** @var EntityManagerProvider $entityManagerProvider */
$entityManagerProvider = $this->resolveDependency(
$container,
EntityManagerProvider::class,
EntityManagerProviderFactory::class
);

return new InfoCommand($entityManagerProvider);
}
}
Loading