drupalcamp israel 2012

20
Roy Segall @RoySegall Sandbox : http://drupal.org/sandbox/RoySegall/1799834 - לללל לEntities

Upload: roy-segall

Post on 20-Jun-2015

290 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Drupalcamp israel 2012

Roy Segall

@RoySegallSandbox :http://drupal.org/sandbox/RoySegall/1799834

Entitiesמבוא ל-

Page 2: Drupalcamp israel 2012

Entity

Page 3: Drupalcamp israel 2012

Entity

ייצוג נתונים בדרופל

Page 4: Drupalcamp israel 2012

Entity

ייצוג נתונים בדרופל

"אבני הבניין"

Page 5: Drupalcamp israel 2012

entity_type node

Page 6: Drupalcamp israel 2012

entity_type

bundle

node

node_type(image, blog, forum etc.

Page 7: Drupalcamp israel 2012

entity_type

bundle

entity ID 1

node

node_type(image, blog, forum etc.

Node ID 1

Page 8: Drupalcamp israel 2012
Page 9: Drupalcamp israel 2012

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

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

EntityFieldQuery examples

Page 10: Drupalcamp israel 2012

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

foreach (array_keys($result['node']) as $nid) { $node = node_load($nid);}

EntityFieldQuery examples

Page 11: Drupalcamp israel 2012

$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

Page 12: Drupalcamp israel 2012

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

EntityFieldQuery examples

Page 13: Drupalcamp israel 2012

Entity metatdata wrapper

Page 14: Drupalcamp israel 2012

באמצעות פונקציות זהות.propertyעריכה ושמירת שדות ו-

Entity metatdata wrapper

Page 15: Drupalcamp israel 2012

באמצעות פונקציות זהות.propertyעריכה ושמירת שדות ו-

Entityגישה קלה ליישויות מקושרות )באמצעות המודול reference)

Entity metatdata wrapper

Page 16: Drupalcamp israel 2012

Entity metadata wrapper

Page 17: Drupalcamp israel 2012

Entity metadata wrapper

Page 18: Drupalcamp israel 2012

Entity metadata wrapper

Page 19: Drupalcamp israel 2012

Organic groups

Commerce

Message

Entityדוגמאות לשימוש ב-

Page 20: Drupalcamp israel 2012

Q&A