The Elgg Community: SimpleQuery Classes

I was browsing through some of Elgg's code and an undocumented class that isn't mentioned or used anywhere is the Query class abstraction for simple queries as well as complex queries.

I haven't seen any mods that are using this class, so I might start up a small tutorial to show how to query certain things with it. SimpleQuery extension of the Query class makes writing safe queries easier.

What I'm trying to reason though is why the Elgg community didn't use PHP's prepared statements instead of writing this Query abstraction? Take a look at it here:

<!-- end the topic_post --> <!-- start the topic_post -->


Very cool!

Check this code out:

$query  = new SimpleQuery();
$query->simpleSelectField("annotations", "id");
$query->simpleWhereOnValue("annotations", "id", "=", "2");
$row = get_data($query); // or optionally echo $query;

Very nice and easy:)

Georg Westphalen

a former physician specializing in creative concepts, outrageous comics, hilarious character designs and urban philosophy.