SlideShare a Scribd company logo
1 of 20
Download to read offline
WHO'S TALKING?
Gediminas Morkevičius aka @l3pp4rd

I code with - PHP, Go, JavaScript, C
I'm an open-source geek - ViM, Arch Linux, DWM user
And I share my stuff github.com/l3pp4rd
SYMFONYCON WARSAW 2013

INCREASE PRODUCTIVITY WITH
DOCTRINE2 BEHAVIORAL EXTENSIONS
SOME HISTORY
The initial commit 2010-09-03 MIT licensed
Maintained ever since
Purpose - provide common model behaviors
Derive metadata mapping and caching technics
Be a framework independent library
AN EXAMPLE
<pp
?h
nmsaeEtt;
aepc niy
ueGdoMpigAntto a Gdo
s emapnnoain s em;
ueDcrnRapn a OM
s otieOMMpig s R;
/*
*
*@Rniy
OMEtt
*@emoteeebefedae"eeeA"
GdoSfDltal(ilNm=dltdt)
*
/
casPout
ls rdc
{
/*
*
*@emrnltbe
GdoTasaal
*@Rounlnt=4
OMClm(egh6)
*
/
piae$il;
rvt tte
/*
*
*@emlgfed="il",udtbefle
GdoSu(ils{tte} paal=as)
*@Rounlnt=4 uiu=re
OMClm(egh6, nqetu)
*
/
piae$lg
rvt su;
/*
*
*@emietmal(n"rae)
GdoTmsapbeo=cet"
*@Rountp=dttm"
OMClm(ye"aeie)
*
/
piae$raeA;
rvt cetdt
/*
*
HOW EXTENSIONS WORK?
SLUGGABLE
Transforms fields into an url friendly slug. Ensures
uniqueness if required.
/*
*
*@emlgfed="oe,"il",sprtr"" sye"ae"
GdoSu(ils{cd" tte} eaao=-, tl=cml)
*@Rounlnt=4 uiu=re
OMClm(egh6, nqetu)
*
/
piae$lg
rvt su;

Default transliterator transforms utf-8 characters to their
ASCII equivalent
TRANSLATABLE
/*
*
*@emrnltbe
GdoTasaal
*@Rounlnt=4
OMClm(egh6)
*
/
piae$il;
rvt tte
/*
*
*@emrnltbe
GdoTasaal
*@Rountp=tx" nlal=re
OMClm(ye"et, ulbetu)
*
/
piae$ecito;
rvt dsrpin

Can link to a specific entity for translations. That would allow
to use a direct foreign key constraint and optimize for better
performance
By default, puts all translations into a single translation
table. It is not performance wise. Uses locale from listener.
TRANSLATION QUERY HINTS
$ur =$m>raeur(SLC pFO Ettrdc pODRB ptte)
qey
e-cetQey"EET
RM niyPout
RE Y .il";
$ur-stit
qey>eHn(
DcrnRur:HN_UTMOTU_AKR
otieOMQey:ITCSO_UPTWLE,
'emrnltbeQeyTeWlernltoWle'
GdoTasaalurreakrTasainakr
)
;
$ur-stitTasaalLsee:HN_RNLTBELCL,'e)
qey>eHn(rnltbeitnr:ITTASAAL_OAE d';
$erdcs=$ur-gteut)
dPout
qey>eRsl(;
arywl(dPout,fnto(niyPout$){
ra_ak$erdcs ucinEttrdc p
eh "o <$-gtil(} wt dsrpin<$-gtecito(}"
co Gt {p>eTte)> ih ecito {p>eDsrpin)>n;
};
)
/ Gt<pe>wt dsrpin<rct>
/ o Äfl ih ecito Fühe
/ Gt<rue>wt dsrpin<rct>
/ o Tabn ih ecito Fühe
TIMESTAMPABLE
Sets timestamps for you. Derived extensions: IpTraceable,
Blameable
/*
*
*@emietmal(n"rae)
GdoTmsapbeo=cet"
*@Rountp=dttm"
OMClm(ye"aeie)
*
/
piae$raeA;
rvt cetdt
/*
*
*@emietmal(n"pae)
GdoTmsapbeo=udt"
*@Rountp=dttm"
OMClm(ye"aeie)
*
/
piae$paeA;
rvt udtdt
/*
*
*@emietmal(n"hne,fed"ttscd" vle1
GdoTmsapbeo=cag" il=sau.oe, au=)
*@Rountp=dttm" nlal=re
OMClm(ye"aeie, ulbetu)
*
/
piae$ulseA;
rvt pbihdt
SORTABLE
Tracks sorting position on your entity
/*
*
*@emotbeoiin
GdoSralPsto
*@Rountp=itgr)
OMClm(ye"nee"
*
/
piae$oiin
rvt psto;
/*
*
*@emotberu
GdoSralGop
*@Rayon(agtniy"aeoy)
OMMnTOetreEtt=Ctgr"
*
/
piae$aeoy
rvt ctgr;
SOFTDELETEABLE
Softly removes your entities, so they get filtered out
afterwards, but maintain in the database.
/*
*
*@emoteeebefedae"eeeA"
GdoSfDltal(ilNm=dltdt)
*@Rniy
OMEtt
*
/
casPout
ls rdc
{
/*
*
*@Rounlnt=4
OMClm(egh6)
*
/
piae$il;
rvt tte
/*
*
*@Rountp=dttm" nlal=re
OMClm(ye"aeie, ulbetu)
*
/
piae$eeeA;
rvt dltdt
}

/..
/.
Given the actions are performed:
$0=nwEttrdc;
p
e niyPout
$0>eTte'ilb sfdltd)
p-stil(Wl e oteee';
$1=nwEttrdc;
p
e niyPout
$1>eTte'rlyscesu pout)
p-stil(Tul ucsfl rdc';
$m>ess(p)
e-prit$0;
$m>ess(p)
e-prit$1;
$m>ls(;
e-fuh)
/ a sm pit pouti rmvd
/ t oe on, rdc s eoe
$m>eoe$0;
e-rmv(p)
$m>ls(;
e-fuh)
eh cut$m>eRpstr(Ettrdc'-fnAl);
co on(e-gteoioy'niyPout)>idl()
/ rsl i:1
/ eut s
NESTED-SET TREE
Manages your entity as Nested-Set strategy based tree.
<pp
?h
nmsaeEtt;
aepc niy
ueGdoMpigAntto a Gdo
s emapnnoain s em;
ueDcrnRapn a OM
s otieOMMpig s R;
/*
*
*@emretp=nse"
GdoTe(ye"etd)
*@RniyrpstrCas"emreEtteoioyNseTeRpstr"
OMEtt(eoioyls=GdoTeniyRpstretdreeoioy)
*
/
casCtgr
ls aeoy
{
/*
*
*@Rountp=itgr)
OMClm(ye"nee"
*@Rd
OMI
*@ReeaeVle
OMGnrtdau
*
/
piae$d
rvt i;
/*
*
*@Rounlnt=4
OMClm(egh6)
*
/
piae$il;
rvt tte
/*
*
*@emreet
GdoTeLf
*@Rountp=itgr)
OMClm(ye"nee"
*
/
How the tree looks in database:
How to keep your tree records secure from getting
compromised during concurrent requests?
Given we have entities:
/*
*
*@Rniy
OMEtt
*
/
casOgnsto {*.*}
ls raiain /../
/*
*
*@emretp=nse"
GdoTe(ye"etd)
*@RniyrpstrCas"emreEtteoioyNseTeRpstr"
OMEtt(eoioyls=GdoTeniyRpstretdreeoioy)
*
/
casPoet
ls rjc
{
/*
*
*@Rayon(agtniy"raiain)
OMMnTOetreEtt=Ognsto"
*@RonounrfrneClmNm=i" nlal=as)
OMJiClm(eeecdounae"d, ulbefle
*
/
piae$raiain
rvt ognsto;
}

/../
*.*
On every request when you move, insert Project you have a
hard relation Organisation. Meaning, you have to select the
specific organisation in order to update the tree.
ueDcrnBLLcMd;
s otieDAokoe
$on=$m>eCneto(;
cn
e-gtoncin)
/ sattascin
/ tr rnato
$on>eiTascin)
cn-bgnrnato(;
ty{
r
/ slcsognsto frudt -lcsi fray
/ eet raiain o pae
ok t o n
/ ra/rt atmt utlti tascined
/ edwie teps ni hs rnato ns
$r =$m>id"niyOgnsto" $rI,LcMd:PSIITCWIE;
og
e-fn(Ettraiain, ogd okoe:ESMSI_RT)
/ cet anwctgr
/ rae
e aeoy
$uPoet=nwPoet
sbrjc
e rjc;
$uPoet>eTte$PS[tte];
sbrjc-stil(_OT"il")
$uPoet>eOgnsto(og;
sbrjc-straiain$r)
$aetrjc =$m>id"niyPoet,$PS[prn_d];
prnPoet
e-fn(Ettrjc" _OT"aeti")
/ pritadfuh
/ ess n ls
$m>eRpstr(Ettrjc"
e-gteoioy"niyPoet)
-pritsisCidf$uPoet $aetrjc)
>essAFrthlO(sbrjc, prnPoet;
$m>ls(;
e-fuh)
$on>omt)
cn-cmi(;
}cth(Ecpin$){
ac xeto e
$on>olak)
cn-rlbc(;
trw$;
ho e
}
Read more about available locking mechanisms supported
by database you are using, some references:
Transactions and concurrency on Doctrine2 website
Locking reads on MySQL 5.5 manual page
Any actions which does atomic operations needs to be
secured including Sortable extension.
FUTURE PLANS:
1.
2.
3.
4.
5.
6.

One next big version upgrade expected 2014
Simplify integration without any preconfiguration using
sensible defaults.
Improve extensions based on the issues learned.
Make them less feature rich, but more customizable.
Improve documentation, add helper commands to review
active listeners and watched entities.
Maintain compatibility without changes to public
interface.
Progress can be followed on pull request
THANK YOU

Powered by: Revealjs

More Related Content

Viewers also liked

Aspectos legales. present.
Aspectos legales. present.Aspectos legales. present.
Aspectos legales. present.angevale
 
Bài giảng mô phỏng mạch điện tử
Bài giảng mô phỏng mạch điện tửBài giảng mô phỏng mạch điện tử
Bài giảng mô phỏng mạch điện tửLE The Vinh
 
Shared Services - Cost and Other Efficencies
Shared Services - Cost and Other EfficenciesShared Services - Cost and Other Efficencies
Shared Services - Cost and Other EfficenciesPaul Ramsay
 
Advanced Exam Certificate
Advanced Exam CertificateAdvanced Exam Certificate
Advanced Exam CertificateTyler Ellis
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionseeddarcy
 
Igor_Tolkach_Portfolio2015
Igor_Tolkach_Portfolio2015Igor_Tolkach_Portfolio2015
Igor_Tolkach_Portfolio2015Igor Tolkach
 
Sparc-Japan-Slow-revolution-in-scholarly-communication
Sparc-Japan-Slow-revolution-in-scholarly-communicationSparc-Japan-Slow-revolution-in-scholarly-communication
Sparc-Japan-Slow-revolution-in-scholarly-communicationhierohiero
 
骨盆歪斜 姿勢不良惹的禍
骨盆歪斜 姿勢不良惹的禍骨盆歪斜 姿勢不良惹的禍
骨盆歪斜 姿勢不良惹的禍lys167
 
An introduction: Fast track immediate care
An introduction: Fast track immediate careAn introduction: Fast track immediate care
An introduction: Fast track immediate careFastTrack Immediate Care
 
Catalogue of Dery Chemical
Catalogue of Dery ChemicalCatalogue of Dery Chemical
Catalogue of Dery ChemicalRina Lu
 
Luke_odgen_2014_updated-1_copy
Luke_odgen_2014_updated-1_copyLuke_odgen_2014_updated-1_copy
Luke_odgen_2014_updated-1_copyLuke Ogden
 

Viewers also liked (17)

Aspectos legales. present.
Aspectos legales. present.Aspectos legales. present.
Aspectos legales. present.
 
Bài giảng mô phỏng mạch điện tử
Bài giảng mô phỏng mạch điện tửBài giảng mô phỏng mạch điện tử
Bài giảng mô phỏng mạch điện tử
 
Shared Services - Cost and Other Efficencies
Shared Services - Cost and Other EfficenciesShared Services - Cost and Other Efficencies
Shared Services - Cost and Other Efficencies
 
Advanced Exam Certificate
Advanced Exam CertificateAdvanced Exam Certificate
Advanced Exam Certificate
 
ACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 versionACC 290 Final Exam 2015 version
ACC 290 Final Exam 2015 version
 
Proposal tanaman padi
Proposal tanaman padiProposal tanaman padi
Proposal tanaman padi
 
Joe Cherng_7
Joe Cherng_7Joe Cherng_7
Joe Cherng_7
 
Departemen agama
Departemen agamaDepartemen agama
Departemen agama
 
Tgas sistem pncernaan
Tgas sistem pncernaanTgas sistem pncernaan
Tgas sistem pncernaan
 
Surat keterangan kematian 2
Surat keterangan kematian 2Surat keterangan kematian 2
Surat keterangan kematian 2
 
Igor_Tolkach_Portfolio2015
Igor_Tolkach_Portfolio2015Igor_Tolkach_Portfolio2015
Igor_Tolkach_Portfolio2015
 
Sparc-Japan-Slow-revolution-in-scholarly-communication
Sparc-Japan-Slow-revolution-in-scholarly-communicationSparc-Japan-Slow-revolution-in-scholarly-communication
Sparc-Japan-Slow-revolution-in-scholarly-communication
 
Proposal ubi jalar
Proposal ubi jalarProposal ubi jalar
Proposal ubi jalar
 
骨盆歪斜 姿勢不良惹的禍
骨盆歪斜 姿勢不良惹的禍骨盆歪斜 姿勢不良惹的禍
骨盆歪斜 姿勢不良惹的禍
 
An introduction: Fast track immediate care
An introduction: Fast track immediate careAn introduction: Fast track immediate care
An introduction: Fast track immediate care
 
Catalogue of Dery Chemical
Catalogue of Dery ChemicalCatalogue of Dery Chemical
Catalogue of Dery Chemical
 
Luke_odgen_2014_updated-1_copy
Luke_odgen_2014_updated-1_copyLuke_odgen_2014_updated-1_copy
Luke_odgen_2014_updated-1_copy
 

Similar to Increase productivity with doctrine2 extensions

Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaTony Fabeen
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scriptingTony Fabeen
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsHeroku
 
Marko Gargenta_Remixing android
Marko Gargenta_Remixing androidMarko Gargenta_Remixing android
Marko Gargenta_Remixing androidDroidcon Berlin
 
Refactoring to symfony components
Refactoring to symfony componentsRefactoring to symfony components
Refactoring to symfony componentsMichael Peacock
 
Unit 8
Unit 8Unit 8
Unit 8siddr
 
JavaScript Design Patterns
JavaScript Design PatternsJavaScript Design Patterns
JavaScript Design PatternsDerek Brown
 
Build a custom (micro)framework with ZF2 Components (as building blocks)
Build a custom (micro)framework with ZF2 Components (as building blocks)Build a custom (micro)framework with ZF2 Components (as building blocks)
Build a custom (micro)framework with ZF2 Components (as building blocks)Corley S.r.l.
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & ToolsIan Barber
 
Proxy OOP Pattern in PHP
Proxy OOP Pattern in PHPProxy OOP Pattern in PHP
Proxy OOP Pattern in PHPMarco Pivetta
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPAdam Englander
 
Tame your Infrastructure with Puppet
Tame your Infrastructure with PuppetTame your Infrastructure with Puppet
Tame your Infrastructure with Puppetdelimiter
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleAri Lerner
 
Introduction to Kernel Programming
Introduction to Kernel ProgrammingIntroduction to Kernel Programming
Introduction to Kernel ProgrammingAhmed Mekkawy
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Lin Yo-An
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges✅ William Pinaud
 

Similar to Increase productivity with doctrine2 extensions (20)

Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with Lua
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
 
Farewell to Disks: Efficient Processing of Obstinate Data
Farewell to Disks: Efficient Processing of Obstinate DataFarewell to Disks: Efficient Processing of Obstinate Data
Farewell to Disks: Efficient Processing of Obstinate Data
 
Marko Gargenta_Remixing android
Marko Gargenta_Remixing androidMarko Gargenta_Remixing android
Marko Gargenta_Remixing android
 
Refactoring to symfony components
Refactoring to symfony componentsRefactoring to symfony components
Refactoring to symfony components
 
Unit 8
Unit 8Unit 8
Unit 8
 
JavaScript Design Patterns
JavaScript Design PatternsJavaScript Design Patterns
JavaScript Design Patterns
 
Build a custom (micro)framework with ZF2 Components (as building blocks)
Build a custom (micro)framework with ZF2 Components (as building blocks)Build a custom (micro)framework with ZF2 Components (as building blocks)
Build a custom (micro)framework with ZF2 Components (as building blocks)
 
OOP in Rust
OOP in RustOOP in Rust
OOP in Rust
 
Lca05
Lca05Lca05
Lca05
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
 
Proxy OOP Pattern in PHP
Proxy OOP Pattern in PHPProxy OOP Pattern in PHP
Proxy OOP Pattern in PHP
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHPZend con 2016 - Asynchronous Prorgamming in PHP
Zend con 2016 - Asynchronous Prorgamming in PHP
 
Tame your Infrastructure with Puppet
Tame your Infrastructure with PuppetTame your Infrastructure with Puppet
Tame your Infrastructure with Puppet
 
Beginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at GoogleBeginner workshop to angularjs presentation at Google
Beginner workshop to angularjs presentation at Google
 
Introduction to Kernel Programming
Introduction to Kernel ProgrammingIntroduction to Kernel Programming
Introduction to Kernel Programming
 
Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015Code Generation in PHP - PHPConf 2015
Code Generation in PHP - PHPConf 2015
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
 
PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.
 

Recently uploaded

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Increase productivity with doctrine2 extensions

  • 1. WHO'S TALKING? Gediminas Morkevičius aka @l3pp4rd I code with - PHP, Go, JavaScript, C I'm an open-source geek - ViM, Arch Linux, DWM user And I share my stuff github.com/l3pp4rd
  • 2. SYMFONYCON WARSAW 2013 INCREASE PRODUCTIVITY WITH DOCTRINE2 BEHAVIORAL EXTENSIONS
  • 3. SOME HISTORY The initial commit 2010-09-03 MIT licensed Maintained ever since Purpose - provide common model behaviors Derive metadata mapping and caching technics Be a framework independent library
  • 4. AN EXAMPLE <pp ?h nmsaeEtt; aepc niy ueGdoMpigAntto a Gdo s emapnnoain s em; ueDcrnRapn a OM s otieOMMpig s R; /* * *@Rniy OMEtt *@emoteeebefedae"eeeA" GdoSfDltal(ilNm=dltdt) * / casPout ls rdc { /* * *@emrnltbe GdoTasaal *@Rounlnt=4 OMClm(egh6) * / piae$il; rvt tte /* * *@emlgfed="il",udtbefle GdoSu(ils{tte} paal=as) *@Rounlnt=4 uiu=re OMClm(egh6, nqetu) * / piae$lg rvt su; /* * *@emietmal(n"rae) GdoTmsapbeo=cet" *@Rountp=dttm" OMClm(ye"aeie) * / piae$raeA; rvt cetdt /* *
  • 6. SLUGGABLE Transforms fields into an url friendly slug. Ensures uniqueness if required. /* * *@emlgfed="oe,"il",sprtr"" sye"ae" GdoSu(ils{cd" tte} eaao=-, tl=cml) *@Rounlnt=4 uiu=re OMClm(egh6, nqetu) * / piae$lg rvt su; Default transliterator transforms utf-8 characters to their ASCII equivalent
  • 7. TRANSLATABLE /* * *@emrnltbe GdoTasaal *@Rounlnt=4 OMClm(egh6) * / piae$il; rvt tte /* * *@emrnltbe GdoTasaal *@Rountp=tx" nlal=re OMClm(ye"et, ulbetu) * / piae$ecito; rvt dsrpin Can link to a specific entity for translations. That would allow to use a direct foreign key constraint and optimize for better performance
  • 8. By default, puts all translations into a single translation table. It is not performance wise. Uses locale from listener.
  • 9. TRANSLATION QUERY HINTS $ur =$m>raeur(SLC pFO Ettrdc pODRB ptte) qey e-cetQey"EET RM niyPout RE Y .il"; $ur-stit qey>eHn( DcrnRur:HN_UTMOTU_AKR otieOMQey:ITCSO_UPTWLE, 'emrnltbeQeyTeWlernltoWle' GdoTasaalurreakrTasainakr ) ; $ur-stitTasaalLsee:HN_RNLTBELCL,'e) qey>eHn(rnltbeitnr:ITTASAAL_OAE d'; $erdcs=$ur-gteut) dPout qey>eRsl(; arywl(dPout,fnto(niyPout$){ ra_ak$erdcs ucinEttrdc p eh "o <$-gtil(} wt dsrpin<$-gtecito(}" co Gt {p>eTte)> ih ecito {p>eDsrpin)>n; }; ) / Gt<pe>wt dsrpin<rct> / o Äfl ih ecito Fühe / Gt<rue>wt dsrpin<rct> / o Tabn ih ecito Fühe
  • 10. TIMESTAMPABLE Sets timestamps for you. Derived extensions: IpTraceable, Blameable /* * *@emietmal(n"rae) GdoTmsapbeo=cet" *@Rountp=dttm" OMClm(ye"aeie) * / piae$raeA; rvt cetdt /* * *@emietmal(n"pae) GdoTmsapbeo=udt" *@Rountp=dttm" OMClm(ye"aeie) * / piae$paeA; rvt udtdt /* * *@emietmal(n"hne,fed"ttscd" vle1 GdoTmsapbeo=cag" il=sau.oe, au=) *@Rountp=dttm" nlal=re OMClm(ye"aeie, ulbetu) * / piae$ulseA; rvt pbihdt
  • 11. SORTABLE Tracks sorting position on your entity /* * *@emotbeoiin GdoSralPsto *@Rountp=itgr) OMClm(ye"nee" * / piae$oiin rvt psto; /* * *@emotberu GdoSralGop *@Rayon(agtniy"aeoy) OMMnTOetreEtt=Ctgr" * / piae$aeoy rvt ctgr;
  • 12. SOFTDELETEABLE Softly removes your entities, so they get filtered out afterwards, but maintain in the database. /* * *@emoteeebefedae"eeeA" GdoSfDltal(ilNm=dltdt) *@Rniy OMEtt * / casPout ls rdc { /* * *@Rounlnt=4 OMClm(egh6) * / piae$il; rvt tte /* * *@Rountp=dttm" nlal=re OMClm(ye"aeie, ulbetu) * / piae$eeeA; rvt dltdt } /.. /.
  • 13. Given the actions are performed: $0=nwEttrdc; p e niyPout $0>eTte'ilb sfdltd) p-stil(Wl e oteee'; $1=nwEttrdc; p e niyPout $1>eTte'rlyscesu pout) p-stil(Tul ucsfl rdc'; $m>ess(p) e-prit$0; $m>ess(p) e-prit$1; $m>ls(; e-fuh) / a sm pit pouti rmvd / t oe on, rdc s eoe $m>eoe$0; e-rmv(p) $m>ls(; e-fuh) eh cut$m>eRpstr(Ettrdc'-fnAl); co on(e-gteoioy'niyPout)>idl() / rsl i:1 / eut s
  • 14. NESTED-SET TREE Manages your entity as Nested-Set strategy based tree. <pp ?h nmsaeEtt; aepc niy ueGdoMpigAntto a Gdo s emapnnoain s em; ueDcrnRapn a OM s otieOMMpig s R; /* * *@emretp=nse" GdoTe(ye"etd) *@RniyrpstrCas"emreEtteoioyNseTeRpstr" OMEtt(eoioyls=GdoTeniyRpstretdreeoioy) * / casCtgr ls aeoy { /* * *@Rountp=itgr) OMClm(ye"nee" *@Rd OMI *@ReeaeVle OMGnrtdau * / piae$d rvt i; /* * *@Rounlnt=4 OMClm(egh6) * / piae$il; rvt tte /* * *@emreet GdoTeLf *@Rountp=itgr) OMClm(ye"nee" * /
  • 15. How the tree looks in database:
  • 16. How to keep your tree records secure from getting compromised during concurrent requests? Given we have entities: /* * *@Rniy OMEtt * / casOgnsto {*.*} ls raiain /../ /* * *@emretp=nse" GdoTe(ye"etd) *@RniyrpstrCas"emreEtteoioyNseTeRpstr" OMEtt(eoioyls=GdoTeniyRpstretdreeoioy) * / casPoet ls rjc { /* * *@Rayon(agtniy"raiain) OMMnTOetreEtt=Ognsto" *@RonounrfrneClmNm=i" nlal=as) OMJiClm(eeecdounae"d, ulbefle * / piae$raiain rvt ognsto; } /../ *.*
  • 17. On every request when you move, insert Project you have a hard relation Organisation. Meaning, you have to select the specific organisation in order to update the tree. ueDcrnBLLcMd; s otieDAokoe $on=$m>eCneto(; cn e-gtoncin) / sattascin / tr rnato $on>eiTascin) cn-bgnrnato(; ty{ r / slcsognsto frudt -lcsi fray / eet raiain o pae ok t o n / ra/rt atmt utlti tascined / edwie teps ni hs rnato ns $r =$m>id"niyOgnsto" $rI,LcMd:PSIITCWIE; og e-fn(Ettraiain, ogd okoe:ESMSI_RT) / cet anwctgr / rae e aeoy $uPoet=nwPoet sbrjc e rjc; $uPoet>eTte$PS[tte]; sbrjc-stil(_OT"il") $uPoet>eOgnsto(og; sbrjc-straiain$r) $aetrjc =$m>id"niyPoet,$PS[prn_d]; prnPoet e-fn(Ettrjc" _OT"aeti") / pritadfuh / ess n ls $m>eRpstr(Ettrjc" e-gteoioy"niyPoet) -pritsisCidf$uPoet $aetrjc) >essAFrthlO(sbrjc, prnPoet; $m>ls(; e-fuh) $on>omt) cn-cmi(; }cth(Ecpin$){ ac xeto e $on>olak) cn-rlbc(; trw$; ho e }
  • 18. Read more about available locking mechanisms supported by database you are using, some references: Transactions and concurrency on Doctrine2 website Locking reads on MySQL 5.5 manual page Any actions which does atomic operations needs to be secured including Sortable extension.
  • 19. FUTURE PLANS: 1. 2. 3. 4. 5. 6. One next big version upgrade expected 2014 Simplify integration without any preconfiguration using sensible defaults. Improve extensions based on the issues learned. Make them less feature rich, but more customizable. Improve documentation, add helper commands to review active listeners and watched entities. Maintain compatibility without changes to public interface. Progress can be followed on pull request