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
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!";
}
-
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