Answer the question
In order to leave comments, you need to log in
How to get the most viewed entities using EntityFieldQuery?
How to use EntityFieldQuery to get 10 objects with the best number of views per day (daycount from the statistics module)?
My code which renders an entity but how to get better views?
function rp_offer_page_active_offer($org_nid) {
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'offer')
->propertyCondition('status', NODE_PUBLISHED)
->fieldCondition('field_offer_id_org', 'target_id', $org_nid)
->fieldCondition('field_offer_arch', 'value', '1', '<>')
->range(0, 10)
->addMetaData('account', user_load(1));
$result = $query->execute();
return array_keys($result['node']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question