SlideShare una empresa de Scribd logo
1 de 56
Andrew Bacon ‟13
Carleton College
me:
me:
me:
at WSG:
➡ entities
➡ relationships
entities:
stuff.
entities:
stuff like...
➡ sites ➡ news posts
➡ pages ➡ images, ...
➡ a cat
entities:
aggregations of
properties...
➡ id ➡ name
➡ type ➡ created_on, ...
entities:
some properties only
make sense for
certain types
entities:
some properties only make sense for certain
types, e. g.:
lol_cat boromir
breed
entities:
aggregations of
properties across
database tables.
➡ entity
➡ meta
➡ chunk
➡ newstype, image, ...
Some examples.
meta
➡ description
➡ keywords
chunk
➡ content
➡ author
image
➡ dimension
➡ image_type
newstype
➡ subtitle
➡ on_front_page
Some examples.
meta
➡ description
➡ keywords
chunk
➡ content
➡ author
image
➡ dimension
➡ image_type
newstype
➡ subtitle
➡ on_front_page
news post
Some examples.
meta
➡ description
➡ keywords
chunk
➡ content
➡ author
image
➡ dimension
➡ image_type
newstype
➡ subtitle
➡ on_front_page
image
not entities:
relationships
relationships
Things are related to other
things.
➡ entity_a and entity_b
relationships
silly examples:
nation_to_cat_monarch
relationships
silly examples:
lolrus_to_bukkit
relationships
real examples:
minisite_page_to_av
av_to_av_file
minisite_page_to_image
news_to_image
relationships
Things are related to other
things.
➡ directional
➡ entity_a and entity_b
detour:
relationships have direction.
➡ unidirectional
minisite_page_to_image
detour:
relationships have direction.
nation_to_cat_monarch
(disembodied)
detour:
relationships have direction.
➡ unidirectional
➡ bidirectional
site_to_user
detour:
real examples of directionality
➡ news_to_image
detour:
relationships have direction.
focus
related
news_post_to_...
detour:
relationships have direction.
image_to_... or ..._to_image
focus
related
relationships
Things are related to other
things.
➡ directional
➡ number-sensitive
➡ entity_a and entity_b
relationships
silly examples:
nation_to_cat_monarch
relationships
silly examples:
mom_to_kittens
relationships
real examples:
➡ news_to_image
relationships
Things are related to other
things.
➡ directional
➡ number-sensitive
➡ entity_a and entity_b
➡ pretty darn arbitrary
entities:
stuff like...
➡ sites ➡ news posts
➡ pages ➡ images, ...
➡ types?
➡ DB tables?!
➡ „type‟!?!?
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
entities in PHP
➡ objects of class Entity
➡ linked to corresponding entity
in DB (if exists)
entities in PHP
methods to know about
get_value($name, $value);
set_value($name);
id();
getting entities
entity constructor
entity selectors
the constructor
$e = new Entity($id);
the selector
$es =
new Entity_Selector($site);
selector
why I was afraid
➡ no formal introduction
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
➡ ...?
selector
add_type($id);
Will select only entities of the given type.
$es->add_type(id_of(„image‟));
selector
add_relation($where);
Selects only entities where a specific
property meets some condition.
$es->add_relation(
„status.status != “pending”‟
);
selector
add_left_relationship($id[, $rel_id]);
selected entities must exist on the left side
of a relationship with $entity_id on the right
side. Optional $relationship_id.
“get the parent of the
given entity.”
selector
add_right_relationship($id[, $rel_id])
selected entities must exist on the right side
of a relationship with $entity_id on the left
side. Optional $relationship_id.
“get the child of the given
entity.”
selector
set_env(
„site‟, $site_id
);
always set this.
not the same thing as the site id you set in
the $es constructor.
selector
run_one([$type, $status, $error]);
Run the darn thing!
Returns an array of entities.
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()
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()
selector
add_left_relationship_field(
$rel_name, $table, $field
);
If there are entities that are on the left side
of the given relationship, add the given
field.
selector
how to look up info about a type
Master admin -> types
more?!
you know enough now.
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
goodies!!!!
available at
go.carleton.edu/...
slides! cheat sheet!
!?!?

Más contenido relacionado

Destacado

Initial ideas
Initial ideasInitial ideas
Initial ideas
Luipapi
 
Goodwin's Theory
Goodwin's TheoryGoodwin's Theory
Goodwin's Theory
Luipapi
 
Seminar: 7 Habits And Barrier Of Customer Based Company.Dasmr
Seminar: 7 Habits And Barrier Of Customer Based Company.DasmrSeminar: 7 Habits And Barrier Of Customer Based Company.Dasmr
Seminar: 7 Habits And Barrier Of Customer Based Company.Dasmr
Djadja Sardjana
 
How to Apply
How to ApplyHow to Apply
How to Apply
mfbaf
 
Презентация процесса создания сайтов на Системе IM
Презентация процесса создания сайтов на Системе IMПрезентация процесса создания сайтов на Системе IM
Презентация процесса создания сайтов на Системе IM
niyazreaspekt
 

Destacado (17)

Qdoba presentation
Qdoba presentationQdoba presentation
Qdoba presentation
 
Initial ideas
Initial ideasInitial ideas
Initial ideas
 
Maserati quattroporte-stainless-steel-exhaust
Maserati quattroporte-stainless-steel-exhaustMaserati quattroporte-stainless-steel-exhaust
Maserati quattroporte-stainless-steel-exhaust
 
Schorn Construction Co Slideshow
Schorn Construction Co SlideshowSchorn Construction Co Slideshow
Schorn Construction Co Slideshow
 
Bumper Duvet cover sets
Bumper Duvet cover setsBumper Duvet cover sets
Bumper Duvet cover sets
 
Paternal Age Effect and other stories
Paternal Age Effect and other storiesPaternal Age Effect and other stories
Paternal Age Effect and other stories
 
Goodwin's Theory
Goodwin's TheoryGoodwin's Theory
Goodwin's Theory
 
PHL Tourism Industry Performance
PHL Tourism Industry PerformancePHL Tourism Industry Performance
PHL Tourism Industry Performance
 
Seminar: 7 Habits And Barrier Of Customer Based Company.Dasmr
Seminar: 7 Habits And Barrier Of Customer Based Company.DasmrSeminar: 7 Habits And Barrier Of Customer Based Company.Dasmr
Seminar: 7 Habits And Barrier Of Customer Based Company.Dasmr
 
Energy drink
Energy drinkEnergy drink
Energy drink
 
Hypothesis
HypothesisHypothesis
Hypothesis
 
Vacuum Verpakt Beter Verleng De Houdbaarheid Van Requirements
Vacuum Verpakt Beter   Verleng De Houdbaarheid Van RequirementsVacuum Verpakt Beter   Verleng De Houdbaarheid Van Requirements
Vacuum Verpakt Beter Verleng De Houdbaarheid Van Requirements
 
ViatgeFinalCurs
ViatgeFinalCursViatgeFinalCurs
ViatgeFinalCurs
 
How to Apply
How to ApplyHow to Apply
How to Apply
 
Fichardtpark marketing
Fichardtpark marketingFichardtpark marketing
Fichardtpark marketing
 
JC Penney Integrated Marketing Campaign
JC Penney Integrated Marketing CampaignJC Penney Integrated Marketing Campaign
JC Penney Integrated Marketing Campaign
 
Презентация процесса создания сайтов на Системе IM
Презентация процесса создания сайтов на Системе IMПрезентация процесса создания сайтов на Системе IM
Презентация процесса создания сайтов на Системе IM
 

Último

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Select This! Entity Selectors in Reason CMS