Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vjousse/dodoctrinecollectionformplugin
This "plugin" allows you to embed and save doctrine (object) forms into a non object form.
https://github.com/vjousse/dodoctrinecollectionformplugin
Last synced: about 1 month ago
JSON representation
This "plugin" allows you to embed and save doctrine (object) forms into a non object form.
- Host: GitHub
- URL: https://github.com/vjousse/dodoctrinecollectionformplugin
- Owner: vjousse
- License: mit
- Created: 2010-04-25T22:11:11.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-01-02T15:19:49.000Z (almost 14 years ago)
- Last Synced: 2024-10-08T04:21:21.405Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 93.8 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
doDoctrineCollectionFormPlugin
========================================================Overview
--------This "plugin" is a simple form class. It allows you to embed and save doctrine
(object) forms into a non object form. But why ? Because you can call the save()
or bindAndSave() method on form embedding the object forms.Installation
------------Install the plugin into your plugin directory (with a git clone or
by downloding a tgz)Enabled it in `ProjectConfiguration.class.php`
[php]
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins(array(
'doDoctrineCollectionFormPlugin',
'...'
));
}
}Usage
-----Your form must inherit from doDoctrineCollectionForm
[php]
class MealCommandCollectionForm extends DoctrineCollectionForm
{public function configure()
{$this->embedForm('firstObjectForm', new FirstObjectForm($myObject));
$this->embedForm('secondObjectForm', new SecondObjectForm($my2Object));
...}
}That's all ! Your DoctrineCollectionForm is not bound to any object but you can
call save() and bindAndSave() method on it, it will correctly save the
embedded forms.