Created
March 26, 2014 16:30
-
-
Save jmolivas/9787399 to your computer and use it in GitHub Desktop.
Entity repository extract
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param integer $id | |
* | |
* @return array | |
*/ | |
public function findBySomething($id) | |
{ | |
$queryBuilder = $this->queryBySomething($id); | |
return $queryBuilder->getQuery()->getResult(); | |
} | |
/** | |
* @param integer $teamId | |
* | |
* @return Doctrine\ORM\QueryBuilder | |
*/ | |
public function queryBySomething($id) | |
{ | |
$queryBuilder = $this->getEntityManager()->createQueryBuilder() | |
->select('') | |
->from('', '') | |
->where('something.team = :id') | |
->setParameter('id', $id); | |
return $queryBuilder; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment