Bluz\Db\Db
PDO wrapper
- Author: Anton Shevchuk
Synopsis
- // members
- protected array $connect = ;
- protected array $attributes = ;
- protected PDO $handler;
- // methods
- public void setConnect()
- private void checkConnect()
- public void setAttributes()
- public bool connect()
- public void disconnect()
- public PDO handler()
- protected PDOStatement prepare()
- public string quote()
- public string quoteIdentifier()
- public integer query()
- public Select select()
- public Insert insert()
- public Update update()
- public Delete delete()
- public string fetchOne()
- public array fetchRow()
- public array fetchAll()
- public array fetchColumn()
- public array fetchGroup()
- public array fetchColumnGroup()
- public array fetchUniqueGroup()
- public array fetchPairs()
- public array fetchObject()
- public array fetchObjects()
- public array fetchRelations()
- public mixed|bool transaction()
- protected void ok()
- protected void log()
- // Inherited methods from Options
- public mixed getOption()
- public void setOption()
- public array getOptions()
- public Options setOptions()
- protected void initOptions()
Hierarchy
Uses
Tasks
Line | Task |
---|---|
185+ | Switch to PDO::activeQueryString() when it will be possible |
Members
protected
- $attributes
—
array
PDO connection flags - $connect
—
array
PDO connection settings - $handler — \PDO
- $options — array
Methods
private
- checkConnect() — Check connection options
protected
- log() — Log queries by Application
- ok() — Setup timer
- prepare() — Prepare SQL query and return PDO Statement
public
- connect() — Connect to Db
- delete() — Create new query update builder
- disconnect() — Disconnect PDO and clean default adapter
- fetchAll() — Returns an array containing all of the result set rows
- fetchColumn() — Returns an array containing one column from the result set rows
- fetchColumnGroup() — Returns an array containing all of the result set rows
- fetchGroup() — Returns an array containing all of the result set rows
- fetchObject() — Returns an object containing first row from the result set
- fetchObjects() — Returns an array of objects containing the result set
- fetchOne() — Return first field from first element from the result set
- fetchPairs() — Returns a key-value array
- fetchRelations() — Returns an array of linked objects containing the result set
- fetchRow() — Returns an array containing first row from the result set
- fetchUniqueGroup() — Returns an array containing all of the result set rows
- handler() — Return PDO handler
- insert() — Create new query insert builder
- query() — Execute SQL query
- quote() — Quotes a string for use in a query
- quoteIdentifier() — Quote a string so it can be safely used as a table or column name
- select() — Create new query select builder
- setAttributes() — Setup attributes for PDO connect
- setConnect() — Setup connection
- transaction() — Transaction wrapper
- update() — Create new query update builder
Inherited from Bluz\Common\Options
protected
- initOptions() — Check and initialize options in package
public
- getOption() — Get option by key
- getOptions() — Get all options
- setOption() — Set option by key over setter
- setOptions() — Setup, check and init options
History
-
2017-11-08T13:30:40+00:00 (commit #8610502)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated codestyle
-
2017-11-07T12:29:29+00:00 (commit #2c5c5ce)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added method `Db::fetchUniqueGroup()` Added method `Table::getMeta()` Updated codestyle of tests
-
2017-11-03T16:03:38+00:00 (commit #32848b7)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated debug information
-
2017-10-19T15:32:22+00:00 (commit #ed1c7a8)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added returned value for transactions
-
2017-08-03T14:11:40+00:00 (commit #15278f6)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Renamed `Line` to `Str` Added `class_namespace` function
-
2017-06-30T08:36:40+00:00 (commit #2259ecf)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed comments style
-
2017-04-24T16:04:21+00:00 (commit #d59d72a)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added `value()` function Refactoring for all callable arguments
-
2017-04-21T15:14:44+00:00 (commit #c7538da)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Replace `sizeof` to `count`
-
2017-04-21T13:24:35+00:00 (commit #3b25a3d)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small update for codestyle
-
2017-02-15T16:09:44+00:00 (commit #0fc0c8b)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated coveralls config
-
2017-02-13T10:14:18+00:00 (commit #43dbf55)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Rollback to `getCount()` method
-
2017-01-30T13:15:49+00:00 (commit #fd5d943)
Author: Anton (AntonShevchuk@gmail.com) / Commiter: GitHub (AntonShevchuk@gmail.com)
Merge pull request #395 from AntonShevchuk/master Added `AttachmentResponse`
-
2017-01-30T12:38:53+00:00 (commit #0ab8691)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added `AttachmentResponse` Added `attachment($file)` helper for `Controller`