Commit fb7adbbe authored by jwage's avatar jwage

[2.0] Added exception if query builder is missing from or select when trying to get dql string

parent b9ec48d6
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
namespace Doctrine\ORM; namespace Doctrine\ORM;
use Doctrine\ORM\Query\Expr; use Doctrine\ORM\Query\Expr,
Doctrine\Common\DoctrineException;
/** /**
* This class is responsible for building DQL query strings via an object oriented * This class is responsible for building DQL query strings via an object oriented
...@@ -191,6 +192,10 @@ class QueryBuilder ...@@ -191,6 +192,10 @@ class QueryBuilder
return $this->_dql; return $this->_dql;
} }
if ( ! $this->_dqlParts['select'] || ! $this->_dqlParts['from']) {
throw DoctrineException::incompleteQueryBuilder();
}
$dql = ''; $dql = '';
switch ($this->_type) { switch ($this->_type) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment