I have entity type payment and need count all payments (calculate based on field_total), if its hard to undersand, I show it on example:
Payment A - $10 Payment B - $20 Payment C - $30
And I need query that SUM all values. In my example it will be $60.
$query = new EntityFieldQuery(); $entities = $query->entityCondition('entity_type', 'node', '=') ->entityCondition('bundle', 'payment') ->execute();
What is best method to solve this problem? I could select all nids and load it. But this is not very good if I have thousands nodes, or Iam wrong?
Thank you for advice.