Propel or Doctrine for ZF integration - php

I have never used any ORM, but the Zend_Db_Table (if you can call it one). I'd like give it a try with some famous ROM and I've only heard of these 2 (Propel and Doctrine).
I tried sometimes in the past but I found it too hard to integrate or maybe I didn't understand how it works.
Now that I'm trying again, I'd like to know which one has easier integration with Zend Framework and which one is easier to work and why

Doctrine and Propel are definitely the two best know PHP ORM's among some others.
Doctrine has definitely seen some more love from ZF and there is rumors that Doctrine 2 will play a major role in ZF2, though afaik nothing as been confirmed as of this writing.
Here is some links for you to follow:
Integrating Propel with the Zend Framework (2006)
Brandon Savage: The Adventures Of Merging Propel With Zend Framework
and
Ruben Vermeersch: Integrating Zend Framework and Doctrine 1.x
Matthew Weier O'Phinney: Autoloading Doctrine and Doctrine entities from Zend Framework
Doctrine 2 and Zend Framework first date
Also see these two questions that have additional information and links:
Zend Framework 1.9 and Doctrine Integration
Integrate Doctrine with Zend Framework 1.8 app
Should not be hard to find many more for Doctrine.
EDIT very nice one from Phil's comment:
Zend Framework / Doctrine integration suite

Related

Existing Zend 1.10 framework project incorporating Symfony 2 framework

I've got an existing project using zend 1.10 framework. I'm not fond of zend but I can't sell the idea of converting over to symfony, I'd like to just incorporate symfony 2 into the code base and at least use it for new code (doctrine, forms and twig templates at least, even if I'm stuck with zends' MVC structure).
Not sure how to go about setting this up. I see lots of mention of using Zend classes in Symfony but not the other way around.
You can use Twig and Doctrine with ZF, so that's no problem. However the forms component is not on the list of stand alone components for Symfony 2 so implementing Symfony 2 forms in ZF 1.10 might be tricky.
Good Luck.

Manage ACL with Zend Framework and Doctrine 2

Does anyone know how to deal with ACL and Doctrine 2 inside a Zend Framework 1.11.10 Project ?
Thanks.
Regards.
The ACLs are handled with Zend_ACL(), and as you do not have to use Zend_Db or Zend_Table or whatever classes Zend Framework provides, Doctrine-Integration should be as intended by the doctrine-manual. Here's an article on how to do it with Doctrine - it should be easily adaptable to Doctrine2.

Getting started with Doctrine for Zend

I'm trying to get started with Doctrine for Zend. There doesn't seem to be a lot out there to help me with this. I find the website and documentation a bit useless.
I'm currently looking at this webpage.
There are a few options. I can checkout from subversion or github. Install via PEAR. or download a package.
What should I be doing with the lines of code in the black boxes?
What do I do with a package once I've extracted it?
As an aside
Am I a little out of my depth? Is there anything I should be learning before I start tackling Doctrine?
You really should have a look at the Zend Framework webinars, and more specifically the one called Zend Framework v1 + Doctrine v2. It's got detailed instructions and links to GitHub where you can download the source presented in the webinar.
The presentation slides can be found at http://static.zend.com/topics/Zend-Framework-1-+-Doctrine-2.pdf.
Presentation summary :
Zend Framework (version 1) is an
enterprise grade, full stack MVC
framework and component library.
Doctrine (version 2) is an enterprise
grade, ORM (object-relational mapping)
framework for PHP 5.3. In this
webinar, the ZF and Doctrine teams
join forces to demonstrate how best to
integrate these two frameworks and
produce a ZF powered MVC application
where in which the "M" is powered by
Doctrine2. Familiarity of PHP 5.3
features is suggested. Presenter –
Ralph Schindler, Jonathan Wage and
Guilherme Blanco (87min) Dec 15 2010
You will have to register with Zend though (but that's free, so shouldn't pose any problems I guess).
Actually, there are some resources you could use to integrate Zend Framework and Doctrine. In example, you could follow this screencasts:
ZendCasts - Doctrine
I've followed these screencasts, with a few corrections, and I was able to use Doctrine 1.x with Zend Framework applications. You can also view the generated screencasts' code; this option is available in the most of these screen casts.
You will want to use Doctrine 2, not version 1.2. The two are not compatible. Here is a presentation that explains why:
http://www.slideshare.net/ralphschindler/zend-framework-1-doctrine-2-6177485
Here are example sources for Zend Framework + Doctrine 2 integration:
https://github.com/fierycode/ZendFramework1-Doctrine2
https://github.com/marsbomber/zf1-doctrine2/tree/modular_setup (with modules)
I have already pointed someone in the right direction to integrate Doctrine 1.2 into ZF, my post can be found here.
I hope this helps you out.

