Skip to main content
fixed broken code syntax
Source Link
greggles
  • 5.3k
  • 21
  • 37

It can't - an EntityFieldQuery will only ever load the entity ID, and the bundle keys.

There's no choice but to use node_load_multiple() (or the equivalent if using a different entity type).

$nodes = node_load_multiple(array_keys($results['node'$results['node']));

Bear in mind that the $conditions parameter of node_load_multiple() is deprecated; in favour of EntityFieldQuery as I understand it.

You could theoretically subclass EntityFieldQuery and override the execute() method to return the fully loaded entities - but you'll also need to extend the class so it always knows what entity type it's querying for; otherwise it won't know which key to use in $results.

It can't - an EntityFieldQuery will only ever load the entity ID, and the bundle keys.

There's no choice but to use node_load_multiple() (or the equivalent if using a different entity type).

$nodes = node_load_multiple(array_keys($results['node'));

Bear in mind that the $conditions parameter of node_load_multiple() is deprecated; in favour of EntityFieldQuery as I understand it.

You could theoretically subclass EntityFieldQuery and override the execute() method to return the fully loaded entities - but you'll also need to extend the class so it always knows what entity type it's querying for; otherwise it won't know which key to use in $results.

It can't - an EntityFieldQuery will only ever load the entity ID, and the bundle keys.

There's no choice but to use node_load_multiple() (or the equivalent if using a different entity type).

$nodes = node_load_multiple(array_keys($results['node']));

Bear in mind that the $conditions parameter of node_load_multiple() is deprecated; in favour of EntityFieldQuery as I understand it.

You could theoretically subclass EntityFieldQuery and override the execute() method to return the fully loaded entities - but you'll also need to extend the class so it always knows what entity type it's querying for; otherwise it won't know which key to use in $results.

added 281 characters in body
Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337

It can't - an EntityFieldQuery will only ever load the entity ID, and the bundle keys.

There's no choice but to use node_load_multiple() (or the equivalent if using a different entity type).

$nodes = node_load_multiple(array_keys($results['node'));

Bear in mind that the $conditions parameter of node_load_multiple() is deprecated; in favour of EntityFieldQuery as I understand it.

You could theoretically subclass EntityFieldQuery and override the execute() method to return the fully loaded entities - but you'll also need to extend the class so it always knows what entity type it's querying for; otherwise it won't know which key to use in $results.

It can't - an EntityFieldQuery will only ever load the entity ID, and the bundle keys.

There's no choice but to use node_load_multiple() (or the equivalent if using a different entity type).

$nodes = node_load_multiple(array_keys($results['node'));

Bear in mind that the $conditions parameter of node_load_multiple() is deprecated; in favour of EntityFieldQuery as I understand it.

It can't - an EntityFieldQuery will only ever load the entity ID, and the bundle keys.

There's no choice but to use node_load_multiple() (or the equivalent if using a different entity type).

$nodes = node_load_multiple(array_keys($results['node'));

Bear in mind that the $conditions parameter of node_load_multiple() is deprecated; in favour of EntityFieldQuery as I understand it.

You could theoretically subclass EntityFieldQuery and override the execute() method to return the fully loaded entities - but you'll also need to extend the class so it always knows what entity type it's querying for; otherwise it won't know which key to use in $results.

Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337

It can't - an EntityFieldQuery will only ever load the entity ID, and the bundle keys.

There's no choice but to use node_load_multiple() (or the equivalent if using a different entity type).

$nodes = node_load_multiple(array_keys($results['node'));

Bear in mind that the $conditions parameter of node_load_multiple() is deprecated; in favour of EntityFieldQuery as I understand it.