[eluser]Piinaaja[/eluser]
[quote author="chrisj" date="1191395545"]Thanks BB & NM.
I found some major bugs with my _fetch_related function, however. Here's the new and improved version:
Code:
function _fetch_related($table, $inflected)
{
...
}
[/quote]
Hi chrisj, thanks for adding improved relations fetching, it helps a lot!
I noticed that you might have a bug in the updated _fetch_related, the part where it searches for has_many or has_one, I think the line ending should be:
Code:
WHERE '. $this->_class_name .'_id = '.$this->id);
instead of:
Code:
WHERE '. $this->_class_name .'_id = id');