My listener is part of a behavior, that should remove all is_published checks in the where clause of any called select query. Adding a part to a clause is really easy, but how to remove one.
There are some functions like
'is_published = ?'
...FROM Video v WHERE v.is_published = ? AND v.start_date < ? AND v.end_date > ?
...FROM Video v WHERE v.start_date < ? AND v.end_date > ?
$query->getDqlPart('where') will return an
array of the parts of the where clause as they were added via the
andWhere(), etc functions. So you can use that to find and remove the part you want.
Then you have to deal with the params. While cycling through the where parts you would need to find all ? and count them and remember the numbers for any of the ones you remove and then call
$params = $query->getParams(); and the where clause parameters will be in
$params['where'] so you can remove them from there and then call