[DDC-2055] Add EntityRepository#createResultSetMappingBuilder()
This commit is contained in:
parent
17bb564534
commit
941670aa9d
1 changed files with 18 additions and 0 deletions
|
@ -19,6 +19,8 @@
|
|||
|
||||
namespace Doctrine\ORM;
|
||||
|
||||
use Doctrine\ORM\Query\ResultSetMappingBuilder;
|
||||
|
||||
use Doctrine\DBAL\LockMode;
|
||||
use Doctrine\Common\Persistence\ObjectRepository;
|
||||
|
||||
|
@ -82,6 +84,22 @@ class EntityRepository implements ObjectRepository, Selectable
|
|||
->from($this->_entityName, $alias);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new result set mapping builder for this entity.
|
||||
*
|
||||
* The column naming strategy is "INCREMENT".
|
||||
*
|
||||
* @param string $alias
|
||||
* @return ResultSetMappingBuilder
|
||||
*/
|
||||
public function createResultSetMappingBuilder($alias)
|
||||
{
|
||||
$rsm = new ResultSetMappingBuilder($this->_em, ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT);
|
||||
$rsm->addRootEntityFromClassMetadata($this->_entityName, $alias);
|
||||
|
||||
return $rsm;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Query instance based on a predefined metadata named query.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue