SlideShare a Scribd company logo
DOCTRINE
ALESSANDRO MINOCCHERI
@minompi
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
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.
WHEN TO USE IT AND WHEN NOT
TYPE AND CUSTOM TYPE
ANNOTATIONS AND XML
orm:convert-mapping xml /path/to/mapping-path-converted-to-xml
CONSOLE COMMAND
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.
ONE TO MANY
MANY TO MANY
ONE TO ONE
Join column not mandatory
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.
DQL
Doctrine Query Language

You need to think about DQL as a query language for your object model, not for
your relational schema.
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.
CACHE
• APC (Alternative PHP Cache)

• APCu

• Memcache

• Memcached

• Xcache

• Redis
EMBEDDABLE
Embeddables can only contain
properties with basic @Column mapping
INHERITANCE
Possible typology

• Single table (same table)

• Joined (different tables)
WE ARE HIRING!

More Related Content

What's hot

Orm and hibernate
Orm and hibernateOrm and hibernate
Orm and hibernate
s4al_com
 
Java and the JVM
Java and the JVMJava and the JVM
Java and the JVM
Manish Pandit
 
Reactjs workshop
Reactjs workshopReactjs workshop
Reactjs workshop
Pankaj Bhageria
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Brett Meyer
 
OOPs fundamentals session for freshers in my office (Aug 5, 13)
OOPs fundamentals session for freshers in my office (Aug 5, 13)OOPs fundamentals session for freshers in my office (Aug 5, 13)
OOPs fundamentals session for freshers in my office (Aug 5, 13)
Ashoka R K T
 
OC4J to WebLogic Server Migration5
OC4J to WebLogic Server Migration5OC4J to WebLogic Server Migration5
OC4J to WebLogic Server Migration5
Liran Zelkha
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
Anton Udovychenko
 
Introduction to java programming
Introduction to java programmingIntroduction to java programming
Introduction to java programming
ASIT Education
 
Java 8 in action.Jinq
Java 8 in action.JinqJava 8 in action.Jinq
Java 8 in action.Jinq
Strannik_2013
 
Introduction to oops
Introduction to oopsIntroduction to oops
Introduction to oops
Umamaheshwariv1
 
Java SE 7 New Features and Enhancements
Java SE 7 New Features and EnhancementsJava SE 7 New Features and Enhancements
Java SE 7 New Features and Enhancements
Fu Cheng
 
Clojure - Why does it matter?
Clojure - Why does it matter?Clojure - Why does it matter?
Clojure - Why does it matter?
Falko Riemenschneider
 
Scal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and AngularScal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and Angular
Knoldus Inc.
 
Section 4 concurrency
Section 4   concurrencySection 4   concurrency
Section 4 concurrency
Juarez Junior
 
Modern java script features
Modern java script featuresModern java script features
Modern java script features
Kunal Kursija
 
Agile xml
Agile xmlAgile xml
Agile xml
Richard Winslow
 
Ceylon module repositories by Aleš Justin
Ceylon module repositories by Aleš JustinCeylon module repositories by Aleš Justin
Ceylon module repositories by Aleš Justin
UnFroMage
 
Java programming - intro
Java programming - introJava programming - intro
Java programming - intro
Kathleen Ong
 
Ceylon SDK by Stéphane Épardaud
Ceylon SDK by Stéphane ÉpardaudCeylon SDK by Stéphane Épardaud
Ceylon SDK by Stéphane Épardaud
UnFroMage
 
Java basics at dallas technologies
Java basics at dallas technologiesJava basics at dallas technologies
Java basics at dallas technologies
dallastechnologiesinbtm
 

What's hot (20)

Orm and hibernate
Orm and hibernateOrm and hibernate
Orm and hibernate
 
Java and the JVM
Java and the JVMJava and the JVM
Java and the JVM
 
Reactjs workshop
Reactjs workshopReactjs workshop
Reactjs workshop
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
 
OOPs fundamentals session for freshers in my office (Aug 5, 13)
OOPs fundamentals session for freshers in my office (Aug 5, 13)OOPs fundamentals session for freshers in my office (Aug 5, 13)
OOPs fundamentals session for freshers in my office (Aug 5, 13)
 
OC4J to WebLogic Server Migration5
OC4J to WebLogic Server Migration5OC4J to WebLogic Server Migration5
OC4J to WebLogic Server Migration5
 
Search and analyze your data with elasticsearch
Search and analyze your data with elasticsearchSearch and analyze your data with elasticsearch
Search and analyze your data with elasticsearch
 
Introduction to java programming
Introduction to java programmingIntroduction to java programming
Introduction to java programming
 
Java 8 in action.Jinq
Java 8 in action.JinqJava 8 in action.Jinq
Java 8 in action.Jinq
 
Introduction to oops
Introduction to oopsIntroduction to oops
Introduction to oops
 
