4. ABSTRACT
• What is Doctrine ORM
• When to use it and when not
• Type and custom type
• Annotations and xml
• Console Command
• Relations
• Fetch methods
• DQL
• QueryBuilder
• Cache
• Embeddable
• Inheritance
5. WHAT IS DOCTRINE ORM
PHP object relational mapper (ORM) that sits on top of
a powerful database abstraction layer (DBAL).
One of its key features is the option to write database
queries in a proprietary object oriented SQL dialect
called Doctrine Query Language (DQL).
This provides developers with a powerful alternative to
SQL that maintains flexibility without requiring
unnecessary code duplication.
10. RELATIONS
• OneToMany - One instance of the current
Entity has Many instances (references) to the
refered Entity.
• OneToOne - One instance of the current
Entity refers to One instance of the refered
Entity
• Many to Many - Many instances has many
instances.
14. FETCH METHODS
• EAGER Whenever you query for an entity that has persistent associations and these associations are
mapped as EAGER, they will automatically be loaded together with the entity being queried and is thus
immediately available to your application.
• LAZY LOAD Whenever you have a managed entity instance at hand, you can traverse and use any
associations of that entity that are configured LAZY as if they were in-memory already. Doctrine will
automatically load the associated objects on demand through the concept of lazy-loading.
15. DQL
Doctrine Query Language
You need to think about DQL as a query language for your object model, not for
your relational schema.
16. QUERY BUILDER
A QueryBuilder provides an API that is designed for conditionally
constructing a DQL query in several steps.
It provides a set of classes and methods that is able to
programmatically build queries, and also provides a fluent API.
This means that you can change between one methodology to the
other as you want, or just pick a preferred one.