EntityFieldQuery condition How can i ommit an condition in Entity Field Query if variable do not exist, for example

-&gt;fieldCondition('field_filter_color', 'tid', $filter_color)


Recieves in $filter_color one term id.
But there are situations where $filter_color is not present, so i would like to do:
if $filter_color is empty, ignore this condition.

Alternative is to present it as an array like

-&gt;fieldCondition('field_filter_color', 'tid', $filter_color, 'IN')


and prepopulate all values in $filter_color, and if $filter_color is chosen, create array with only one value, but i am not sure it is best way to do it.
You can simply do this:

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'node');
// all other conditions go here

if (isset($my_field_val)) {
  $query-&gt;fieldCondition('my_field', 'value', $my_field_val);
}
$result = $query-&gt;execute();


Untried code as I don't have access to my files at the moment.