title: Insert multiple rows with one query in Symfony 1.4 and Doctrine
body: <p>I have collections of clients, and every collection can contain many clients. This PHP code loops collections, and clients inside every collection. And saves the client to the database.</p>
  
  <pre><code>foreach ($collections as $key =&gt; $collection) {
        foreach ($collection as $k =&gt; $client) {
                   $name = $client['name'];
                   //...
                   $clientObj = new Client();
                   $clientObj-&gt;setName($name);
                   //..
                   $clientObj-&gt;save();
        }
  }
  </code></pre>
  
  <p>What I want to do, is to group every collection in one Mysql query, then go to the next collection. Because the previous code executes one query per client, And for performance, we need one query per collection.</p>
  
  <p>How can we do that?</p>