DefaultRepositoryFactory
in package
implements
RepositoryFactory
This factory is used to create default repository objects for entities at runtime.
Interfaces, Classes, Traits and Enums
- RepositoryFactory
- Interface for entity repository factory.
Table of Contents
- $repositoryList : array<string|int, ObjectRepository>
- The list of EntityRepository instances.
- getRepository() : ObjectRepository
- 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
= []
Methods
getRepository()
Gets the repository for an entity class.
public
getRepository(EntityManagerInterface $entityManager, mixed $entityName) : ObjectRepository
Parameters
- $entityManager : EntityManagerInterface
-
The EntityManager instance.
- $entityName : mixed
-
The name of the entity.
Return values
ObjectRepository —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.