Note that there are some explanatory texts on larger screens.

plurals
  1. POForm with embedded relation won't save Symfony 1.4 Doctrine
    primarykey
    data
    text
    <p>I have embedded the Mutt form within the Mix form: MixForm.class.php:</p> <pre><code>$this-&gt;embedRelation('Mutt'); $form = new MuttForm(null, array( 'mix' =&gt;$this-&gt;getObject(), )); $this-&gt;embedForm('Mutt', $form); $this-&gt;widgetSchema['Mutt'] = $form-&gt;getWidgetSchema(); $this-&gt;widgetSchema['Mutt']['mix_id'] = new sfWidgetFormInputHidden(); $this-&gt;validatorSchema['Mutt'] = $form-&gt;getValidatorSchema(); </code></pre> <p>I need the newly created id form for the Mix table to populate the mix_id field in the Mutt table.</p> <pre><code>&lt;?php echo $form-&gt;renderHiddenFields();?&gt; &lt;?php echo $form['name']-&gt;renderRow();?&gt; &lt;?php echo $form['parent1']-&gt;renderRow();?&gt; &lt;?php echo $form['parent2']-&gt;renderRow();?&gt; &lt;?php echo $form['parent3']-&gt;renderRow();?&gt; &lt;?php echo $form['parent4']-&gt;renderRow();?&gt; &lt;?php echo $form['parent5']-&gt;renderRow();?&gt; &lt;?php echo $form['Mutt']['creator']-&gt;renderRow();?&gt; &lt;?php echo $form['Mutt']['email']-&gt;renderRow();?&gt; &lt;?php echo $form['Mutt']['website']-&gt;renderRow();?&gt; &lt;?php echo $form['Mutt']['caption']-&gt;renderRow();?&gt; &lt;?php echo $form['Mutt']['photo']-&gt;renderRow();?&gt; &lt;?php echo $form['Mutt']['copyright']-&gt;renderRow();?&gt; &lt;?php echo $form['Mutt']-&gt;renderHiddenFields();?&gt; </code></pre> <p>Here is my action in modules/mix/actions/actions.class.php</p> <pre><code>public function executeEdit(sfWebRequest $request) { $this-&gt;form = new MixForm(); if($request-&gt;isMethod('post')): $this-&gt;form-&gt;bind($request-&gt;getParameter('mix'), $request-&gt;getFiles($this-&gt;form-&gt;getName())); if($this-&gt;form-&gt;isValid()): $this-&gt;form-&gt;save(); $this-&gt;redirect('pure/add'); endif; endif; } </code></pre> <p>The form validation works correctly, but it won't save in either database. What am I doing wrong??</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload