diff --git a/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php b/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php index 6d2687c5e..ddf6a62b3 100644 --- a/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php +++ b/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php @@ -129,6 +129,27 @@ public static function createAnnotationMappingDriver(array $namespaces, array $d return new DoctrineOrmMappingsPass($driver, $namespaces, $managerParameters, $enabledParameter, $aliasMap); } + /** + * @param string[] $namespaces List of namespaces that are handled with annotation mapping + * @param string[] $directories List of directories to look for annotated classes + * @param string[] $managerParameters List of parameters that could which object manager name + * your bundle uses. This compiler pass will automatically + * append the parameter name for the default entity manager + * to this list. + * @param string|false $enabledParameter Service container parameter that must be present to + * enable the mapping. Set to false to not do any check, + * optional. + * @param string[] $aliasMap Map of alias to namespace. + * + * @return self + */ + public static function createAttributeMappingDriver(array $namespaces, array $directories, array $managerParameters = [], $enabledParameter = false, array $aliasMap = []) + { + $driver = new Definition('Doctrine\ORM\Mapping\Driver\AttributeDriver', [$directories]); + + return new DoctrineOrmMappingsPass($driver, $namespaces, $managerParameters, $enabledParameter, $aliasMap); + } + /** * @param string[] $namespaces List of namespaces that are handled with static php mapping * @param string[] $directories List of directories to look for static php mapping files