1

I would like to perform a query to find the node flagged with a "myflag" based on a node field value. Is it possible to use EntityFieldQuery to accomplish that? If not, how can I use Views api to do it?

1 Answer 1

1

Don't need to use EntityFieldQuery or views to perform this flag module has already give function to get is_flagged(). All you need to call functions like.

$flag = flag_get_flag('myflag');
$flag->is_flagged($node->nid);
if($flag && $flag->is_flagged($node->nid)) {
  print "This node is myflag!";
}
1
  • tanks for you fast answer, But how can I query the nodes form database to perform the " is_flagged" test on them Commented Sep 15, 2015 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.