Guest User

Untitled

a guest
Jan 22nd, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 KB | None | 0 0
  1.  
  2. ===CODE===:
  3.  
  4. $dql = "SELECT symbol_id FROM Symbol WHERE symbol=".$symbol;
  5.  
  6. $query = $this->ci->em->createQuery($dql);
  7. $query->setMaxResults(1);
  8. $id = $query->getResult();
  9.  
  10.  
  11.  
  12.  
  13.  
  14. ===ERROR===
  15.  
  16. Doctrine\ORM\Query\QueryException [ 0 ]: [Semantical Error] line 0, col 22 near 'Symbol WHERE': Error: Class 'Symbol' is not defined.
  17. APPPATH/libraries/Doctrine/ORM/Query/QueryException.php [ 47 ]
  18.  
  19. 42 return new self('[Syntax Error] ' . $message);
  20. 43 }
  21. 44
  22. 45 public static function semanticalError($message)
  23. 46 {
  24. 47 return new self('[Semantical Error] ' . $message);
  25. 48 }
  26. 49
  27. 50 public static function invalidParameterType($expected, $received)
  28. 51 {
  29. 52 return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.');
  30.  
  31. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 425 ] » Doctrine\ORM\Query\QueryException::semanticalError(arguments)
  32.  
  33. message line 0, col 22 near 'Symbol WHERE': Error: Class 'Symbol' is not defined.
  34.  
  35.  
  36. 420 // Building informative message
  37. 421 $message = 'line 0, col ' . (
  38. 422 (isset($token['position']) && $token['position'] > 0) ? $token['position'] : '-1'
  39. 423 ) . " near '" . substr($dql, $token['position'], $length) . "': Error: " . $message;
  40. 424
  41. 425 throw \Doctrine\ORM\Query\QueryException::semanticalError($message);
  42. 426 }
  43. 427
  44. 428 /**
  45. 429 * Peeks beyond the specified token and returns the first token after that one.
  46. 430 *
  47.  
  48. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 868 ] » Doctrine\ORM\Query\Parser->semanticalError(arguments)
  49.  
  50. message Class 'Symbol' is not defined.
  51.  
  52. token Array
  53. (
  54. [value] => Symbol
  55. [type] => 100
  56. [position] => 22
  57. )
  58.  
  59.  
  60.  
  61. 863 }
  62. 864
  63. 865 $exists = class_exists($schemaName, true);
  64. 866
  65. 867 if ( ! $exists) {
  66. 868 $this->semanticalError("Class '$schemaName' is not defined.", $this->_lexer->token);
  67. 869 }
  68. 870
  69. 871 return $schemaName;
  70. 872 }
  71. 873
  72.  
  73. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 1462 ] » Doctrine\ORM\Query\Parser->AbstractSchemaName()
  74.  
  75. 1457 *
  76. 1458 * @return Doctrine\ORM\Query\AST\RangeVariableDeclaration
  77. 1459 */
  78. 1460 public function RangeVariableDeclaration()
  79. 1461 {
  80. 1462 $abstractSchemaName = $this->AbstractSchemaName();
  81. 1463
  82. 1464 if ($this->_lexer->isNextToken(Lexer::T_AS)) {
  83. 1465 $this->match(Lexer::T_AS);
  84. 1466 }
  85. 1467
  86.  
  87. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 1399 ] » Doctrine\ORM\Query\Parser->RangeVariableDeclaration()
  88.  
  89. 1394 *
  90. 1395 * @return \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration
  91. 1396 */
  92. 1397 public function IdentificationVariableDeclaration()
  93. 1398 {
  94. 1399 $rangeVariableDeclaration = $this->RangeVariableDeclaration();
  95. 1400 $indexBy = $this->_lexer->isNextToken(Lexer::T_INDEX) ? $this->IndexBy() : null;
  96. 1401 $joinVariableDeclarations = array();
  97. 1402
  98. 1403 while (
  99. 1404 $this->_lexer->isNextToken(Lexer::T_LEFT) ||
  100.  
  101. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 1173 ] » Doctrine\ORM\Query\Parser->IdentificationVariableDeclaration()
  102.  
  103. 1168 */
  104. 1169 public function FromClause()
  105. 1170 {
  106. 1171 $this->match(Lexer::T_FROM);
  107. 1172 $identificationVariableDeclarations = array();
  108. 1173 $identificationVariableDeclarations[] = $this->IdentificationVariableDeclaration();
  109. 1174
  110. 1175 while ($this->_lexer->isNextToken(Lexer::T_COMMA)) {
  111. 1176 $this->match(Lexer::T_COMMA);
  112. 1177 $identificationVariableDeclarations[] = $this->IdentificationVariableDeclaration();
  113. 1178 }
  114.  
  115. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 763 ] » Doctrine\ORM\Query\Parser->FromClause()
  116.  
  117. 758 *
  118. 759 * @return \Doctrine\ORM\Query\AST\SelectStatement
  119. 760 */
  120. 761 public function SelectStatement()
  121. 762 {
  122. 763 $selectStatement = new AST\SelectStatement($this->SelectClause(), $this->FromClause());
  123. 764
  124. 765 $selectStatement->whereClause = $this->_lexer->isNextToken(Lexer::T_WHERE)
  125. 766 ? $this->WhereClause() : null;
  126. 767
  127. 768 $selectStatement->groupByClause = $this->_lexer->isNextToken(Lexer::T_GROUP)
  128.  
  129. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 735 ] » Doctrine\ORM\Query\Parser->SelectStatement()
  130.  
  131. 730 {
  132. 731 $this->_lexer->moveNext();
  133. 732
  134. 733 switch ($this->_lexer->lookahead['type']) {
  135. 734 case Lexer::T_SELECT:
  136. 735 $statement = $this->SelectStatement();
  137. 736 break;
  138. 737 case Lexer::T_UPDATE:
  139. 738 $statement = $this->UpdateStatement();
  140. 739 break;
  141. 740 case Lexer::T_DELETE:
  142.  
  143. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 207 ] » Doctrine\ORM\Query\Parser->QueryLanguage()
  144.  
  145. 202 * \Doctrine\ORM\Query\AST\DeleteStatement
  146. 203 */
  147. 204 public function getAST()
  148. 205 {
  149. 206 // Parse & build AST
  150. 207 $AST = $this->QueryLanguage();
  151. 208
  152. 209 // Process any deferred validations of some nodes in the AST.
  153. 210 // This also allows post-processing of the AST for modification purposes.
  154. 211 $this->_processDeferredIdentificationVariables();
  155. 212
  156.  
  157. APPPATH/libraries/Doctrine/ORM/Query/Parser.php [ 278 ] » Doctrine\ORM\Query\Parser->getAST()
Add Comment
Please, Sign In to add comment