How to clear or empty the Array Collection in doctrine symfony

Viewed 22535

I have the Array collection of objects like this

Class User
{
    private $tasks;
}

How can i empty or clear the collection once user gets loaded from database.

When i query for user then Doctrine will lazy load the tasks in user object but i want to first clear those tasks

something like

$user->getTasks().empty()

1 Answers
Related