|
22 | 22 | use Phalcon\Events\ManagerInterface;
|
23 | 23 |
|
24 | 24 | /**
|
25 |
| - * Base class for Phalcon\Db\Adapter adapters |
| 25 | + * Base class for Phalcon\Db\Adapter adapters. |
| 26 | + * |
| 27 | + * This class and its related classes provide a simple SQL database interface |
| 28 | + * for Phalcon Framework. The Phalcon\Db is the basic class you use to connect |
| 29 | + * your PHP application to an RDBMS. There is a different adapter class for each |
| 30 | + * brand of RDBMS. |
| 31 | + * |
| 32 | + * This component is intended to lower level database operations. If you want to |
| 33 | + * interact with databases using higher level of abstraction use |
| 34 | + * Phalcon\Mvc\Model. |
| 35 | + * |
| 36 | + * Phalcon\Db\AbstractDb is an abstract class. You only can use it with a |
| 37 | + * database adapter like Phalcon\Db\Adapter\Pdo |
| 38 | + * |
| 39 | + * ```php |
| 40 | + * use Phalcon\Db; |
| 41 | + * use Phalcon\Db\Exception; |
| 42 | + * use Phalcon\Db\Adapter\Pdo\Mysql as MysqlConnection; |
| 43 | + * |
| 44 | + * try { |
| 45 | + * $connection = new MysqlConnection( |
| 46 | + * [ |
| 47 | + * "host" => "192.168.0.11", |
| 48 | + * "username" => "sigma", |
| 49 | + * "password" => "secret", |
| 50 | + * "dbname" => "blog", |
| 51 | + * "port" => "3306", |
| 52 | + * ] |
| 53 | + * ); |
| 54 | + * |
| 55 | + * $result = $connection->query( |
| 56 | + * "SELECT FROM co_invoices LIMIT 5" |
| 57 | + * ); |
| 58 | + * |
| 59 | + * $result->setFetchMode(Enum::FETCH_NUM); |
| 60 | + * |
| 61 | + * while ($invoice = $result->fetch()) { |
| 62 | + * print_r($invoice); |
| 63 | + * } |
| 64 | + * } catch (Exception $e) { |
| 65 | + * echo $e->getMessage(), PHP_EOL; |
| 66 | + * } |
| 67 | + * ``` |
26 | 68 | */
|
27 | 69 | abstract class AbstractAdapter implements \Phalcon\Db\Adapter\AdapterInterface, \Phalcon\Events\EventsAwareInterface
|
28 | 70 | {
|
@@ -808,6 +850,16 @@ public function setNestedTransactionsWithSavepoints(bool $nestedTransactionsWith
|
808 | 850 | {
|
809 | 851 | }
|
810 | 852 |
|
| 853 | + /** |
| 854 | + * Enables/disables options in the Database component |
| 855 | + * |
| 856 | + * @param array $options |
| 857 | + * @return void |
| 858 | + */ |
| 859 | + public static function setup(array $options): void |
| 860 | + { |
| 861 | + } |
| 862 | + |
811 | 863 | /**
|
812 | 864 | * Returns a SQL modified with a LOCK IN SHARE MODE clause
|
813 | 865 | *
|
|
0 commit comments