$query = new QueryTable('users');
$query->where($query['first_name']
->eq('john'))->where($query['last_name']->not_eq('doe'));
echo $query->to_sql();
// Output
// SELECT * FROM users WHERE users.first_name = 'john' AND users.last_name != 'doe'
Creating a SQL library for PHP modeled after Arel. I am still developing this locally but plan to push it to Github soon.