Hi Joel-
I think what you propose for an integer value would work fine. The problem comes when you work with strings. SQL injection follows specific rules (i.e. "; delete from users; --"). Since it usually relies on ending the previous statement, injecting a new statement, and then commenting the rest of the query, the fear would be that a simple string concatenation, regardless of whether it is fully quoted, would not be sufficient.
Check this script out:
https://github.com/doctrine/orientdb-odm/blob/master/src/Doctrine/OrientDB/Query/Query.phpI use that for most of my query generation, and have also written a few custom tokens for that parser for functions that don't yet exist in the canned code (for example lucene geo index search).
As Luca suggested, some brave soul needs to update the Doctrine library to incorporate the new PHP binary protocol that was released recently. This will presumably speed up the PHP driver, while still maintaining the legacy query building functions in the Doctrine library. There is an older PHP binary protocol included with Doctrine already, but it was pretty barebones and I haven't ever used it personally.
In any case, that library should have most of the query building functions you need, certainly enough to add a simple where statement to your query. If you want some example code of how to use the Doctrine query builder, let me know. The Doctrine library also provides an ORM (Object Relational Mapper), but I have never used those features. I prefer to use the query generator by itself, and issue commands with the php database binding's query and command functions.