Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ===CODE===:
- $dql = "SELECT symbol_id FROM Symbol WHERE symbol=".$symbol;
- $query = $this->ci->em->createQuery($dql);
- $query->setMaxResults(1);
- $id = $query->getResult();
- ===ERROR===
- Doctrine\ORM\Query\QueryException [ 0 ]: [Semantical Error] line 0, col 22 near 'Symbol WHERE': Error: Class 'Symbol' is not defined.
- APPPATH/libraries/Doctrine/ORM/Query/QueryException.php [ 47 ]
- 42 return new self('[Syntax Error] ' . $message);
- 43 }
- 44
- 45 public static function semanticalError($message)
- 46 {
- 47 return new self('[Semantical Error] ' . $message);
- 48 }
- 49
- 50 public static function invalidParameterType($expected, $received)
- 51 {
- 52 return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.');
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 425 ] » Doctrine\ORM\Query\QueryException::semanticalError(arguments)
- message line 0, col 22 near 'Symbol WHERE': Error: Class 'Symbol' is not defined.
- 420 // Building informative message
- 421 $message = 'line 0, col ' . (
- 422 (isset($token['position']) && $token['position'] > 0) ? $token['position'] : '-1'
- 423 ) . " near '" . substr($dql, $token['position'], $length) . "': Error: " . $message;
- 424
- 425 throw \Doctrine\ORM\Query\QueryException::semanticalError($message);
- 426 }
- 427
- 428 /**
- 429 * Peeks beyond the specified token and returns the first token after that one.
- 430 *
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 868 ] » Doctrine\ORM\Query\Parser->semanticalError(arguments)
- message Class 'Symbol' is not defined.
- token Array
- (
- [value] => Symbol
- [type] => 100
- [position] => 22
- )
- 863 }
- 864
- 865 $exists = class_exists($schemaName, true);
- 866
- 867 if ( ! $exists) {
- 868 $this->semanticalError("Class '$schemaName' is not defined.", $this->_lexer->token);
- 869 }
- 870
- 871 return $schemaName;
- 872 }
- 873
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 1462 ] » Doctrine\ORM\Query\Parser->AbstractSchemaName()
- 1457 *
- 1458 * @return Doctrine\ORM\Query\AST\RangeVariableDeclaration
- 1459 */
- 1460 public function RangeVariableDeclaration()
- 1461 {
- 1462 $abstractSchemaName = $this->AbstractSchemaName();
- 1463
- 1464 if ($this->_lexer->isNextToken(Lexer::T_AS)) {
- 1465 $this->match(Lexer::T_AS);
- 1466 }
- 1467
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 1399 ] » Doctrine\ORM\Query\Parser->RangeVariableDeclaration()
- 1394 *
- 1395 * @return \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration
- 1396 */
- 1397 public function IdentificationVariableDeclaration()
- 1398 {
- 1399 $rangeVariableDeclaration = $this->RangeVariableDeclaration();
- 1400 $indexBy = $this->_lexer->isNextToken(Lexer::T_INDEX) ? $this->IndexBy() : null;
- 1401 $joinVariableDeclarations = array();
- 1402
- 1403 while (
- 1404 $this->_lexer->isNextToken(Lexer::T_LEFT) ||
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 1173 ] » Doctrine\ORM\Query\Parser->IdentificationVariableDeclaration()
- 1168 */
- 1169 public function FromClause()
- 1170 {
- 1171 $this->match(Lexer::T_FROM);
- 1172 $identificationVariableDeclarations = array();
- 1173 $identificationVariableDeclarations[] = $this->IdentificationVariableDeclaration();
- 1174
- 1175 while ($this->_lexer->isNextToken(Lexer::T_COMMA)) {
- 1176 $this->match(Lexer::T_COMMA);
- 1177 $identificationVariableDeclarations[] = $this->IdentificationVariableDeclaration();
- 1178 }
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 763 ] » Doctrine\ORM\Query\Parser->FromClause()
- 758 *
- 759 * @return \Doctrine\ORM\Query\AST\SelectStatement
- 760 */
- 761 public function SelectStatement()
- 762 {
- 763 $selectStatement = new AST\SelectStatement($this->SelectClause(), $this->FromClause());
- 764
- 765 $selectStatement->whereClause = $this->_lexer->isNextToken(Lexer::T_WHERE)
- 766 ? $this->WhereClause() : null;
- 767
- 768 $selectStatement->groupByClause = $this->_lexer->isNextToken(Lexer::T_GROUP)
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 735 ] » Doctrine\ORM\Query\Parser->SelectStatement()
- 730 {
- 731 $this->_lexer->moveNext();
- 732
- 733 switch ($this->_lexer->lookahead['type']) {
- 734 case Lexer::T_SELECT:
- 735 $statement = $this->SelectStatement();
- 736 break;
- 737 case Lexer::T_UPDATE:
- 738 $statement = $this->UpdateStatement();
- 739 break;
- 740 case Lexer::T_DELETE:
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 207 ] » Doctrine\ORM\Query\Parser->QueryLanguage()
- 202 * \Doctrine\ORM\Query\AST\DeleteStatement
- 203 */
- 204 public function getAST()
- 205 {
- 206 // Parse & build AST
- 207 $AST = $this->QueryLanguage();
- 208
- 209 // Process any deferred validations of some nodes in the AST.
- 210 // This also allows post-processing of the AST for modification purposes.
- 211 $this->_processDeferredIdentificationVariables();
- 212
- APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 278 ] » Doctrine\ORM\Query\Parser->getAST()
Add Comment
Please, Sign In to add comment