[2.0] Adding EntityRepository::createQueryBuilder() method
This commit is contained in:
parent
02519233f3
commit
b353dc5172
@ -32,6 +32,7 @@ namespace Doctrine\ORM;
|
||||
* @link www.doctrine-project.org
|
||||
* @since 2.0
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||||
*/
|
||||
class EntityRepository
|
||||
{
|
||||
@ -52,6 +53,19 @@ class EntityRepository
|
||||
$this->_class = $class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new QueryBuilder instance that is prepopulated for this entity name
|
||||
*
|
||||
* @param string $alias
|
||||
* @return QueryBuilder $qb
|
||||
*/
|
||||
public function createQueryBuilder($alias)
|
||||
{
|
||||
return $this->_em->createQueryBuilder()
|
||||
->select($alias)
|
||||
->from($this->_entityName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the repository, causing all managed entities to become detached.
|
||||
*/
|
||||
|
@ -38,6 +38,7 @@ use Doctrine\Common\DoctrineException;
|
||||
* the serialized representation).
|
||||
*
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
final class ClassMetadata extends ClassMetadataInfo
|
||||
|
@ -38,6 +38,7 @@ use Doctrine\Common\DoctrineException;
|
||||
* the serialized representation).
|
||||
*
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
class ClassMetadataInfo
|
||||
|
Loading…
x
Reference in New Issue
Block a user