EntityRepository
public class EntityRepository
www.doctrine-project.org
Field Summary | |
---|---|
protected Doctrine\ORM\Mapping\ClassMetadata | |
protected EntityManager | |
protected string |
Constructor Summary | |
---|---|
EntityRepository(EntityManager em, mixed class, ClassMetadata classMetadata) Initializes a new EntityRepository. |
Method Summary | |
---|---|
void | clear() Clears the repository, causing all managed entities to become detached. |
QueryBuilder | createQueryBuilder(string alias) Create a new QueryBuilder instance that is prepopulated for this entity name |
object | find(mixed id, $id The, int hydrationMode) Finds an entity by its primary key / identifier. |
array | findAll(int hydrationMode) Finds all entities in the repository. |
array | findBy(mixed criteria, string column, string value) Finds entities by a set of criteria. |
object | findOneBy(mixed criteria, string column, string value) Finds a single entity by a set of criteria. |
protected Doctrine\ORM\Mapping\ClassMetadata $_class
protected EntityManager $_em
protected string $_entityName
public EntityRepository(EntityManager em, mixed class, ClassMetadata classMetadata)
Initializes a new EntityRepository.
public void clear()
Clears the repository, causing all managed entities to become detached.
public QueryBuilder createQueryBuilder(string alias)
Create a new QueryBuilder instance that is prepopulated for this entity name
public object find(mixed id, $id The, int hydrationMode)
Finds an entity by its primary key / identifier.
public array findAll(int hydrationMode)
Finds all entities in the repository.
public array findBy(mixed criteria, string column, string value)
Finds entities by a set of criteria.
public object findOneBy(mixed criteria, string column, string value)
Finds a single entity by a set of criteria.
An EntityRepository serves as a repository for entities with generic as well as business specific methods for retrieving entities.
This class is designed for inheritance and users can subclass this class to write their own repositories with business-specific methods to locate entities.