Skip to content

Commit

Permalink
Add the get singleOrNull, get ScalarResult, etc..
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Beaujean committed Apr 15, 2015
1 parent 7bb17ac commit 9babf2d
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Resources/views/Generator/TopRepositoryTemplate.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,68 @@ class {{ tableName }}Repository extends EntityRepository
return $results;
}
/**
* Get the SingleResult of the query builder
*
* @return unknown The results
*/
public static function getQueryBuilderSingleResult(QueryBuilder $qb)
{
$query = $qb->getQuery();
$results = $query->getSingleResult();
return $results;
}
/**
* Get the OneOrNullResult of the query builder
*
* @return unknown The results
*/
public static function getQueryBuilderOneOrNullResult(QueryBuilder $qb)
{
$query = $qb->getQuery();
$results = $query->getOneOrNullResult();
return $results;
}
/**
* Get the getArrayResult of the query builder
*
* @return unknown The results
*/
public static function getQueryBuilderArrayResult(QueryBuilder $qb)
{
$query = $qb->getQuery();
$results = $query->getArrayResult();
return $results;
}
/**
* Get the ScalarResult of the query builder
*
* @return unknown The results
*/
public static function getQueryBuilderScalarResult(QueryBuilder $qb)
{
$query = $qb->getQuery();
$results = $query->getScalarResult();
return $results;
}
/**
* Get the SingleScalarResult of the query builder
*
* @return unknown The results
*/
public static function getQueryBuilderSingleScalarResult(QueryBuilder $qb)
{
$query = $qb->getQuery();
$results = $query->getSingleScalarResult();
return $results;
}

0 comments on commit 9babf2d

Please sign in to comment.