35. putting it together
type_to_table relationships for
entity 3, “Site.”
rel_id entity_a entity_b rel_type
7 Site (3) site (8) 1
11628 Site (3) meta (82) 1
94766 Site (3)
ldap_cache
(37716)
1
36. entities in PHP
➡ objects of class Entity
➡ linked to corresponding entity
in DB (if exists)
42. selector
common tasks
What properties of entities can we select
based on?
➡ Type
➡ Relationship to a specific entity
➡ Has a property with a specific value
➡ ...?
49. selector
an example:
Select all media works from a site
➡$es = new Entity_Selector($site);
➡$es->add_type(id_of(„av‟));
➡$result = $es->run_one()
50. selector
another example:
Select all images related to a news item (for
this site!)
➡$es = new Entity_Selector($site);
➡$es->add_type(id_of(„image‟));
➡$es->add_right_relationship(
$news_id,
relationship[_id_of(„news_to_image‟)
);
➡$result = $es->run_one()
55. other thoughts
that guy sitting next to you is
AMAZING with $es.
➡ bigger selectors are not better.
➡ limit_tables, limit_fields
➡ fifth parameter of add_left_rel_field
➡ google group: reason-cms