EntityFieldQuery in a loop i'm using EntityFieldQuery to retrieve some nodes according to some conditions.

foreach (array("important", "normal") as $type) {
  $query = new EntityFieldQuery();
  $query-&gt;entityCondition("entity_type", "node")
    -&gt;entityCondition("bundle", "Announce")
    -&gt;fieldCondition("field_ann_cat", "value", array($nid))
    -&gt;fieldCondition("field_ann_type", "value", array($type));
  $result = $query-&gt;execute();
  var_dump($result);
  // Some actions
}


The first time it loops, i have my announces marked as "important" (field_ann_type).
The second time it loops, i dont have any announces marked as "normal".

I've tried to intervert them, and when i have array("normal", "important") instead of array("important", "normal") in my foreach, i can see my announces marked as "normal", but not my announces marked as "important".

Does anyone knows why?
Thanks.
It may be because you are doing this:

-&gt;fieldCondition("field_ann_type", "value", array($type));


try just check it against $type like this:

-&gt;fieldCondition("field_ann_type", "value", $type);