title: Ignore duplicates when using INSERT in a Database with Symfony and Doctrine
body: <p>I have a table</p>
  
  <pre><code>CREATE TABLE `sob_tags_articles` (
    `tag_id` int(11) NOT NULL,
    `article_id` int(11) NOT NULL,
    `id` int(11) NOT NULL auto_increment,
    PRIMARY KEY  (`id`)
  ) ENGINE=MyISAM AUTO_INCREMENT=112
  </code></pre>
  
  <p>And triing to save an object with Doctrine:</p>
  
  <pre><code>$sbTagsArticles = new SobTagsArticles();
  $sbTagsArticles-&gt;article_id = $pubId;
  $sbTagsArticles-&gt;tag_id = $tagId;
  $sbTagsArticles-&gt;save();
  </code></pre>
  
  <p>But if record exists with the same $pubId and $tagId new record will be insertet with new PK. </p>
  
  <p>How to do INSERT IGNORE into table with symfony?</p>
  
  <pre><code>$sbTagsArticles-&gt;isNew();
  </code></pre>
  
  <p>returns 1.</p>
  
  <p>Thnx.</p>