1
0
mirror of synced 2025-02-06 23:39:25 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Query - Introduction.php

23 lines
992 B
PHP
Raw Normal View History

2006-12-15 22:31:28 +00:00
<?php ?>
2006-07-23 21:08:06 +00:00
DQL (Doctrine Query Language) is a object query language which allows
you to find objects. DQL understands things like object relationships, polymorphism and
2006-12-15 22:31:28 +00:00
inheritance (including column aggregation inheritance).
For more info about DQL see the actual DQL chapter.
2006-07-23 21:08:06 +00:00
<br \><br \>
2006-12-15 22:31:28 +00:00
Doctrine_Query along with Doctrine_Expression provide an easy-to-use wrapper for writing DQL queries. Creating a new
query object can be done by either using the new operator or by calling create method. The create method exists for allowing easy
method call chaining.
<code type="php">
// initalizing a new Doctrine_Query (using the current connection)
$q = new Doctrine_Query();
// initalizing a new Doctrine_Query (using custom connection parameter)
// here $conn is an instance of Doctrine_Connection
$q = new Doctrine_Query($conn);
// an example using the create method
// here we simple fetch all users
$users = Doctrine_Query::create()->from('User')->execute();
</code>