際際滷

際際滷Share a Scribd company logo
Entities - 

                    Roy Segall

                       @RoySegall
http://drupal.org/sandbox/RoySegall/1799834: Sandbox
Entity
Entity

廢 廬 廨廚
Entity

廢 廬 廨廚

   " "
entity_type   node
entity_type   node


bundle        node_type
              .image, blog, forum etc )
entity_type   node


bundle        node_type
              .image, blog, forum etc )




entity ID 1   Node ID 1
Drupalcamp israel 2012
EntityFieldQuery examples

$query = new EntityFieldQuery ();
$query->entityCondition('entity_type', 'node');
$result = $query->execute();




array (
'node' => array (
1 => array(
'nid' => '1',
'vid' => '1',
'type' => 'article',
),
),
)
EntityFieldQuery examples


$query = new EntityFieldQuery (); 
$query->entityCondition('entity_type' , 'node');
$result = $query->execute();

foreach (array_keys($result['node']) as $nid) {
$node = node_load($nid);
}
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']));
EntityFieldQuery examples


$query = new EntityFieldQuery ();
$result = $query
->entityCondition('entity_type', 'node')
->propertyCondition('title', 'Foo')
->fieldCondition('field_text' , 'value', 'Bar')
->execute();
Entity metatdata wrapper
Entity metatdata wrapper

廣廨 廩廨廬 廩廬 -  property廢廣廬 廚廡廢廬 廬.
Entity metatdata wrapper

    廣廨 廩廨廬 廩廬 -  property廢廣廬 廚廡廢廬 廬.



廩 廡 廩廬 廡廩廨廬 )廢廣廬  )Entity reference
Entity metadata wrapper
Entity metadata wrapper
Entity metadata wrapper
Entity-廬 廩廩 

   Organic groups

     Commerce

      Message
Q&A

More Related Content

Drupalcamp israel 2012