Changed instances of entity manager variable '' to '' for consistency.
This commit is contained in:
parent
511268ddd7
commit
3cac853dd4
@ -975,7 +975,7 @@ can rewrite our code:
|
|||||||
<?php
|
<?php
|
||||||
$dql = "SELECT b, e, r, p FROM Bug b JOIN b.engineer e ".
|
$dql = "SELECT b, e, r, p FROM Bug b JOIN b.engineer e ".
|
||||||
"JOIN b.reporter r JOIN b.products p ORDER BY b.created DESC";
|
"JOIN b.reporter r JOIN b.products p ORDER BY b.created DESC";
|
||||||
$query = $em->createQuery($dql);
|
$query = $entityManager->createQuery($dql);
|
||||||
$bugs = $query->getArrayResult();
|
$bugs = $query->getArrayResult();
|
||||||
|
|
||||||
foreach ($bugs AS $bug) {
|
foreach ($bugs AS $bug) {
|
||||||
@ -1116,7 +1116,7 @@ grouped by product:
|
|||||||
<?php
|
<?php
|
||||||
$dql = "SELECT p.id, p.name, count(b.id) AS openBugs FROM Bug b ".
|
$dql = "SELECT p.id, p.name, count(b.id) AS openBugs FROM Bug b ".
|
||||||
"JOIN b.products p WHERE b.status = 'OPEN' GROUP BY p.id";
|
"JOIN b.products p WHERE b.status = 'OPEN' GROUP BY p.id";
|
||||||
$productBugs = $em->createQuery($dql)->getScalarResult();
|
$productBugs = $entityManager->createQuery($dql)->getScalarResult();
|
||||||
|
|
||||||
foreach($productBugs as $productBug) {
|
foreach($productBugs as $productBug) {
|
||||||
echo $productBug['name']." has " . $productBug['openBugs'] . " open bugs!\n";
|
echo $productBug['name']." has " . $productBug['openBugs'] . " open bugs!\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user