-
-
Notifications
You must be signed in to change notification settings - Fork 461
Open
Description
Bug Report
Not sure if i should put it here or into doctrine/orm as it seems like compatibility problem.
Q | A |
---|---|
doctrine\doctrine-bundle | 2.13.1 |
doctrine\orm | 3.3.0 |
Summary
We have a private bundle, that we're reusing on multiple projects. This bundle provides some entities with mapping. Within this bundle we're calling DoctrineOrmMappingsPass to register bundle's entities mapping:
$container->addCompilerPass(DoctrineOrmMappingsPass::createAttributeMappingDriver($namespaces, $directories));
Current behavior
Currently app crashes hard with \InvalidArgumentException
The $reportFieldsWhereDeclared argument is no longer supported, make sure to omit it when calling Doctrine\ORM\Mapping\Driver\AttributeDriver::__construct.
Expected behavior
It probably should not crash)
As soon as its going to be omitted by doctrine\orm we would like to avoid pass reportFieldsWhereDeclared from bundle.
How to reproduce
Its quite simple:
- doctrine/orm version > 3
- latest doctrine/doctrine-bundle
- call DoctrineOrmMappingsPass to add mapping by attributes - for example like following:
namespace My\CustomBundle;
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class MyCustomBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
$namespaces = [
'My\CustomBundle\Model',
];
$directories = [
__DIR__ . '/src/Model',
];
$container->addCompilerPass(DoctrineOrmMappingsPass::createAttributeMappingDriver($namespaces, $directories));
}
}
greg0ire, cfoehrdes and kingjia90
Metadata
Metadata
Assignees
Labels
No labels