PageRenderTime 31ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://gitlab.com/habracoder/advertising
PHP | 381 lines | 60 code | 92 blank | 229 comment | 0 complexity | 5924be0f91553d1ac8c8c6db7313cb5a 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 {
  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. */
  71. public function setUniqueRow($uniqueRow){ }
  72. /**
  73. * Check if the query is programmed to get only the first row in the resultset
  74. *
  75. * @return boolean
  76. */
  77. public function getUniqueRow(){ }
  78. /**
  79. * Replaces the model's name to its source name in a qualifed-name expression
  80. *
  81. * @param array $expr
  82. * @return string
  83. */
  84. protected function _getQualified(){ }
  85. /**
  86. * Resolves a expression in a single call argument
  87. *
  88. * @param array $argument
  89. * @return string
  90. */
  91. protected function _getCallArgument(){ }
  92. /**
  93. * Resolves a expression in a single call argument
  94. *
  95. * @param array $expr
  96. * @return string
  97. */
  98. protected function _getFunctionCall(){ }
  99. /**
  100. * Resolves an expression from its intermediate code into a string
  101. *
  102. * @param array $expr
  103. * @param boolean $quoting
  104. * @return string
  105. */
  106. protected function _getExpression(){ }
  107. /**
  108. * Resolves a column from its intermediate representation into an array used to determine
  109. * if the resulset produced is simple or complex
  110. *
  111. * @param array $column
  112. * @return array
  113. */
  114. protected function _getSelectColumn(){ }
  115. /**
  116. * Resolves a table in a SELECT statement checking if the model exists
  117. *
  118. * @param \Phalcon\Mvc\Model\ManagerInterface $manager
  119. * @param array $qualifiedName
  120. * @return string
  121. */
  122. protected function _getTable(){ }
  123. /**
  124. * Resolves a JOIN clause checking if the associated models exist
  125. *
  126. * @param \Phalcon\Mvc\Model\ManagerInterface $manager
  127. * @param array $join
  128. * @return array
  129. */
  130. protected function _getJoin(){ }
  131. /**
  132. * Resolves a JOIN type
  133. *
  134. * @param array $join
  135. * @return string
  136. */
  137. protected function _getJoinType(){ }
  138. /**
  139. * Resolves all the JOINS in a SELECT statement
  140. *
  141. * @param array $select
  142. * @return array
  143. */
  144. protected function _getJoins(){ }
  145. /**
  146. * Returns a processed order clause for a SELECT statement
  147. *
  148. * @param array $order
  149. * @return string
  150. */
  151. protected function _getOrderClause(){ }
  152. /**
  153. * Returns a processed group clause for a SELECT statement
  154. *
  155. * @param array $group
  156. * @return string
  157. */
  158. protected function _getGroupClause(){ }
  159. /**
  160. * Analyzes a SELECT intermediate code and produces an array to be executed later
  161. *
  162. * @return array
  163. */
  164. protected function _prepareSelect(){ }
  165. /**
  166. * Analyzes an INSERT intermediate code and produces an array to be executed later
  167. *
  168. * @return array
  169. */
  170. protected function _prepareInsert(){ }
  171. /**
  172. * Analyzes an UPDATE intermediate code and produces an array to be executed later
  173. *
  174. * @return array
  175. */
  176. protected function _prepareUpdate(){ }
  177. /**
  178. * Analyzes a DELETE intermediate code and produces an array to be executed later
  179. *
  180. * @return array
  181. */
  182. protected function _prepareDelete(){ }
  183. /**
  184. * Parses the intermediate code produced by \Phalcon\Mvc\Model\Query\Lang generating another
  185. * intermediate representation that could be executed by \Phalcon\Mvc\Model\Query
  186. *
  187. * @param \Phalcon\Mvc\Model\ManagerInterface $manager
  188. * @param \Phalcon\Mvc\Model\MetaDataInterface $metaData
  189. * @return array
  190. */
  191. public function parse(){ }
  192. /**
  193. * Sets the cache parameters of the query
  194. *
  195. * @param array $cacheOptions
  196. */
  197. public function cache($cacheOptions){ }
  198. /**
  199. * Returns the current cache options
  200. *
  201. * @param array
  202. */
  203. public function getCacheOptions(){ }
  204. /**
  205. * Returns the current cache backend instance
  206. *
  207. * @return \Phalcon\Cache\BackendInterface
  208. */
  209. public function getCache(){ }
  210. /**
  211. * Executes the SELECT intermediate representation producing a \Phalcon\Mvc\Model\Resultset
  212. *
  213. * @param array $intermediate
  214. * @param array $bindParams
  215. * @param array $bindTypes
  216. * @return \Phalcon\Mvc\Model\ResultsetInterface
  217. */
  218. protected function _executeSelect(){ }
  219. /**
  220. * Executes the INSERT intermediate representation producing a \Phalcon\Mvc\Model\Query\Status
  221. *
  222. * @param array $intermediate
  223. * @param array $bindParams
  224. * @param array $bindTypes
  225. * @return \Phalcon\Mvc\Model\Query\StatusInterface
  226. */
  227. protected function _executeInsert(){ }
  228. /**
  229. * Query the records on which the UPDATE/DELETE operation well be done
  230. *
  231. * @param \Phalcon\Mvc\Model $model
  232. * @param array $intermediate
  233. * @param array $bindParams
  234. * @param array $bindTypes
  235. * @return \Phalcon\Mvc\Model\ResultsetInterface
  236. */
  237. protected function _getRelatedRecords(){ }
  238. /**
  239. * Executes the UPDATE intermediate representation producing a \Phalcon\Mvc\Model\Query\Status
  240. *
  241. * @param array $intermediate
  242. * @param array $bindParams
  243. * @param array $bindTypes
  244. * @return \Phalcon\Mvc\Model\Query\StatusInterface
  245. */
  246. protected function _executeUpdate(){ }
  247. /**
  248. * Executes the DELETE intermediate representation producing a \Phalcon\Mvc\Model\Query\Status
  249. *
  250. * @param array $intermediate
  251. * @param array $bindParams
  252. * @param array $bindTypes
  253. * @return \Phalcon\Mvc\Model\Query\StatusInterface
  254. */
  255. protected function _executeDelete(){ }
  256. /**
  257. * Executes a parsed PHQL statement
  258. *
  259. * @param array $bindParams
  260. * @param array $bindTypes
  261. * @return mixed
  262. */
  263. public function execute($bindParams=null, $bindTypes=null){ }
  264. /**
  265. * Sets the type of PHQL statement to be executed
  266. *
  267. * @param int $type
  268. */
  269. public function setType($type){ }
  270. /**
  271. * Gets the type of PHQL statement executed
  272. *
  273. * @return int
  274. */
  275. public function getType(){ }
  276. /**
  277. * Allows to set the IR to be executed
  278. *
  279. * @param array $intermediate
  280. */
  281. public function setIntermediate($intermediate){ }
  282. /**
  283. * Returns the intermediate representation of the PHQL statement
  284. *
  285. * @return array
  286. */
  287. public function getIntermediate(){ }
  288. }
  289. }