All quizzes
Free quiz · 20 questions in the bank

Doctrine quiz

Test your Doctrine knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What is a reasonable justification for using DQL (or the QueryBuilder) rather than writing raw SQL directly, even though Doctrine also allows executing raw SQL when needed?

Questions in this quiz
  1. What is a reasonable justification for using DQL (or the QueryBuilder) rather than writing raw SQL directly, even though Doctrine also allows executing raw SQL when needed?
  2. What is the "EntityManager" in Doctrine, and what is its role?
  3. What is the purpose of the `#[ORM\Id]` and `#[ORM\GeneratedValue]` attributes typically applied to an entity's primary key property?
  4. What is a Doctrine "entity"?
  5. What is "lazy loading" in the context of Doctrine associations, and what problem does it help address?
  6. What is a reasonable comparison between Doctrine and Eloquent (Laravel's built-in ORM), given that both are popular PHP ORMs?
  7. What is the purpose of cascading operations (e.g. `#[ORM\OneToMany(mappedBy: 'author', targetEntity: Post::class, cascade: ['persist', 'remove'])]`) on a Doctrine association?
  8. What is the purpose of Doctrine's "identity map" pattern within a single request/EntityManager session?
  9. What is a common performance pitfall related to Doctrine's default lazy-loading behavior when iterating over a collection of entities and accessing each one's related data?
  10. What is the difference between `persist()` and `flush()` on Doctrine's EntityManager?
  11. What does the `#[ORM\Column]` attribute's `type` parameter control, e.g. `#[ORM\Column(type: 'string', length: 255)]`?
  12. What is `QueryBuilder` in Doctrine, and how does it compare to writing DQL as a raw string?
Gaps to close?
Read the curated Doctrine notes — core concepts, patterns, interview prep.
Doctrine notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web