Doctrine\ORM\EntityRepository
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.
- Author: Benjamin Eberlei <kontakt@beberlei.de>
Synopsis
class EntityRepository
implements
ObjectRepository,Selectable
{
- // members
- protected string $_entityName;
- protected EntityManager $_em;
- protected ClassMetadata $_class;
- // methods
- public void __construct()
- public QueryBuilder createQueryBuilder()
- public Query createNamedQuery()
- public NativeQuery createNativeNamedQuery()
- public void clear()
- public find()
- public array findAll()
- public array findBy()
- public findOneBy()
- public array|object __call()
- protected string getEntityName()
- public string getClassName()
- protected EntityManager getEntityManager()
- protected ClassMetadata getClassMetadata()
- public Collection matching()
Hierarchy
Members
protected
- $_class — \Doctrine\ORM\Mapping\ClassMetadata
- $_em — Doctrine\ORM\EntityManager
- $_entityName — string
Methods
protected
public
- __construct() — Initializes a new <tt>EntityRepository</tt>.
- __call() — Adds support for magic finders.
- clear() — Clears the repository, causing all managed entities to become detached.
- createNamedQuery() — Create a new Query instance based on a predefined metadata named query.
- createNativeNamedQuery() — Creates a native SQL query.
- createQueryBuilder() — Create a new QueryBuilder instance that is prepopulated for this entity name
- find() — Finds an entity by its primary key / identifier.
- findAll() — Finds all entities in the repository.
- findBy() — Finds entities by a set of criteria.
- findOneBy() — Finds a single entity by a set of criteria.
- getClassName()
- matching() — Select all elements from a selectable that match the expression and return a new collection containing these elements.