Starting with Doctrine. Which version is good to?

I'm using Zend Framework and I feel that I need a good ORM to work with. I don't know much of Zend Framework, I just know how to do the basics. I expect to work together with both Doctrine and Zend Framework
But to sget started, I'm going to try a simple Doctrine project (no ZF) to get used to the application. Then I'll try to integrate it in ZF
Which version of Doctrine do I start learning? Does Doctrine have a good integration with ZF?
Besides,
Is there any recent site for Doctrine learning? I just can't find the sandbox version to follow the Doctrine documentation. If anyone knows of any tutorial on how to get started with doctrine only first, please let me know
I've done projects with zend framework and doctrine. They play pretty nice together.
I followed this tutorial and it worked well.
But honestly I don't use doctrine on anything but the largest sites. I've switched over to RedBean. Zero configuration autodiscovery, and the ability to freeze data models when you are done for maximum performance.
You should really try it out, it is so simple its stupid. It is really one of the best ORM's ive ever used. EVER. Try it.
I am personally using Doctrine 1.2
and i followed the Zendcasts.com "more than 5 casts about doctrine" & same Byron's tuts
both of them is good
Update :
1- http://www.zendcasts.com/deep-integration-between-zend-and-doctrine-1-2/2010/01/ has the sample code
2- http://www.doctrine-project.org/projects/orm/1.2/download/1.2.3 has the doctrine framework if you need to download it alone
I've found Doctrine2 reasonable stable, although it's still in beta. It seems most of the other PHP 'ORM' libraries (Doctrine 1.2 included) are Active Record, while Doctrine2 is a Data Mapper. In my opinion, you can put together a relatively simple Active Record using Zend's native Db_Table, so that makes Doctrine 1.2 less appealing (at least to me).
I've used this answer about integrating Doctrine2 and Zend Framework.
I agree with Byron, and have only used Doctrine2 on select projects.
[As an aside, I've noticed RedBean in the past, and have wanted to try it - from what I've seen it's certainly worth taking a look.]
Doctrine 2 is in beta and requires PHP5.3 as it fully utilizes Namespaces. If you cannot use PHP5.3 in your project, you cannot use Doctrine 2.
Apart from that, there has been a number of architectural changes in Doctrine 2 that make it much more attractive than Doctrine < 2, mainly
using DataMapper instead of ActiveRecord
promotes DI over static calls
faster and less memory-intensive
revolves around Entities and DDD
uses "Annotations"
See
http://architects.dzone.com/articles/doctrine-1-doctrine-2
http://www.slideshare.net/jwage/doctrine-2-not-the-same-old-php-orm

Any app examples for Propel & Zend

I found a few Zend sample applications but all of them use Zend_DbTable. Does anyone know of a full Zend example application built with Propel to learn from?
I don't know of any complete applications, though there are quite a few articles on how to set it up. Just make sure you initialize Propel in your bootstrap, and then use your Propel classes as per usual. There's nothing special about it...
How to Zend Framework with Propel ORM could be handy.

Categories