Skip to content

Commit

Permalink
Allow to register AttributeDriver via DoctrineOrmMappingsPass
Browse files Browse the repository at this point in the history
  • Loading branch information
norkunas authored and ostrolucky committed Jun 3, 2021
1 parent 2a4f32d commit a112868
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions DependencyInjection/Compiler/DoctrineOrmMappingsPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a112868

Please sign in to comment.