| Methods |
public
|
__construct(EntityManagerInterface $em, ClassMetadata<T> $class)
|
#
|
public
|
createQueryBuilder(string $alias, string|null $indexBy = null): QueryBuilder
Creates a new QueryBuilder instance that is prepopulated for this entity name.
Creates a new QueryBuilder instance that is prepopulated for this entity name.
Parameters
| $indexBy |
The index for the from.
|
|
#
|
public
|
createResultSetMappingBuilder(string $alias): ResultSetMappingBuilder
Creates a new result set mapping builder for this entity.
Creates a new result set mapping builder for this entity.
The column naming strategy is "INCREMENT".
|
#
|
public
|
createNamedQuery(string $queryName): Query
Creates a new Query instance based on a predefined metadata named query.
Creates a new Query instance based on a predefined metadata named query.
|
#
|
public
|
createNativeNamedQuery(string $queryName): NativeQuery
Creates a native SQL query.
Creates a native SQL query.
|
#
|
public
|
clear(): void
Clears the repository, causing all managed entities to become detached.
Clears the repository, causing all managed entities to become detached.
Deprecated
2.8 This method is being removed from the ORM and won't have any replacement
|
#
|
public
|
find(mixed $id, LockMode::*|null $lockMode = null, int|null $lockVersion = null): object|null
Finds an entity by its primary key / identifier.
Finds an entity by its primary key / identifier.
Parameters
| $id |
The identifier.
|
| $lockVersion |
The lock version.
|
Returns
The entity instance or NULL if the entity can not be found.
Overriden by
Implements
|
#
|
public
|
findAll()
Finds all entities in the repository.
Finds all entities in the repository.
Returns
Overriden by
Implements
|
#
|
public
|
findBy(
array<string, mixed> $criteria,
array<string, string>|null $orderBy = null,
int|null $limit = null,
int|null $offset = null,
): object[]
Finds entities by a set of criteria.
Finds entities by a set of criteria.
Returns
Overriden by
Implements
|
#
|
public
|
findOneBy(array<string, mixed> $criteria, array<string, string>|null $orderBy = null): object|null
Finds a single entity by a set of criteria.
Finds a single entity by a set of criteria.
Parameters
Returns
The entity instance or NULL if the entity can not be found.
Overriden by
Implements
|
#
|
public
|
count(array<string, mixed> $criteria): int
Counts entities by a set of criteria.
Counts entities by a set of criteria.
Returns
The cardinality of the objects that match the given criteria.
|
#
|
public
|
__call(string $method, list<mixed> $arguments): mixed
Adds support for magic method calls.
Adds support for magic method calls.
Returns
The returned value from the resolved method.
Throws
|
#
|
protected
|
getEntityName(): string
|
#
|
public
|
getClassName()
{@inheritDoc}
|
#
|
protected
|
getEntityManager(): EntityManagerInterface
|
#
|
protected
|
getClassMetadata(): ClassMetadata
|
#
|
public
|
matching(Criteria $criteria): AbstractLazyCollection
Select all elements from a selectable that match the expression and
return a new collection containing these elements.
Select all elements from a selectable that match the expression and
return a new collection containing these elements.
Implements
|
#
|
private
|
resolveMagicCall(string $method, string $by, list<mixed> $arguments): mixed
Resolves a magic method call to the proper existent method at `EntityRepository`.
Resolves a magic method call to the proper existent method at EntityRepository.
Parameters
| $method |
The method to call
|
| $by |
The property name used as condition
|
| $arguments |
The arguments to pass at method call
|
Throws
|
#
|