PageRenderTime 52ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/phalcon/devtools/ide/0.8.0/Phalcon/Db/Adapter.php

https://gitlab.com/habracoder/advertising
PHP | 461 lines | 51 code | 85 blank | 325 comment | 0 complexity | c74be3d9c299526a7ab707639fed9c61 MD5 | raw file
  1. <?php
  2. namespace Phalcon\Db {
  3. /**
  4. * Phalcon\Db\Adapter
  5. *
  6. * Base class for Phalcon\Db adapters
  7. */
  8. class Adapter {
  9. protected $_eventsManager;
  10. protected $_descriptor;
  11. protected $_dialectType;
  12. protected $_type;
  13. protected $_dialect;
  14. protected $_connectionId;
  15. protected $_sqlStatement;
  16. protected $_sqlVariables;
  17. protected $_sqlBindTypes;
  18. protected static $_connectionConsecutive;
  19. /**
  20. * \Phalcon\Db\Adapter constructor
  21. *
  22. * @param array $descriptor
  23. */
  24. protected function __construct(){ }
  25. /**
  26. * Sets the event manager
  27. *
  28. * @param \Phalcon\Events\ManagerInterface $eventsManager
  29. */
  30. public function setEventsManager($eventsManager){ }
  31. /**
  32. * Returns the internal event manager
  33. *
  34. * @return \Phalcon\Events\ManagerInterface
  35. */
  36. public function getEventsManager(){ }
  37. /**
  38. * Returns the first row in a SQL query result
  39. *
  40. *<code>
  41. * //Getting first robot
  42. * $robot = $connection->fecthOne("SELECT * FROM robots");
  43. * print_r($robot);
  44. *
  45. * //Getting first robot with associative indexes only
  46. * $robot = $connection->fecthOne("SELECT * FROM robots", \Phalcon\Db::FETCH_ASSOC);
  47. * print_r($robot);
  48. *</code>
  49. *
  50. * @param string $sqlQuery
  51. * @param int $fetchMode
  52. * @param array $bindParams
  53. * @param array $bindTypes
  54. * @return array
  55. */
  56. public function fetchOne($sqlQuery, $fetchMode=null, $bindParams=null, $bindTypes=null){ }
  57. /**
  58. * Dumps the complete result of a query into an array
  59. *
  60. *<code>
  61. * //Getting all robots
  62. * $robots = $connection->fetchAll("SELECT * FROM robots");
  63. * foreach($robots as $robot){
  64. * print_r($robot);
  65. * }
  66. *
  67. * //Getting all robots with associative indexes only
  68. * $robots = $connection->fetchAll("SELECT * FROM robots", \Phalcon\Db::FETCH_ASSOC);
  69. * foreach($robots as $robot){
  70. * print_r($robot);
  71. * }
  72. *</code>
  73. *
  74. * @param string $sqlQuery
  75. * @param int $fetchMode
  76. * @param array $bindParams
  77. * @param array $bindTypes
  78. * @return array
  79. */
  80. public function fetchAll($sqlQuery, $fetchMode=null, $bindParams=null, $bindTypes=null){ }
  81. /**
  82. * Inserts data into a table using custom RBDM SQL syntax
  83. *
  84. * <code>
  85. * //Inserting a new robot
  86. * $success = $connection->insert(
  87. * "robots",
  88. * array("Astro Boy", 1952),
  89. * array("name", "year")
  90. * );
  91. *
  92. * //Next SQL sentence is sent to the database system
  93. * INSERT INTO `robots` (`name`, `year`) VALUES ("Astro boy", 1952);
  94. * </code>
  95. *
  96. * @param string $table
  97. * @param array $values
  98. * @param array $fields
  99. * @param array $dataTypes
  100. * @return boolean
  101. */
  102. public function insert($table, $values, $fields=null, $dataTypes=null){ }
  103. /**
  104. * Updates data on a table using custom RBDM SQL syntax
  105. *
  106. * <code>
  107. * //Updating existing robot
  108. * $success = $connection->update(
  109. * "robots",
  110. * array("name")
  111. * array("New Astro Boy"),
  112. * "id = 101"
  113. * );
  114. *
  115. * //Next SQL sentence is sent to the database system
  116. * UPDATE `robots` SET `name` = "Astro boy" WHERE id = 101
  117. * </code>
  118. *
  119. * @param string $table
  120. * @param array $fields
  121. * @param array $values
  122. * @param string $whereCondition
  123. * @param array $dataTypes
  124. * @return boolean
  125. */
  126. public function update($table, $fields, $values, $whereCondition=null, $dataTypes=null){ }
  127. /**
  128. * Deletes data from a table using custom RBDM SQL syntax
  129. *
  130. * <code>
  131. * //Deleting existing robot
  132. * $success = $connection->delete(
  133. * "robots",
  134. * "id = 101"
  135. * );
  136. *
  137. * //Next SQL sentence is generated
  138. * DELETE FROM `robots` WHERE `id` = 101
  139. * </code>
  140. *
  141. * @param string $table
  142. * @param string $whereCondition
  143. * @param array $placeholders
  144. * @param array $dataTypes
  145. * @return boolean
  146. */
  147. public function delete($table, $whereCondition=null, $placeholders=null, $dataTypes=null){ }
  148. /**
  149. * Gets a list of columns
  150. *
  151. * @param array $columnList
  152. * @return string
  153. */
  154. public function getColumnList($columnList){ }
  155. /**
  156. * Appends a LIMIT clause to $sqlQuery argument
  157. *
  158. * <code>
  159. * echo $connection->limit("SELECT * FROM robots", 5);
  160. * </code>
  161. *
  162. * @param string $sqlQuery
  163. * @param int $number
  164. * @return string
  165. */
  166. public function limit($sqlQuery, $number){ }
  167. /**
  168. * Generates SQL checking for the existence of a schema.table
  169. *
  170. * <code>
  171. * var_dump($connection->tableExists("blog", "posts"));
  172. * </code>
  173. *
  174. * @param string $tableName
  175. * @param string $schemaName
  176. * @return string
  177. */
  178. public function tableExists($tableName, $schemaName=null){ }
  179. /**
  180. * Generates SQL checking for the existence of a schema.view
  181. *
  182. *<code>
  183. * var_dump($connection->viewExists("active_users", "posts"));
  184. *</code>
  185. *
  186. * @param string $viewName
  187. * @param string $schemaName
  188. * @return string
  189. */
  190. public function viewExists($viewName, $schemaName=null){ }
  191. /**
  192. * Returns a SQL modified with a FOR UPDATE clause
  193. *
  194. * @param string $sqlQuery
  195. * @return string
  196. */
  197. public function forUpdate($sqlQuery){ }
  198. /**
  199. * Returns a SQL modified with a LOCK IN SHARE MODE clause
  200. *
  201. * @param string $sqlQuery
  202. * @return string
  203. */
  204. public function sharedLock($sqlQuery){ }
  205. /**
  206. * Creates a table
  207. *
  208. * @param string $tableName
  209. * @param string $schemaName
  210. * @param array $definition
  211. * @return boolean
  212. */
  213. public function createTable($tableName, $schemaName, $definition){ }
  214. /**
  215. * Drops a table from a schema/database
  216. *
  217. * @param string $tableName
  218. * @param string $schemaName
  219. * @param boolean $ifExists
  220. * @return boolean
  221. */
  222. public function dropTable($tableName, $schemaName, $ifExists=null){ }
  223. /**
  224. * Adds a column to a table
  225. *
  226. * @param string $tableName
  227. * @param string $schemaName
  228. * @param \Phalcon\Db\ColumnInterface $column
  229. * @return boolean
  230. */
  231. public function addColumn($tableName, $schemaName, $column){ }
  232. /**
  233. * Modifies a table column based on a definition
  234. *
  235. * @param string $tableName
  236. * @param string $schemaName
  237. * @param \Phalcon\Db\ColumnInterface $column
  238. * @return boolean
  239. */
  240. public function modifyColumn($tableName, $schemaName, $column){ }
  241. /**
  242. * Drops a column from a table
  243. *
  244. * @param string $tableName
  245. * @param string $schemaName
  246. * @param string $columnName
  247. * @return boolean
  248. */
  249. public function dropColumn($tableName, $schemaName, $columnName){ }
  250. /**
  251. * Adds an index to a table
  252. *
  253. * @param string $tableName
  254. * @param string $schemaName
  255. * @param \Phalcon\Db\IndexInterface $index
  256. * @return boolean
  257. */
  258. public function addIndex($tableName, $schemaName, $index){ }
  259. /**
  260. * Drop an index from a table
  261. *
  262. * @param string $tableName
  263. * @param string $schemaName
  264. * @param string $indexName
  265. * @return boolean
  266. */
  267. public function dropIndex($tableName, $schemaName, $indexName){ }
  268. /**
  269. * Adds a primary key to a table
  270. *
  271. * @param string $tableName
  272. * @param string $schemaName
  273. * @param \Phalcon\Db\IndexInterface $index
  274. * @return boolean
  275. */
  276. public function addPrimaryKey($tableName, $schemaName, $index){ }
  277. /**
  278. * Drops a table's primary key
  279. *
  280. * @param string $tableName
  281. * @param string $schemaName
  282. * @return boolean
  283. */
  284. public function dropPrimaryKey($tableName, $schemaName){ }
  285. /**
  286. * Adds a foreign key to a table
  287. *
  288. * @param string $tableName
  289. * @param string $schemaName
  290. * @param \Phalcon\Db\ReferenceInterface $reference
  291. * @return boolean true
  292. */
  293. public function addForeignKey($tableName, $schemaName, $reference){ }
  294. /**
  295. * Drops a foreign key from a table
  296. *
  297. * @param string $tableName
  298. * @param string $schemaName
  299. * @param string $referenceName
  300. * @return boolean true
  301. */
  302. public function dropForeignKey($tableName, $schemaName, $referenceName){ }
  303. /**
  304. * Returns the SQL column definition from a column
  305. *
  306. * @param \Phalcon\Db\ColumnInterface $column
  307. * @return string
  308. */
  309. public function getColumnDefinition($column){ }
  310. /**
  311. * List all tables on a database
  312. *
  313. *<code>
  314. * print_r($connection->listTables("blog");
  315. *</code>
  316. *
  317. * @param string $schemaName
  318. * @return array
  319. */
  320. public function listTables($schemaName=null){ }
  321. /**
  322. * Return descriptor used to connect to the active database
  323. *
  324. * @return array
  325. */
  326. public function getDescriptor(){ }
  327. /**
  328. * Gets the active connection unique identifier
  329. *
  330. * @return string
  331. */
  332. public function getConnectionId(){ }
  333. /**
  334. * Active SQL statement in the object
  335. *
  336. * @return string
  337. */
  338. public function getSQLStatement(){ }
  339. /**
  340. * Active SQL statement in the object without replace bound paramters
  341. *
  342. * @return string
  343. */
  344. public function getRealSQLStatement(){ }
  345. /**
  346. * Active SQL statement in the object
  347. *
  348. * @return array
  349. */
  350. public function getSQLVariables(){ }
  351. /**
  352. * Active SQL statement in the object
  353. *
  354. * @return array
  355. */
  356. public function getSQLBindTypes(){ }
  357. /**
  358. * Returns type of database system the adapter is used for
  359. *
  360. * @return string
  361. */
  362. public function getType(){ }
  363. /**
  364. * Returns the name of the dialect used
  365. *
  366. * @return string
  367. */
  368. public function getDialectType(){ }
  369. /**
  370. * Returns internal dialect instance
  371. *
  372. * @return \Phalcon\Db\DialectInterface
  373. */
  374. public function getDialect(){ }
  375. }
  376. }