$query = Doctrine_Query::create() ->from('User'); $users = $query->execute();
$query = Doctrine_Query::create() ->from('User u') ->where('u.age >= ?', 18); $adults = $query->execute();
$query = Doctrine_Query::create() ->from('User u') ->leftJoin('u.Address a') ->where('a.city = ?', 'New York'); $newYorkers = $query->execute();This code joins the "User" table with the "Address" table on a foreign key and selects all users with an address in New York City. Overall, Doctrine_Query is a powerful and flexible tool for building and executing SQL queries in PHP applications. Its intuitive API and support for popular database systems make it a valuable asset for developers working with databases.