Start your All-Access Pass to unlock this challenge
Check out this sweet Category
entity:
class Category
{
// ..
#[OneToMany(targetEntity: Product::class, fetch: 'EXTRA_LAZY')
private Collection $products;
}
Imagine you query for a Category
(with no joins) and pass it into this template:
<h1>{{ category.name }}</h1>
Product Count: {{ category.products|length }}
<ul>
{% for product in category.products %}
<li>{{ product.name }}</li>
{% endfor %}
</ul>
How many total queries will this page make?
Hint: Don't forget to count the 1 initial query for the Category
entity!