[eluser]OverZealous[/eluser]
[quote author="introvert" date="1256588941"]
I'm trying to join 2 tables with DM OZ edition, where field 'domain' is the same.
Entry model:
id
last_updated
domain
Filter model:
id
domain
priority[/quote]
Hi, introvert,
DMZ will only work with the integer-based id fields for relationships.
You didn't mention if this was a One-to-One, One-to-Many, or Many-to-Many relationship, but if it is a One-to-XXX relationship, then I recommend only storing the domain on one side of the relationship. You'll need to add a standard relationship column to the other object. Then you can query and access the domain using normal relationship methods.
For example, let's assume that each Entry has One Filter, and each Filter has Many Entries.
First, add a column filter_id to Entry. Remove the domain column from Entry, as well. Then you can access and query Entry like so:
Code:
$e = new Entry();
// Get entries by Domain
$e->where_related('filter', 'domain', $domain_value)->get();
// Get all entries, and include the domain in the results.
// The last argument (FALSE) is to prevent the prefix from being appended.
// See Get (Advanced) in the manual for include_related.
$e->include_related('filter', 'domain', FALSE)->get();