Java SE 7 New Features and Enhancements
Java SE 7 New Features and EnhancementsJava SE 7 New Features and Enhancements
Java SE 7 New Features and Enhancements
 
Clojure - Why does it matter?
Clojure - Why does it matter?Clojure - Why does it matter?
Clojure - Why does it matter?
 
Scal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and AngularScal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and Angular
 
Section 4 concurrency
Section 4   concurrencySection 4   concurrency
Section 4 concurrency
 
Modern java script features
Modern java script featuresModern java script features
Modern java script features
 
Agile xml
Agile xmlAgile xml
Agile xml
 
Ceylon module repositories by Aleš Justin
Ceylon module repositories by Aleš JustinCeylon module repositories by Aleš Justin
Ceylon module repositories by Aleš Justin
 
Java programming - intro
Java programming - introJava programming - intro
Java programming - intro
 
Ceylon SDK by Stéphane Épardaud
Ceylon SDK by Stéphane ÉpardaudCeylon SDK by Stéphane Épardaud
Ceylon SDK by Stéphane Épardaud
 
Java basics at dallas technologies
Java basics at dallas technologiesJava basics at dallas technologies
Java basics at dallas technologies
 

Similar to Doctrine

Solr 8 interview
Solr 8 interview Solr 8 interview
Solr 8 interview
Alihossein shahabi
 
Solr + Hadoop = Big Data Search
Solr + Hadoop = Big Data SearchSolr + Hadoop = Big Data Search
Solr + Hadoop = Big Data Search
Mark Miller
 
Web 3 final(1)
Web 3 final(1)Web 3 final(1)
Web 3 final(1)
Venky Dood
 
EVOLVE'16 | Deploy | Abhishek Dwevedi | Overview of the Core AEM Technology
EVOLVE'16 | Deploy | Abhishek Dwevedi | Overview of the Core AEM TechnologyEVOLVE'16 | Deploy | Abhishek Dwevedi | Overview of the Core AEM Technology
EVOLVE'16 | Deploy | Abhishek Dwevedi | Overview of the Core AEM Technology
Evolve The Adobe Digital Marketing Community
 
D2 rq
D2 rqD2 rq
Cloudera - Using morphlines for on the-fly ETL by Wolfgang Hoschek
Cloudera - Using morphlines for on the-fly ETL by Wolfgang HoschekCloudera - Using morphlines for on the-fly ETL by Wolfgang Hoschek
Cloudera - Using morphlines for on the-fly ETL by Wolfgang Hoschek
Hakka Labs
 
2010 05-21, object-relational mapping using hibernate v2
2010 05-21, object-relational mapping using hibernate v22010 05-21, object-relational mapping using hibernate v2
2010 05-21, object-relational mapping using hibernate v2
alvaro alcocer sotil
 
ORM Methodology
ORM MethodologyORM Methodology
ORM Methodology
Ahmed Gomaa
 
Using Morphlines for On-the-Fly ETL
Using Morphlines for On-the-Fly ETLUsing Morphlines for On-the-Fly ETL
Using Morphlines for On-the-Fly ETL
Cloudera, Inc.
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
Mayank Panchal
 
eureka09
eureka09eureka09
eureka09
tutorialsruby
 
eureka09
eureka09eureka09
eureka09
tutorialsruby
 
Azure document db/Cosmos DB
Azure document db/Cosmos DBAzure document db/Cosmos DB
Azure document db/Cosmos DB
Mohit Chhabra
 
Large Scale ETL for Hadoop and Cloudera Search using Morphlines
Large Scale ETL for Hadoop and Cloudera Search using MorphlinesLarge Scale ETL for Hadoop and Cloudera Search using Morphlines
Large Scale ETL for Hadoop and Cloudera Search using Morphlines
whoschek
 
Require.JS
Require.JSRequire.JS
Require.JS
Ivano Malavolta
 
Design patterns
Design patternsDesign patterns
Design patterns
Alok Guha
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
KUNAL GADHIA
 
CISSP Prep: Ch 9. Software Development Security
CISSP Prep: Ch 9. Software Development SecurityCISSP Prep: Ch 9. Software Development Security
CISSP Prep: Ch 9. Software Development Security
Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
Sam Bowne
 
Hibernate
HibernateHibernate
Hibernate
Sujit Kumar
 

Similar to Doctrine (20)

Solr 8 interview
Solr 8 interview Solr 8 interview
Solr 8 interview
 
Solr + Hadoop = Big Data Search
Solr + Hadoop = Big Data SearchSolr + Hadoop = Big Data Search
Solr + Hadoop = Big Data Search
 
Web 3 final(1)
Web 3 final(1)Web 3 final(1)
Web 3 final(1)
 
EVOLVE'16 | Deploy | Abhishek Dwevedi | Overview of the Core AEM Technology
EVOLVE'16 | Deploy | Abhishek Dwevedi | Overview of the Core AEM TechnologyEVOLVE'16 | Deploy | Abhishek Dwevedi | Overview of the Core AEM Technology
EVOLVE'16 | Deploy | Abhishek Dwevedi | Overview of the Core AEM Technology
 
D2 rq
D2 rqD2 rq
D2 rq
 
Cloudera - Using morphlines for on the-fly ETL by Wolfgang Hoschek
Cloudera - Using morphlines for on the-fly ETL by Wolfgang HoschekCloudera - Using morphlines for on the-fly ETL by Wolfgang Hoschek
Cloudera - Using morphlines for on the-fly ETL by Wolfgang Hoschek
 
2010 05-21, object-relational mapping using hibernate v2
2010 05-21, object-relational mapping using hibernate v22010 05-21, object-relational mapping using hibernate v2
2010 05-21, object-relational mapping using hibernate v2
 
ORM Methodology
ORM MethodologyORM Methodology
ORM Methodology
 
Using Morphlines for On-the-Fly ETL
Using Morphlines for On-the-Fly ETLUsing Morphlines for On-the-Fly ETL
Using Morphlines for On-the-Fly ETL
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
eureka09
eureka09eureka09
eureka09
 
eureka09
eureka09eureka09
eureka09
 
Azure document db/Cosmos DB
Azure document db/Cosmos DBAzure document db/Cosmos DB
Azure document db/Cosmos DB
 
Large Scale ETL for Hadoop and Cloudera Search using Morphlines
Large Scale ETL for Hadoop and Cloudera Search using MorphlinesLarge Scale ETL for Hadoop and Cloudera Search using Morphlines
Large Scale ETL for Hadoop and Cloudera Search using Morphlines
 
Require.JS
Require.JSRequire.JS
Require.JS
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
CISSP Prep: Ch 9. Software Development Security
CISSP Prep: Ch 9. Software Development SecurityCISSP Prep: Ch 9. Software Development Security
CISSP Prep: Ch 9. Software Development Security
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
Hibernate
HibernateHibernate
Hibernate
 

More from Alessandro Minoccheri

ServerSentEventsV2.pdf
ServerSentEventsV2.pdfServerSentEventsV2.pdf
ServerSentEventsV2.pdf
Alessandro Minoccheri
 
ServerSentEvents.pdf
ServerSentEvents.pdfServerSentEvents.pdf
ServerSentEvents.pdf
Alessandro Minoccheri
 
Kotlin hexagonal-architecture
Kotlin hexagonal-architectureKotlin hexagonal-architecture
Kotlin hexagonal-architecture
Alessandro Minoccheri
 
Hexagonal architecture ita
Hexagonal architecture itaHexagonal architecture ita
Hexagonal architecture ita
Alessandro Minoccheri
 
Hexagonal architecture
Hexagonal architectureHexagonal architecture
Hexagonal architecture
Alessandro Minoccheri
 
Smart working
Smart workingSmart working
Smart working
Alessandro Minoccheri
 
Symfony aws
Symfony awsSymfony aws
Composer
ComposerComposer
Symfony4
Symfony4Symfony4

More from Alessandro Minoccheri (9)

ServerSentEventsV2.pdf
ServerSentEventsV2.pdfServerSentEventsV2.pdf
ServerSentEventsV2.pdf
 
ServerSentEvents.pdf
ServerSentEvents.pdfServerSentEvents.pdf
ServerSentEvents.pdf
 
Kotlin hexagonal-architecture
Kotlin hexagonal-architectureKotlin hexagonal-architecture
Kotlin hexagonal-architecture
 
Hexagonal architecture ita
Hexagonal architecture itaHexagonal architecture ita
Hexagonal architecture ita
 
Hexagonal architecture
Hexagonal architectureHexagonal architecture
Hexagonal architecture
 
Smart working
Smart workingSmart working
Smart working
 
Symfony aws
Symfony awsSymfony aws
Symfony aws
 
Composer
ComposerComposer
Composer
 
Symfony4
Symfony4Symfony4
Symfony4
 

Recently uploaded

E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
ssuserad3af4
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 

Recently uploaded (20)

E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 

Doctrine

  • 3.
  • 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.
  • 6. WHEN TO USE IT AND WHEN NOT
  • 8. ANNOTATIONS AND XML orm:convert-mapping xml /path/to/mapping-path-converted-to-xml
  • 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.
  • 13. ONE TO ONE Join column not mandatory
  • 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.
  • 17. CACHE • APC (Alternative PHP Cache) • APCu • Memcache • Memcached • Xcache • Redis
  • 18. EMBEDDABLE Embeddables can only contain properties with basic @Column mapping
  • 19. INHERITANCE Possible typology • Single table (same table) • Joined (different tables)