DefaultRepositoryFactory
in package
implements
RepositoryFactory
FinalYes
This factory is used to create default repository objects for entities at runtime.
Table of Contents
Interfaces
- RepositoryFactory
- Interface for entity repository factory.
Properties
- $repositoryList : array<string|int, ObjectRepository>
- The list of EntityRepository instances.
Methods
- getRepository() : ObjectRepository<string|int, T>
- Gets the repository for an entity class.
- createRepository() : ObjectRepository
- Create a new repository instance for an entity class.
Properties
$repositoryList
The list of EntityRepository instances.
private
array<string|int, ObjectRepository>
$repositoryList
= []
Tags
Methods
getRepository()
Gets the repository for an entity class.
public
getRepository(EntityManagerInterface $entityManager, mixed $entityName) : ObjectRepository<string|int, T>
Parameters
- $entityManager : EntityManagerInterface
-
The EntityManager instance.
- $entityName : mixed
-
The name of the entity.
Return values
ObjectRepository<string|int, T> —This type will change to EntityRepository in 3.0.
createRepository()
Create a new repository instance for an entity class.
private
createRepository(EntityManagerInterface $entityManager, string $entityName) : ObjectRepository
Parameters
- $entityManager : EntityManagerInterface
-
The EntityManager instance.
- $entityName : string
-
The name of the entity.