The document discusses integrating the Zend Framework and Doctrine ORM frameworks. It provides an overview of Zend Framework's persistence capabilities and Doctrine's ORM features. It then outlines the ZFDoctrine integration package, which aims to integrate the two frameworks without requiring code generation. The package includes a Zend application resource, Zend tool integration, and other components. The document also discusses conventions for modeling classes and provides an example of generating models from a YAML schema file.
1. Just married: Zend
Framework and Doctrine
Benjamin Eberlei
direkt effekt GmbH
IPC Spring 2010
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 1 / 55
2. About Me
Benjamin Eberlei
direkt effekt GmBH
(digital marketing)
Open Source contributor
(Zend Framework and Doctrine)
Twitter @beberlei
Blog: www.whitewashing.de
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 2 / 55
4. Model vs Persistence
Model
=
Your code
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 4 / 55
5. Model vs Persistence
Persistence
=
Framework Code
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 5 / 55
6. Model vs Persistence
Model = Your code
Persistence = Framework Code
You can implement the same
business logic using any persistence
solution out there!
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 6 / 55
7. Zend Framework Persistence
Zend Db - Abstraction Layer
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 7 / 55
8. Zend Framework Persistence
Zend Db - Abstraction Layer
Zend Db Select - SQL Query Object
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 7 / 55
9. Zend Framework Persistence
Zend Db - Abstraction Layer
Zend Db Select - SQL Query Object
Zend Db Table - Table/Row Data
Gateway pattern
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 7 / 55
10. Zend Framework Persistence
Zend Db - Abstraction Layer
Zend Db Select - SQL Query Object
Zend Db Table - Table/Row Data
Gateway pattern
No Object-Relational Mapping Support!
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 7 / 55
11. Doctrine 1
Object-Relational Mapping, Active Record
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 8 / 55
12. Doctrine 1
Object-Relational Mapping, Active Record
Doctrine Query Language
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 8 / 55
13. Doctrine 1
Object-Relational Mapping, Active Record
Doctrine Query Language
Hydrators
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 8 / 55
14. Doctrine 1
Object-Relational Mapping, Active Record
Doctrine Query Language
Hydrators
Database Migrations
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 8 / 55
16. Doctrine Modelling Workflow
1. Setup Doctrine Bootstrap
2. Define a YAML Schema
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 9 / 55
17. Doctrine Modelling Workflow
1. Setup Doctrine Bootstrap
2. Define a YAML Schema
3. Generate Model and Table PHP classes
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 9 / 55
18. Doctrine Modelling Workflow
1. Setup Doctrine Bootstrap
2. Define a YAML Schema
3. Generate Model and Table PHP classes
4. Generate Database Schema from Models
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 9 / 55
19. Doctrine Modelling Workflow
1. Setup Doctrine Bootstrap
2. Define a YAML Schema
3. Generate Model and Table PHP classes
4. Generate Database Schema from Models
5. Repeat (2)-(4) for Iterations of your models.
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 9 / 55
20. Doctrine Modelling Workflow
1. Setup Doctrine Bootstrap
2. Define a YAML Schema
3. Generate Model and Table PHP classes
4. Generate Database Schema from Models
5. Repeat (2)-(4) for Iterations of your models.
6. In production, use migrations for schema
evolvement.
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 9 / 55
21. A Doctrine Project Layout
Non-PEAR Structure
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 10 / 55
22. A Doctrine Project Layout
Non-PEAR Structure
No Module Prefixes
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 10 / 55
23. A Doctrine Project Layout
Non-PEAR Structure
No Module Prefixes
Autoloading?
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 10 / 55
24. A Doctrine Project Layout
Non-PEAR Structure
No Module Prefixes
Autoloading?
Configurable (PEAR)..
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 10 / 55
25. A Doctrine Project Layout
Non-PEAR Structure
No Module Prefixes
Autoloading?
Configurable (PEAR)..
..Not enough for ZF!
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 10 / 55
26. Zend Framework Projects
Model * in models/
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 11 / 55
27. Zend Framework Projects
Model * in models/
Single Module Project
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 11 / 55
28. Zend Framework Projects
Model * in models/
Single Module Project
Not PEAR Standard
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 11 / 55
29. Zend Framework Projects
Model * in models/
Single Module Project
Not PEAR Standard
Special Autoloader
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 11 / 55
30. Modular ZF Project
Each Module has models/
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 12 / 55
31. Modular ZF Project
Each Module has models/
Again Special Autoloader
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 12 / 55
32. ZF + Doctrine Integration
Not a ZF Component
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 13 / 55
33. ZF + Doctrine Integration
Not a ZF Component
Download:
http://github.com/beberlei/zf-doctrine
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 13 / 55
34. ZF + Doctrine Integration
Not a ZF Component
Download:
http://github.com/beberlei/zf-doctrine
One Goal: No code-generation
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 13 / 55
35. ZF + Doctrine Integration
Not a ZF Component
Download:
http://github.com/beberlei/zf-doctrine
One Goal: No code-generation
Includes:
1. Zend Application Resource
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 13 / 55
36. ZF + Doctrine Integration
Not a ZF Component
Download:
http://github.com/beberlei/zf-doctrine
One Goal: No code-generation
Includes:
1. Zend Application Resource
2. Zend Tool Integration
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 13 / 55
37. ZF + Doctrine Integration
Not a ZF Component
Download:
http://github.com/beberlei/zf-doctrine
One Goal: No code-generation
Includes:
1. Zend Application Resource
2. Zend Tool Integration
3. Zend Forms from Doctrine Metadata
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 13 / 55
38. ZF + Doctrine Integration
Not a ZF Component
Download:
http://github.com/beberlei/zf-doctrine
One Goal: No code-generation
Includes:
1. Zend Application Resource
2. Zend Tool Integration
3. Zend Forms from Doctrine Metadata
4. Paginator Adapter
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 13 / 55
39. ZF + Doctrine Integration
Not a ZF Component
Download:
http://github.com/beberlei/zf-doctrine
One Goal: No code-generation
Includes:
1. Zend Application Resource
2. Zend Tool Integration
3. Zend Forms from Doctrine Metadata
4. Paginator Adapter
5. Model List View Helper
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 13 / 55
40. Zend Application Resource
1. Install using Zend Tool:
zf create project forum
zf create-project doctrine –dsn=$DSN
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 14 / 55
41. Zend Application Resource
2. Register manually with Zend Application
resources . doctrine . connections . default . dsn = " "
pluginpaths . Z F D o c t r i n e _ A p p l i c a t i o n _ R e s o u r c e
= " ZFDoctrine / Application / Resource "
a u toloade r n a m e s p a c e s [] = " Doctrine "
a u toloade r n a m e s p a c e s [] = " ZFDoctrine
.
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 15 / 55
43. ZFDoctrine Conventions
Both ZF 1 and Doctrine 1 are magic boxes
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 17 / 55
44. ZFDoctrine Conventions
Both ZF 1 and Doctrine 1 are magic boxes
Enforcing Conventions
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 17 / 55
45. ZFDoctrine Conventions
Both ZF 1 and Doctrine 1 are magic boxes
Enforcing Conventions
Model Classes: $Module Model $Name:
1. Default Model User
2. Default Model Group
3. Forum Model Thread
4. Forum Model Board
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 17 / 55
46. ZFDoctrine Conventions
Both ZF 1 and Doctrine 1 are magic boxes
Enforcing Conventions
Model Classes: $Module Model $Name:
1. Default Model User
2. Default Model Group
3. Forum Model Thread
4. Forum Model Board
Define Metadata Attributes refClass, local,
model and foreign explicitly
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 17 / 55
47. A Doctrine Project
zf create project forum
zf create-project doctrine –dsn
Creating four essential Doctrine Directories:
application/configs/schema
application/configs/fixtures
application/configs/migrations
application/configs/sql
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 18 / 55
48. Example Yaml schema: Forum
Put a forum.yml in the schema directory:
F o rum_Mod e l _ C a t e g o r y :
columns :
name : string (50)
description : string (99999)
Forum_Mode l_Boar d :
columns :
category_id : integer (10)
name : string (100)
description : string (5000)
relations :
Category :
class : F o r u m _ Model_Category
local : category_id
foreign : id
Threads :
class : Fo ru m_ Model_Thread
local : id
foreign : board_id
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 19 / 55
49. Generate Models from Yaml
zf generate-models-from-yaml doctrine
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 20 / 55
53. Generated Model Classes
Records
Base Records
Tables
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 23 / 55
54. Code Generation?
Doctrine creates Models from Yaml files.
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 24 / 55
55. Code Generation?
Doctrine creates Models from Yaml files.
...optionally(!)
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 24 / 55
56. Code Generation?
Doctrine creates Models from Yaml files.
...optionally(!)
You can skip Yaml and directly code the
Model (Records and Tables)
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 24 / 55
57. Code Generation?
Doctrine creates Models from Yaml files.
...optionally(!)
You can skip Yaml and directly code the
Model (Records and Tables)
Zend Framework Project Support works
without Yaml.
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 24 / 55
58. Generated Record:
class For u m _ M o de l _ C ategory extends
Forum_Model_Base_Category
{
}
Generated Table:
class F o r u m _ M o d e l _ C a t e g o r y T a b le extends Doctrine_Table
{
public static function getInstance ()
{
return Doctrine_Core :: getTable (
’ F o r u m _ Model_Category ’) ;
}
}
Generated Base Record:
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 25 / 55
59. abstract class F o r u m _ M o d e l _ B a s e _ C a t e g o r y extends
Doctrine_Record
{
public function setTableDefinition ()
{
$this - > setTableName ( ’ forum_categories ’) ;
$this - > hasColumn ( ’ name ’ , ’ string ’ , 50 , array (
’ type ’ = > ’ string ’ ,
’ length ’ = > ’ 50 ’ ,
));
$this - > hasColumn ( ’ description ’ , ’ string ’ , 99999 ,
array (
’ type ’ = > ’ string ’ ,
’ length ’ = > ’ 99999 ’ ,
));
}
public function setUp ()
{
parent :: setUp () ;
$this - > hasMany ( ’ Forum_Model_Board ’ , array (
’ local ’ = > ’ id ’ ,
’ foreign ’ = > ’ category_id ’) ) ;
}
}
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 26 / 55
60. Generating Database
zf build-project doctrine –reload
Drop and Create Database
Create Tables
Load Fixtures
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 27 / 55
61. Migrations
Update your Database Schema:
zf show-migration doctrine
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 28 / 55
62. Migrations
Update your Database Schema:
zf show-migration doctrine
zf generate-migration doctrine
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 28 / 55
63. Migrations
Update your Database Schema:
zf show-migration doctrine
zf generate-migration doctrine
zf execute-migration doctrine
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 28 / 55
64. Forms for Doctrine Models
Using Doctrine Metadata for other, non
ORM purposes
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 29 / 55
65. Forms for Doctrine Models
Using Doctrine Metadata for other, non
ORM purposes
Configuration of Zend Form instances
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 29 / 55
66. Forms for Doctrine Models
Using Doctrine Metadata for other, non
ORM purposes
Configuration of Zend Form instances
Mostly for backend (scaffolding) purposes
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 29 / 55
67. A Simple Form
$form = new Z F D o c t r i ne_Fr om_M odel ( array (
’ model ’ = > ’ F o r um_Model_Category ’ ,
’ action ’ = > ’. ’ ,
’ method ’ = > ’ post ’
));
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 30 / 55
68. A Simple Form: Tweaking
$form = new Z F D o c t r i ne_Fo rm_M odel ( array (
’ model ’ = > ’ F o r um_Model_Category ’ ,
’ method ’ = > ’ post ’ ,
’ action ’ = > $this - > _helper - > url (
’add - category ’ , ’ admin ’) ,
’ fieldLabels ’ = > array (
’ name ’ = > ’ Name ’ ,
’ description ’ = > ’ Description ’ ,
),
’ fieldTypes ’ = > array (
’ description ’ = > ’ textarea ’ ,
),
));
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 31 / 55
69. A Simple Form: Tweaking
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 32 / 55
72. A Simple Form: Action Helper
public function add CategoryAction ()
{
$form = $this - > createCategoryForm () ;
$this - > _helper - > modelForm ( $form , ’ success ’) ;
}
public function e di tCategoryAction ()
{
$form = $this - > createCategoryForm () ;
$this - > getHelper ( ’ modelForm ’)
-> setRecordIdParam ( ’ id ’)
-> handleForm ( $form , ’ success ’) ;
}
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 35 / 55
73. Advanced Forms: Relations
Relations rendered as (multi-)select fields:
public function addBoardAction ()
{
$form = new Z F D o ctri ne_Fo rm_M odel ( array (
’ model ’ = > ’ Forum_Model_Board ’ ,
));
$this - > _helper - > modelForm ( $form , " success " ) ;
}
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 36 / 55
74. Advanced Forms: Relations
Relations rendered as (multi-)select fields:
public function addBoardAction ()
{
$form = new Z F D o ctri ne_Fo rm_M odel ( array (
’ model ’ = > ’ Forum_Model_Board ’ ,
));
$this - > _helper - > modelForm ( $form , " success " ) ;
}
Control Option Labels:
class For u m _ M o del _ C a tegory extends ...
{
public function __toString () {
return $this - > id . " , " . $this - > name ;
}
}
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 36 / 55
76. Advanced Forms: Hooks
Add Validators and Filters
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 38 / 55
77. Advanced Forms: Hooks
Add Validators and Filters
Change Decorators
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 38 / 55
78. Advanced Forms: Hooks
Add Validators and Filters
Change Decorators
Use jQuery or Dojo Integration
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 38 / 55
79. Advanced Forms: Hooks
Add Validators and Filters
Change Decorators
Use jQuery or Dojo Integration
Hook methods: preGenerate() and
postGenerate()
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 38 / 55
80. Advanced Forms: Hooks
Adding decorators in preGenerate():
class Forum _Form_T hread extends ZFDo ctrin e_Fo rm_Mo del
{
protected function _preGenerate ()
{
// called before the form is generated
$decorators = array (
’ FormElements ’ ,
array ( array ( ’ data ’= > ’ HtmlTag ’) , array ( ’ tag ’= > ’
table ’) ) ,
’ Form ’
);
$this - > setDecorators ( $decorators ) ;
}
}
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 39 / 55
81. Advanced Forms: Hooks
jQuery or Dojo Enable a Form:
class Forum _Form_T hread extends ZFDo ctrin e_Fo rm_Mo del
{
protected function _preGenerate ()
{
ZendX_JQuery :: enableForm ( $this ) ;
// Zend_Dojo :: enableForm ( $this ) ;
}
}
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 40 / 55
82. Advanced Forms: Hooks
Adding a validator in postGenerate():
class Forum _Form_T hread extends ZFDo ctrin e_Fo rm_Mo del
{
protected function _postGenerate ()
{
// called after the form is generated
$validator = new Z e n d _ V a l i d a t e _ S t r i n g L e n g t h (
array ( ’ min ’ = > 5 , ’ max ’ = > 255)
);
$this - > getElement ( ’ title ’)
-> addValidator ( $validator ) ;
}
}
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 41 / 55
83. Paginator Adapter
Paginate a Doctrine Query:
$query = Doctrine_Query :: create () ; // $query ...
$adapter =
new Z F D o c t r i n e _ P a g i n a t o r _ A d a p t e r _ D o c t r i n e Q u e r y ( $query ) ;
$paginator = new Zend_Paginator ( $adapter ) ;
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 42 / 55
84. Paginator Adapter
Paginate a Doctrine Query:
$query = Doctrine_Query :: create () ; // $query ...
$adapter =
new Z F D o c t r i n e _ P a g i n a t o r _ A d a p t e r _ D o c t r i n e Q u e r y ( $query ) ;
$paginator = new Zend_Paginator ( $adapter ) ;
Paginate a Doctrine Table:
$table = Doctrine_Core :: getTable ( ’ MyModel ’) ;
$query = $table - > createQuery () ;
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 42 / 55
85. Model List View Helper
Creates a paginated list for a model
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 43 / 55
86. Model List View Helper
Creates a paginated list for a model
Links to CRUD actions
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 43 / 55
87. Model List View Helper
Creates a paginated list for a model
Links to CRUD actions
Reasonable default Look & Feel
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 43 / 55
88. Model List View Helper
Creates a paginated list for a model
Links to CRUD actions
Reasonable default Look & Feel
But offers full customization
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 43 / 55
89. Model List View Helper
<h1 > Boards </ h1 >
<?= $this - > modelList ( ’ Forum_Model_Board ’) ; ? >
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 44 / 55
94. Zend Framework 2.0
Currently Conversion to Namespaces
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 48 / 55
95. Zend Framework 2.0
Currently Conversion to Namespaces
Specified Goals:
1. Ease the learning curve
2. Make extending the framework trivially
simple
3. Simplify
4. Favor the explicit over the magical
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 48 / 55
96. Zend Framework 2.0
Currently Conversion to Namespaces
Specified Goals:
1. Ease the learning curve
2. Make extending the framework trivially
simple
3. Simplify
4. Favor the explicit over the magical
ETA Q4/2010 or Q1/2011
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 48 / 55
97. Doctrine 2
Separation of DBAL and ORM
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 49 / 55
98. Doctrine 2
Separation of DBAL and ORM
Less Magic, More Explicit Design
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 49 / 55
99. Doctrine 2
Separation of DBAL and ORM
Less Magic, More Explicit Design
DataMapper instead of ActiveRecord
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 49 / 55
100. Doctrine 2
Separation of DBAL and ORM
Less Magic, More Explicit Design
DataMapper instead of ActiveRecord
Powerful Metadata Mapping
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 49 / 55
101. Doctrine 2
Separation of DBAL and ORM
Less Magic, More Explicit Design
DataMapper instead of ActiveRecord
Powerful Metadata Mapping
Considerable Performance Improvements
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 49 / 55
102. Doctrine 2
Separation of DBAL and ORM
Less Magic, More Explicit Design
DataMapper instead of ActiveRecord
Powerful Metadata Mapping
Considerable Performance Improvements
Currently Beta 1, Release on September 1st
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 49 / 55
103. Doctrine 2
Separation of DBAL and ORM
Less Magic, More Explicit Design
DataMapper instead of ActiveRecord
Powerful Metadata Mapping
Considerable Performance Improvements
Currently Beta 1, Release on September 1st
First class citizen in Symfony 2
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 49 / 55
104. Wednesday, 8:30, Room Salon 1
Guilherme on Doctrine 2!
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 50 / 55
105. Doctrine 2 DBAL
PDO API (ezcDatabase)
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 51 / 55
106. Doctrine 2 DBAL
PDO API (ezcDatabase)
Currently Support for MySql, PgSql,
Oracle, Sqlite, IBM and PDO Db2
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 51 / 55
107. Doctrine 2 DBAL
PDO API (ezcDatabase)
Currently Support for MySql, PgSql,
Oracle, Sqlite, IBM and PDO Db2
SqlSrv (+PDO) under development
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 51 / 55
108. Doctrine 2 DBAL
PDO API (ezcDatabase)
Currently Support for MySql, PgSql,
Oracle, Sqlite, IBM and PDO Db2
SqlSrv (+PDO) under development
Lots of Convenience Methods (Zend Db)
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 51 / 55
109. Doctrine 2 DBAL
PDO API (ezcDatabase)
Currently Support for MySql, PgSql,
Oracle, Sqlite, IBM and PDO Db2
SqlSrv (+PDO) under development
Lots of Convenience Methods (Zend Db)
Currently planned: A Query Object
(Zend Db Select, ezcDatabaseQuery)
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 51 / 55
110. Doctrine 2 DBAL
PDO API (ezcDatabase)
Currently Support for MySql, PgSql,
Oracle, Sqlite, IBM and PDO Db2
SqlSrv (+PDO) under development
Lots of Convenience Methods (Zend Db)
Currently planned: A Query Object
(Zend Db Select, ezcDatabaseQuery)
SQL DDL and Data-QL abstraction (PEAR
MDB2 and ezcDatabaseSchema)
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 51 / 55
111. Doctrine 2 DBAL Schema
An OO-Approach to Database Schema
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 52 / 55
112. Doctrine 2 DBAL Schema
An OO-Approach to Database Schema
Vendor independent abstraction of Tables,
Indexes, ForeignKeys and Sequences
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 52 / 55
113. Doctrine 2 DBAL Schema
An OO-Approach to Database Schema
Vendor independent abstraction of Tables,
Indexes, ForeignKeys and Sequences
Get required set-up or tear-down SQL
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 52 / 55
114. Doctrine 2 DBAL Schema
An OO-Approach to Database Schema
Vendor independent abstraction of Tables,
Indexes, ForeignKeys and Sequences
Get required set-up or tear-down SQL
Get SQL to move from one to another
schema
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 52 / 55
115. Doctrine 2 DBAL Schema
An OO-Approach to Database Schema
Vendor independent abstraction of Tables,
Indexes, ForeignKeys and Sequences
Get required set-up or tear-down SQL
Get SQL to move from one to another
schema
Doctrine Migrations
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 52 / 55
116. ZF 2 with Doctrine DBAL 2
First class support?
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 53 / 55
117. ZF 2 with Doctrine DBAL 2
First class support?
Doctrine 2 DBAL API compatible with
Zend Db?
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 53 / 55
118. ZF 2 with Doctrine DBAL 2
First class support?
Doctrine 2 DBAL API compatible with
Zend Db?
Zend Db Select drop-in replacement?
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 53 / 55
119. ZF 2 with Doctrine DBAL 2
First class support?
Doctrine 2 DBAL API compatible with
Zend Db?
Zend Db Select drop-in replacement?
Table-, Row-Data-Gateway?
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 53 / 55
120. ZF 2 with Doctrine DBAL 2
First class support?
Doctrine 2 DBAL API compatible with
Zend Db?
Zend Db Select drop-in replacement?
Table-, Row-Data-Gateway?
ORM Integration?
Eberlei (direkt effekt GmbH) ZF and Doctrine 1 IPC Spring 2010 53 / 55