title: Update object instead of inserting with Doctrine using assignIdentifier()
body: <p>I'm pretty new to Doctrine, but as I understand it, the <code>assignIdentifier()</code> method is supposed to tell Doctrine to update the relevant row into the database instead of inserting a new one.</p>
  
  <p>I have an object that I'm building through a workflow, so the identifier has an <code>id</code> of <code>null</code> until I call <code>$object-&gt;save();</code> which inserts it, and this does work.</p>
  
  <p>If however I call <code>$object-&gt;assignIdentifier($newobj-&gt;id);</code> and then <code>$object-&gt;save();</code> it does nothing - it does not insert a new row and does not update the old one.</p>
  
  <p>If a certain condition is true, I want to pull a different record out of the DB and update that row instead of inserting the new one.</p>
  
  <p>Am I understanding something wrong here?</p>
  
  <p>Some code to illustrate:</p>
  
  <pre><code>if($this-&gt;object-&gt;payments &gt; 0) {           
      $older_payment = Doctrine_Query::create()
         -&gt;from('OldPaid p')
         -&gt;where('p.dealid = ?', $this-&gt;object-&gt;transid)
         -&gt;fetchOne()
      ;
  
      $this-&gt;object-&gt;assignIdentifier($older_payment-&gt;id);
  }
  
  $this-&gt;object-&gt;save();
  </code></pre>