[eluser]OverZealous[/eluser] @Jeffrey Lasut
You just query them, like in AR.
You might be wondering about deep relationships. It's in the docs, but here's an example:
Code:
// get your category first, because you can only run one query at a time.
$category = new Category($category_id);
$p = new Product();
// Distinct is optional, unless you get duplicated results due to the deep relationship
$p->distinct();
// field is deeply related through property
$p->where_related('property/field', 'name', $field_name);
// search on type name
$p->where_related_type('name', $type_name);
// related to this specific category
$p->where_related($category);
// search on property value
$p->where_related_property('value', $value)
// This one is a bit trickier, but this might work:
// the FALSE is to prevent escaping
$p->where_related_property('version', $p->add_table_name('version'), FALSE);
// load the result
$p->get();
I'm using different methods to handle the related items. You can choose, for consistently, to always use this form instead: