Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0
-
Fix Version/s: None
-
Component/s: ORM
-
Security Level: All
-
Labels:None
Description
Sometimes a developer needs to issue a query without a FROM clause. This especially occurs using the QueryBuilder, when you may or may not have a table to select from, but call a stored procedure always.
Example:
$query = $em>createQuery('SELECT (1+1)');
The above query fails because the lexer expects T_FROM. If you replace (1+1) with a stored procedure, this example makes more sense.
One might argue about that you should use DBAL directly, but I disagree, because it always can happen that you end up in a situation like this:
$qb = $em->createQueryBuilder(); $qb->select("SOMEFANCYPROCEDURE()"); if ($condition) { $qb = $qb->from("additionalTable t"); }
Activity
Timo A. Hummel
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Affects Version/s | 2.0 [ 10021 ] | |
| Component/s | ORM [ 10012 ] |
Timo A. Hummel
made changes -
| Description |
Sometimes a developer needs to issue a query without a FROM clause. This especially occurs using the QueryBuilder, when you may or may not have a table to select from, but call a stored procedure always. Example: {code} $query = $em>createQuery('SELECT (1+1)'); {code} The above query fails because the lexer expects T_FROM. If you replace (1+1) with a stored procedure, this example makes more sense. One might argue about that you should use DBAL directly, but I disagree, because it always can happen that you end up in a situation like this: {code} $em->createQueryBuilder(); $qb->select("SOMEFANCYPROCEDURE()"); if ($condition) { $qb = $qb->from("additionalTable t"); } {code} |
Sometimes a developer needs to issue a query without a FROM clause. This especially occurs using the QueryBuilder, when you may or may not have a table to select from, but call a stored procedure always. Example: {code} $query = $em>createQuery('SELECT (1+1)'); {code} The above query fails because the lexer expects T_FROM. If you replace (1+1) with a stored procedure, this example makes more sense. One might argue about that you should use DBAL directly, but I disagree, because it always can happen that you end up in a situation like this: {code} $qb = $em->createQueryBuilder(); $qb->select("SOMEFANCYPROCEDURE()"); if ($condition) { $qb = $qb->from("additionalTable t"); } {code} |
Benjamin Eberlei
made changes -
| Workflow | jira [ 12319 ] | jira-feedback [ 13903 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 13903 ] | jira-feedback2 [ 15767 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 15767 ] | jira-feedback3 [ 18024 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-999, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)