23 lines
858 B
Plaintext
23 lines
858 B
Plaintext
Syntax:
|
|
|
|
<code>
|
|
FROM <component_reference> [[LEFT | INNER] JOIN <component_reference>] ...
|
|
</code>
|
|
|
|
The {{FROM}} clause indicates the component or components from which to retrieve records. If you name more than one component, you are performing a join. For each table specified, you can optionally specify an alias.
|
|
|
|
Consider the following DQL query:
|
|
<code>
|
|
FROM User u
|
|
</code>
|
|
|
|
Here 'User' is the name of the class (component) and 'u' is the alias. You should always use short aliases, since most of the time those make the query much shorther and also because when using for example caching the cached form of the query takes less space when short aliases are being used.
|
|
|
|
The following example shows how to fetch all records from class 'User'.
|
|
|
|
<code type="php">
|
|
$users = Doctrine_Query::create()
|
|
->from('User u')
|
|
->execute();
|
|
</code>
|