Drupalcamp israel 2012
- 1. Entities -
Roy Segall
@RoySegall
http://drupal.org/sandbox/RoySegall/1799834: Sandbox
- 6. entity_type node
bundle node_type
.image, blog, forum etc )
- 7. entity_type node
bundle node_type
.image, blog, forum etc )
entity ID 1 Node ID 1
- 9. EntityFieldQuery examples
$query = new EntityFieldQuery ();
$query->entityCondition('entity_type', 'node');
$result = $query->execute();
array (
'node' => array (
1 => array(
'nid' => '1',
'vid' => '1',
'type' => 'article',
),
),
)
- 10. EntityFieldQuery examples
$query = new EntityFieldQuery ();
$query->entityCondition('entity_type' , 'node');
$result = $query->execute();
foreach (array_keys($result['node']) as $nid) {
$node = node_load($nid);
}
- 11. EntityFieldQuery examples
$query = new EntityFieldQuery ();
$query->entityCondition('entity_type' , 'node');
$result = $query->execute();
foreach (array_keys($result['node']) as $nid) {
$node = node_load($nid);
}
$query = new EntityFieldQuery ();
$query->entityCondition('entity_type , 'node);
$result = $query->execute();
$nodes = node_load_multiple (array_keys($result['node']));
- 12. EntityFieldQuery examples
$query = new EntityFieldQuery ();
$result = $query
->entityCondition('entity_type', 'node')
->propertyCondition('title', 'Foo')
->fieldCondition('field_text' , 'value', 'Bar')
->execute();