title: How to clear or empty the Array Collection in doctrine symfony
body: <p>I have the Array collection of objects like this</p>
  
  <pre><code>Class User
  {
      private $tasks;
  }
  </code></pre>
  
  <p>How can i empty or clear the collection once user gets loaded from database.</p>
  
  <p>When i query for user then Doctrine will lazy load the tasks in user object but i want to first clear those tasks</p>
  
  <p>something like</p>
  
  <p><code>$user-&gt;getTasks().empty()</code></p>