Author: Jonathan.Wage
Date: 2010-03-30 23:00:43 +0200 (Tue, 30 Mar 2010)
New Revision: 28903

Modified:
   branches/1.3/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php
   branches/1.4/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php
Log:
[1.3, 1.4] Adding missing arguments to embedRelation() (closes #8222)


Modified: 
branches/1.3/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php
===================================================================
--- branches/1.3/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php 
2010-03-30 20:57:27 UTC (rev 28902)
+++ branches/1.3/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php 
2010-03-30 21:00:43 UTC (rev 28903)
@@ -101,10 +101,12 @@
    * @param  string $relationName  The name of the relation and an optional 
alias
    * @param  string $formClass     The name of the form class to use
    * @param  array  $formArguments Arguments to pass to the constructor 
(related object will be shifted onto the front)
+   * @param string  $innerDecorator A HTML decorator for each embedded form
+   * @param string  $decorator      A HTML decorator for the main embedded form
    *
    * @throws InvalidArgumentException If the relationship is not a collection
    */
-  public function embedRelation($relationName, $formClass = null, $formArgs = 
array())
+  public function embedRelation($relationName, $formClass = null, $formArgs = 
array(), $innerDecorator = null, $decorator = null)
   {
     if (false !== $pos = stripos($relationName, ' as '))
     {
@@ -122,7 +124,7 @@
 
     if (Doctrine_Relation::ONE == $relation->getType())
     {
-      $this->embedForm($fieldName, 
$r->newInstanceArgs(array_merge(array($this->getObject()->$relationName), 
$formArgs)));
+      $this->embedForm($fieldName, 
$r->newInstanceArgs(array_merge(array($this->getObject()->$relationName), 
$formArgs)), $decorator);
     }
     else
     {
@@ -132,11 +134,11 @@
       {
         $form = $r->newInstanceArgs(array_merge(array($childObject), 
$formArgs));
 
-        $subForm->embedForm($index, $form);
+        $subForm->embedForm($index, $form, $innerDecorator);
         $subForm->getWidgetSchema()->setLabel($index, (string) $childObject);
       }
 
-      $this->embedForm($fieldName, $subForm);
+      $this->embedForm($fieldName, $subForm, $decorator);
     }
   }
 

Modified: 
branches/1.4/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php
===================================================================
--- branches/1.4/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php 
2010-03-30 20:57:27 UTC (rev 28902)
+++ branches/1.4/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php 
2010-03-30 21:00:43 UTC (rev 28903)
@@ -101,10 +101,12 @@
    * @param  string $relationName  The name of the relation and an optional 
alias
    * @param  string $formClass     The name of the form class to use
    * @param  array  $formArguments Arguments to pass to the constructor 
(related object will be shifted onto the front)
+   * @param string  $innerDecorator A HTML decorator for each embedded form
+   * @param string  $decorator      A HTML decorator for the main embedded form
    *
    * @throws InvalidArgumentException If the relationship is not a collection
    */
-  public function embedRelation($relationName, $formClass = null, $formArgs = 
array())
+  public function embedRelation($relationName, $formClass = null, $formArgs = 
array(), $innerDecorator = null, $decorator = null)
   {
     if (false !== $pos = stripos($relationName, ' as '))
     {
@@ -122,7 +124,7 @@
 
     if (Doctrine_Relation::ONE == $relation->getType())
     {
-      $this->embedForm($fieldName, 
$r->newInstanceArgs(array_merge(array($this->getObject()->$relationName), 
$formArgs)));
+      $this->embedForm($fieldName, 
$r->newInstanceArgs(array_merge(array($this->getObject()->$relationName), 
$formArgs)), $decorator);
     }
     else
     {
@@ -132,11 +134,11 @@
       {
         $form = $r->newInstanceArgs(array_merge(array($childObject), 
$formArgs));
 
-        $subForm->embedForm($index, $form);
+        $subForm->embedForm($index, $form, $innerDecorator);
         $subForm->getWidgetSchema()->setLabel($index, (string) $childObject);
       }
 
-      $this->embedForm($fieldName, $subForm);
+      $this->embedForm($fieldName, $subForm, $decorator);
     }
   }
 

-- 
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.

Reply via email to