PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/phalcon/devtools/ide/0.9.0/Phalcon/Mvc/Model/Query.php

https://gitlab.com/habracoder/advertising
PHP | 395 lines | 61 code | 94 blank | 240 comment | 0 complexity | 4d3ace8c0400db4e3b5c426132bc0dc0 MD5 | raw file
  1. <?php
  2. namespace Phalcon\Mvc\Model {
  3. /**
  4. * Phalcon\Mvc\Model\Query
  5. *
  6. * This class takes a PHQL intermediate representation and executes it.
  7. *
  8. *<code>
  9. *
  10. * $phql = "SELECT c.price*0.16 AS taxes, c.* FROM Cars AS c JOIN Brands AS b
  11. * WHERE b.name = :name: ORDER BY c.name";
  12. *
  13. * $result = $manager->executeQuery($phql, array(
  14. * 'name' => 'Lamborghini'
  15. * ));
  16. *
  17. * foreach ($result as $row) {
  18. * echo "Name: ", $row->cars->name, "\n";
  19. * echo "Price: ", $row->cars->price, "\n";
  20. * echo "Taxes: ", $row->taxes, "\n";
  21. * }
  22. *
  23. *</code>
  24. *
  25. */
  26. class Query implements QueryInterface {
  27. const TYPE_SELECT = 309;
  28. const TYPE_INSERT = 306;
  29. const TYPE_UPDATE = 300;
  30. const TYPE_DELETE = 303;
  31. protected $_dependencyInjector;
  32. protected $_manager;
  33. protected $_metaData;
  34. protected $_type;
  35. protected $_phql;
  36. protected $_ast;
  37. protected $_intermediate;
  38. protected $_models;
  39. protected $_sqlAliases;
  40. protected $_sqlAliasesModels;
  41. protected $_sqlModelsAliases;
  42. protected $_sqlAliasesModelsInstances;
  43. protected $_sqlColumnAliases;
  44. protected $_modelsInstances;
  45. protected $_cache;
  46. protected $_cacheOptions;
  47. protected $_uniqueRow;
  48. /**
  49. * \Phalcon\Mvc\Model\Query constructor
  50. *
  51. * @param string $phql
  52. */
  53. public function __construct($phql=null){ }
  54. /**
  55. * Sets the dependency injection container
  56. *
  57. * @param \Phalcon\DiInterface $dependencyInjector
  58. */
  59. public function setDI($dependencyInjector){ }
  60. /**
  61. * Returns the dependency injection container
  62. *
  63. * @return \Phalcon\DiInterface
  64. */
  65. public function getDI(){ }
  66. /**
  67. * Tells to the query if only the first row in the resultset must be resturned
  68. *
  69. * @param boolean $uniqueRow
  70. * @return \Phalcon\Mvc\Model\Query
  71. */
  72. public function setUniqueRow($uniqueRow){ }
  73. /**
  74. * Check if the query is programmed to get only the first row in the resultset
  75. *
  76. * @return boolean
  77. */
  78. public function getUniqueRow(){ }
  79. /**
  80. * Replaces the model's name to its source name in a qualifed-name expression
  81. *
  82. * @param array $expr
  83. * @return string
  84. */
  85. protected function _getQualified(){ }
  86. /**
  87. * Resolves a expression in a single call argument
  88. *
  89. * @param array $argument
  90. * @return string
  91. */
  92. protected function _getCallArgument(){ }
  93. /**
  94. * Resolves a expression in a single call argument
  95. *
  96. * @param array $expr
  97. * @return string
  98. */
  99. protected function _getFunctionCall(){ }
  100. /**
  101. * Resolves an expression from its intermediate code into a string
  102. *
  103. * @param array $expr
  104. * @param boolean $quoting
  105. * @return string
  106. */
  107. protected function _getExpression(){ }
  108. /**
  109. * Resolves a column from its intermediate representation into an array used to determine
  110. * if the resulset produced is simple or complex
  111. *
  112. * @param array $column
  113. * @return array
  114. */
  115. protected function _getSelectColumn(){ }
  116. /**
  117. * Resolves a table in a SELECT statement checking if the model exists
  118. *
  119. * @param \Phalcon\Mvc\Model\ManagerInterface $manager
  120. * @param array $qualifiedName
  121. * @return string
  122. */
  123. protected function _getTable(){ }
  124. /**
  125. * Resolves a JOIN clause checking if the associated models exist
  126. *
  127. * @param \Phalcon\Mvc\Model\ManagerInterface $manager
  128. * @param array $join
  129. * @return array
  130. */
  131. protected function _getJoin(){ }
  132. /**
  133. * Resolves a JOIN type
  134. *
  135. * @param array $join
  136. * @return string
  137. */
  138. protected function _getJoinType(){ }
  139. /**
  140. * Resolves all the JOINS in a SELECT statement
  141. *
  142. * @param array $select
  143. * @return array
  144. */
  145. protected function _getJoins(){ }
  146. /**
  147. * Returns a processed order clause for a SELECT statement
  148. *
  149. * @param array $order
  150. * @return string
  151. */
  152. protected function _getOrderClause(){ }
  153. /**
  154. * Returns a processed group clause for a SELECT statement
  155. *
  156. * @param array $group
  157. * @return string
  158. */
  159. protected function _getGroupClause(){ }
  160. /**
  161. * Analyzes a SELECT intermediate code and produces an array to be executed later
  162. *
  163. * @return array
  164. */
  165. protected function _prepareSelect(){ }
  166. /**
  167. * Analyzes an INSERT intermediate code and produces an array to be executed later
  168. *
  169. * @return array
  170. */
  171. protected function _prepareInsert(){ }
  172. /**
  173. * Analyzes an UPDATE intermediate code and produces an array to be executed later
  174. *
  175. * @return array
  176. */
  177. protected function _prepareUpdate(){ }
  178. /**
  179. * Analyzes a DELETE intermediate code and produces an array to be executed later
  180. *
  181. * @return array
  182. */
  183. protected function _prepareDelete(){ }
  184. /**
  185. * Parses the intermediate code produced by \Phalcon\Mvc\Model\Query\Lang generating another
  186. * intermediate representation that could be executed by \Phalcon\Mvc\Model\Query
  187. *
  188. * @param \Phalcon\Mvc\Model\ManagerInterface $manager
  189. * @param \Phalcon\Mvc\Model\MetaDataInterface $metaData
  190. * @return array
  191. */
  192. public function parse(){ }
  193. /**
  194. * Sets the cache parameters of the query
  195. *
  196. * @param array $cacheOptions
  197. * @return \Phalcon\Mvc\Model\Query
  198. */
  199. public function cache($cacheOptions){ }
  200. /**
  201. * Returns the current cache options
  202. *
  203. * @param array
  204. */
  205. public function getCacheOptions(){ }
  206. /**
  207. * Returns the current cache backend instance
  208. *
  209. * @return \Phalcon\Cache\BackendInterface
  210. */
  211. public function getCache(){ }
  212. /**
  213. * Executes the SELECT intermediate representation producing a \Phalcon\Mvc\Model\Resultset
  214. *
  215. * @param array $intermediate
  216. * @param array $bindParams
  217. * @param array $bindTypes
  218. * @return \Phalcon\Mvc\Model\ResultsetInterface
  219. */
  220. protected function _executeSelect(){ }
  221. /**
  222. * Executes the INSERT intermediate representation producing a \Phalcon\Mvc\Model\Query\Status
  223. *
  224. * @param array $intermediate
  225. * @param array $bindParams
  226. * @param array $bindTypes
  227. * @return \Phalcon\Mvc\Model\Query\StatusInterface
  228. */
  229. protected function _executeInsert(){ }
  230. /**
  231. * Query the records on which the UPDATE/DELETE operation well be done
  232. *
  233. * @param \Phalcon\Mvc\Model $model
  234. * @param array $intermediate
  235. * @param array $bindParams
  236. * @param array $bindTypes
  237. * @return \Phalcon\Mvc\Model\ResultsetInterface
  238. */
  239. protected function _getRelatedRecords(){ }
  240. /**
  241. * Executes the UPDATE intermediate representation producing a \Phalcon\Mvc\Model\Query\Status
  242. *
  243. * @param array $intermediate
  244. * @param array $bindParams
  245. * @param array $bindTypes
  246. * @return \Phalcon\Mvc\Model\Query\StatusInterface
  247. */
  248. protected function _executeUpdate(){ }
  249. /**
  250. * Executes the DELETE intermediate representation producing a \Phalcon\Mvc\Model\Query\Status
  251. *
  252. * @param array $intermediate
  253. * @param array $bindParams
  254. * @param array $bindTypes
  255. * @return \Phalcon\Mvc\Model\Query\StatusInterface
  256. */
  257. protected function _executeDelete(){ }
  258. /**
  259. * Executes a parsed PHQL statement
  260. *
  261. * @param array $bindParams
  262. * @param array $bindTypes
  263. * @return mixed
  264. */
  265. public function execute($bindParams=null, $bindTypes=null){ }
  266. /**
  267. * Executes the query returning the first result
  268. *
  269. * @param array $bindParams
  270. * @param array $bindTypes
  271. * @return á¹”halcon\Mvc\ModelInterface
  272. */
  273. public function getSingleResult($bindParams=null, $bindTypes=null){ }
  274. /**
  275. * Sets the type of PHQL statement to be executed
  276. *
  277. * @param int $type
  278. * @return \Phalcon\Mvc\Model\Query
  279. */
  280. public function setType($type){ }
  281. /**
  282. * Gets the type of PHQL statement executed
  283. *
  284. * @return int
  285. */
  286. public function getType(){ }
  287. /**
  288. * Allows to set the IR to be executed
  289. *
  290. * @param array $intermediate
  291. * @return \Phalcon\Mvc\Model\Query
  292. */
  293. public function setIntermediate($intermediate){ }
  294. /**
  295. * Returns the intermediate representation of the PHQL statement
  296. *
  297. * @return array
  298. */
  299. public function getIntermediate(){ }
  300. }
  301. }