$q = Doctrine_Query::create() ->select('*') ->from('Table') ->addWhere('status = ?', 'active');
$q = Doctrine_Query::create() ->select('*') ->from('Table') ->addWhere('status = ?', 'active') ->addWhere('status = ?', 'pending', 'OR');
$q = Doctrine_Query::create() ->select('*') ->from('Table') ->addWhere('name = :name') ->addWhere('id = :id') ->setParameter('name', 'John') ->setParameter('id', 1);The Doctrine_Query is a part of the Doctrine ORM library for PHP.