Author: francois
Date: 2010-05-12 00:22:16 +0200 (Wed, 12 May 2010)
New Revision: 29414
Modified:
plugins/sfPropel15Plugin/trunk/lib/form/sfFormPropel.class.php
Log:
[sfPropel15Plugin] added a configuration option to change collection form class
Modified: plugins/sfPropel15Plugin/trunk/lib/form/sfFormPropel.class.php
===================================================================
--- plugins/sfPropel15Plugin/trunk/lib/form/sfFormPropel.class.php
2010-05-11 22:16:05 UTC (rev 29413)
+++ plugins/sfPropel15Plugin/trunk/lib/form/sfFormPropel.class.php
2010-05-11 22:22:16 UTC (rev 29414)
@@ -20,7 +20,6 @@
*/
abstract class sfFormPropel extends sfFormObject
{
- protected $ignoreIfEmpty = false;
protected $fixedValues = array();
/**
@@ -98,7 +97,6 @@
*/
protected function doUpdateObject($values)
{
- print_r($values);
$values = array_merge($values, $this->getFixedValues());
$this->getObject()->fromArray($values, BasePeer::TYPE_FIELDNAME);
}
@@ -361,11 +359,12 @@
public function getRelationForm($relationName, $options = array())
{
$options = array_merge(array(
- 'embedded_form_class' => null,
- 'item_pattern' => '%index%',
- 'add_empty' => false,
- 'empty_name' => null,
- 'hide_on_new' => false,
+ 'collection_form_class' => 'sfFormPropelCollection',
+ 'embedded_form_class' => null,
+ 'item_pattern' => '%index%',
+ 'add_empty' => false,
+ 'empty_name' => null,
+ 'hide_on_new' => false,
), $options);
if ($this->getObject()->isNew() && $options['hide_on_new'])
@@ -392,7 +391,8 @@
}
// create the relation form
- $collectionForm = new sfFormPropelCollection($collection, array(
+ $collectionFormClass = $options['collection_form_class'];
+ $collectionForm = new $collectionFormClass($collection, array(
'embedded_form_class' => $options['embedded_form_class'],
'item_pattern' => $options['item_pattern'],
'remove_fields' => $relationFields,
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.