Guest User

Untitled

a guest
Jan 22nd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.14 KB | None | 0 0
  1. CODE:
  2. $symbols_entity = new models\common\Symbols();
  3. $symbols_entity->setSymbol($symbol);
  4. $this->ci->em->persist($symbols_entity);
  5. $this->ci->em->flush();
  6.  
  7. ERROR:
  8. PDOException [ HY093 ]: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
  9. APPPATH/libraries/Doctrine/DBAL/Statement.php [ 131 ]
  10.  
  11. 126 $hasLogger = $this->_conn->getConfiguration()->getSQLLogger();
  12. 127 if ($hasLogger) {
  13. 128 $this->_conn->getConfiguration()->getSQLLogger()->startQuery($this->_sql, $this->_params);
  14. 129 }
  15. 130
  16. 131 $stmt = $this->_stmt->execute($params);
  17. 132
  18. 133 if ($hasLogger) {
  19. 134 $this->_conn->getConfiguration()->getSQLLogger()->stopQuery();
  20. 135 }
  21. 136 $this->_params = array();
  22.  
  23. APPPATH/libraries/Doctrine/DBAL/Statement.php [ 131 ] » PDOStatement->execute(arguments)
  24.  
  25. bound_input_params
  26.  
  27.  
  28. 126 $hasLogger = $this->_conn->getConfiguration()->getSQLLogger();
  29. 127 if ($hasLogger) {
  30. 128 $this->_conn->getConfiguration()->getSQLLogger()->startQuery($this->_sql, $this->_params);
  31. 129 }
  32. 130
  33. 131 $stmt = $this->_stmt->execute($params);
  34. 132
  35. 133 if ($hasLogger) {
  36. 134 $this->_conn->getConfiguration()->getSQLLogger()->stopQuery();
  37. 135 }
  38. 136 $this->_params = array();
  39.  
  40. APPPATH/libraries/Doctrine/ORM/Persisters/BasicEntityPersister.php [ 226 ] » Doctrine\DBAL\Statement->execute()
  41.  
  42. 221 foreach ($insertData[$tableName] as $column => $value) {
  43. 222 $stmt->bindValue($paramIndex++, $value, $this->_columnTypes[$column]);
  44. 223 }
  45. 224 }
  46. 225
  47. 226 $stmt->execute();
  48. 227
  49. 228 if ($isPostInsertId) {
  50. 229 $id = $idGen->generate($this->_em, $entity);
  51. 230 $postInsertIds[$id] = $entity;
  52. 231 } else {
  53.  
  54. APPPATH/libraries/Doctrine/ORM/UnitOfWork.php [ 698 ] » Doctrine\ORM\Persisters\BasicEntityPersister->executeInserts()
  55.  
  56. 693 $entities[] = $entity;
  57. 694 }
  58. 695 }
  59. 696 }
  60. 697
  61. 698 $postInsertIds = $persister->executeInserts();
  62. 699
  63. 700 if ($postInsertIds) {
  64. 701 // Persister returned post-insert IDs
  65. 702 foreach ($postInsertIds as $id => $entity) {
  66. 703 $oid = spl_object_hash($entity);
  67.  
  68. APPPATH/libraries/Doctrine/ORM/UnitOfWork.php [ 280 ] » Doctrine\ORM\UnitOfWork->executeInserts(arguments)
  69.  
  70. class Doctrine\ORM\Mapping\ClassMetadata Object
  71. (
  72. [reflFields] => Array
  73. (
  74. [symbol_id] => ReflectionProperty Object
  75. (
  76. [name] => symbol_id
  77. [class] => models\common\Symbols
  78. )
  79.  
  80. [exchange_id] => ReflectionProperty Object
  81. (
  82. [name] => exchange_id
  83. [class] => models\common\Symbols
  84. )
  85.  
  86. [company] => ReflectionProperty Object
  87. (
  88. [name] => company
  89. [class] => models\common\Symbols
  90. )
  91.  
  92. [symbol] => ReflectionProperty Object
  93. (
  94. [name] => symbol
  95. [class] => models\common\Symbols
  96. )
  97.  
  98. [instrument_type] => ReflectionProperty Object
  99. (
  100. [name] => instrument_type
  101. [class] => models\common\Symbols
  102. )
  103.  
  104. )
  105.  
  106. [_prototype:Doctrine\ORM\Mapping\ClassMetadata:private] =>
  107. [name] => models\common\Symbols
  108. [namespace] => models\common
  109. [rootEntityName] => models\common\Symbols
  110. [customRepositoryClassName] =>
  111. [isMappedSuperclass] =>
  112. [parentClasses] => Array
  113. (
  114. )
  115.  
  116. [subClasses] => Array
  117. (
  118. )
  119.  
  120. [identifier] => Array
  121. (
  122. [0] => symbol_id
  123. [1] => exchange_id
  124. )
  125.  
  126. [inheritanceType] => 1
  127. [generatorType] => 4
  128. [fieldMappings] => Array
  129. (
  130. [symbol_id] => Array
  131. (
  132. [fieldName] => symbol_id
  133. [type] => integer
  134. [length] => 10
  135. [precision] => 0
  136. [scale] => 0
  137. [nullable] =>
  138. [unique] =>
  139. [id] => 1
  140. [columnName] => symbol_id
  141. )
  142.  
  143. [exchange_id] => Array
  144. (
  145. [fieldName] => exchange_id
  146. [type] => integer
  147. [length] => 10
  148. [precision] => 0
  149. [scale] => 0
  150. [nullable] =>
  151. [unique] =>
  152. [id] => 1
  153. [columnName] => exchange_id
  154. )
  155.  
  156. [company] => Array
  157. (
  158. [fieldName] => company
  159. [type] => string
  160. [length] => 150
  161. [precision] => 0
  162. [scale] => 0
  163. [nullable] => 1
  164. [unique] =>
  165. [columnName] => company
  166. )
  167.  
  168. [symbol] => Array
  169. (
  170. [fieldName] => symbol
  171. [type] => string
  172. [length] => 8
  173. [precision] => 0
  174. [scale] => 0
  175. [nullable] =>
  176. [unique] =>
  177. [columnName] => symbol
  178. )
  179.  
  180. [instrument_type] => Array
  181. (
  182. [fieldName] => instrument_type
  183. [type] => string
  184. [length] => 8
  185. [precision] => 0
  186. [scale] => 0
  187. [nullable] => 1
  188. [unique] =>
  189. [columnName] => instrument_type
  190. )
  191.  
  192. )
  193.  
  194. [fieldNames] => Array
  195. (
  196. [symbol_id] => symbol_id
  197. [exchange_id] => exchange_id
  198. [company] => company
  199. [symbol] => symbol
  200. [instrument_type] => instrument_type
  201. )
  202.  
  203. [columnNames] => Array
  204. (
  205. [symbol_id] => symbol_id
  206. [exchange_id] => exchange_id
  207. [company] => company
  208. [symbol] => symbol
  209. [instrument_type] => instrument_type
  210. )
  211.  
  212. [discriminatorValue] =>
  213. [discriminatorMap] => Array
  214. (
  215. )
  216.  
  217. [discriminatorColumn] =>
  218. [table] => Array
  219. (
  220. [name] => symbols
  221. )
  222.  
  223. [lifecycleCallbacks] => Array
  224. (
  225. )
  226.  
  227. [associationMappings] => Array
  228. (
  229. )
  230.  
  231. [isIdentifierComposite] => 1
  232. [idGenerator] => Doctrine\ORM\Id\IdentityGenerator Object
  233. (
  234. [_seqName:Doctrine\ORM\Id\IdentityGenerator:private] =>
  235. )
  236.  
  237. [sequenceGeneratorDefinition] =>
  238. [tableGeneratorDefinition] =>
  239. [changeTrackingPolicy] => 1
  240. [isVersioned] =>
  241. [versionField] =>
  242. [reflClass] => ReflectionClass Object
  243. (
  244. [name] => models\common\Symbols
  245. )
  246.  
  247. )
  248.  
  249.  
  250.  
  251. 275
  252. 276 $conn->beginTransaction();
  253. 277 try {
  254. 278 if ($this->entityInsertions) {
  255. 279 foreach ($commitOrder as $class) {
  256. 280 $this->executeInserts($class);
  257. 281 }
  258. 282 }
  259. 283
  260. 284 if ($this->entityUpdates) {
  261. 285 foreach ($commitOrder as $class) {
  262.  
  263. APPPATH/libraries/Doctrine/ORM/EntityManager.php [ 324 ] » Doctrine\ORM\UnitOfWork->commit()
  264.  
  265. 319 * makes use of optimistic locking fails.
  266. 320 */
  267. 321 public function flush()
  268. 322 {
  269. 323 $this->errorIfClosed();
  270. 324 $this->unitOfWork->commit();
  271. 325 }
  272. 326
  273. 327 /**
  274. 328 * Finds an Entity by its identifier.
  275. 329 *
  276.  
  277. APPPATH/libraries/jungle_lib.php [ 638 ] » Doctrine\ORM\EntityManager->flush()
Add Comment
Please, Sign In to add comment