Chapter 11 of the symfony Forms Book focuses on how the sfDoctrinePlugin integrates with the symfony forms framework. The chapter is essentially a port of the Propel version and has updates for the differences between Propel and Doctrine syntax. The sfDoctrinePlugin is equal to sfPropelPlugin and implements all the same tasks and functionality. For those of you curious about what version of the plugin you should be using with symfony, check the plugin page or read below.
Versions
- symfony 1.0 - http://svn.symfony-project.com/plugins/sfDoctrinePlugin/branches/1.0/
- symfony 1.1 - http://svn.symfony-project.com/plugins/sfDoctrinePlugin/branches/1.1/
- symfony 1.2 - http://svn.symfony-project.com/plugins/sfDoctrinePlugin/trunk/
As of symfony 1.2, sfDoctrinePlugin is bundled with symfony so including it in your plugins folder is no longer necessary.
What is next?
- The symfony and Doctrine Book
- PEAR packages for 1.0 and 1.1
- Continued maintenance of the plugin for 1.0(gnat42), 1.1(me) and 1.2(me)
If you're interesting in helping maintain the plugin for your version of symfony, feel free to reach out to me.
Awesome 0o
Thanks!
Great one. What I like most about Doctrine-powered forms is summed up in this sentence "When a Doctrine form is valid, the save() method updates the related object and stores it in the database."
In clear, you can have a sfGuard form, define a relationship to your UserProfile model, name it "Profile", then you can just embed the UserProfileForm under the name "Profile" ($this->embedForm('Profile', new UserProfileForm())) in a registration form for instance, and a call to save() will automatically save the profile data into the UserProfile table. This is incredibly powerful..
I'm just curious as to why the doctrine form generators are not as grainular as they could be. For example, Doctrine offers many types of column validation, it would be nice if the generators took advantage of this. I would be willing to put some time into this if it's not already planned for 1.2. Also, this maybe an over site on my part by why not just use Doctrines model validators to check for valid data. Maybe it's because symfony wishes to abstract validation. Thoughts would be appreciated.