1

In reviewing the slow query log, some of them are entity-field queries. With a normal select query, I can have something like:

$query = "/*" . __FILE__ . ":" . __LINE__ . "*/ SELECT...

and with pdo object notation, I can add

->comment(__FILE__ . ":" . __LINE__)

but how do I add a comment to an entity-field query? Apparently comment() is not a valid method.

1 Answer 1

0

Provide the comment information via EntityFieldQuery::addMetaData, and then add the comment to the query in hook_entity_query_alter().

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.