[ Index ] |
PHP Cross Reference of YOURLS |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of Aura for PHP. 5 * 6 * @license https://opensource.org/licenses/MIT MIT 7 * 8 */ 9 namespace Aura\Sql; 10 11 /** 12 * 13 * Locates PDO connections for default, read, and write databases. 14 * 15 * @package Aura.Sql 16 * 17 */ 18 interface ConnectionLocatorInterface 19 { 20 /** 21 * 22 * Sets the default connection registry entry. 23 * 24 * @param callable $callable The registry entry. 25 * 26 * @return void 27 */ 28 public function setDefault(callable $callable): void; 29 30 /** 31 * 32 * Returns the default connection object. 33 * 34 * @return ExtendedPdoInterface 35 * 36 */ 37 public function getDefault(): ExtendedPdoInterface; 38 39 /** 40 * 41 * Sets a read connection registry entry by name. 42 * 43 * @param string $name The name of the registry entry. 44 * 45 * @param callable $callable The registry entry. 46 * 47 * @return void 48 */ 49 public function setRead(string $name, callable $callable): void; 50 51 /** 52 * 53 * Returns a read connection by name; if no name is given, picks a 54 * random connection; if no read connections are present, returns the 55 * default connection. 56 * 57 * @param string $name The read connection name to return. 58 * 59 * @return ExtendedPdoInterface 60 * 61 */ 62 public function getRead(string $name = ''): ExtendedPdoInterface; 63 64 /** 65 * 66 * Sets a write connection registry entry by name. 67 * 68 * @param string $name The name of the registry entry. 69 * 70 * @param callable $callable The registry entry. 71 * 72 * @return void 73 */ 74 public function setWrite(string $name, callable $callable): void; 75 76 /** 77 * 78 * Returns a write connection by name; if no name is given, picks a 79 * random connection; if no write connections are present, returns the 80 * default connection. 81 * 82 * @param string $name The write connection name to return. 83 * 84 * @return ExtendedPdoInterface 85 * 86 */ 87 public function getWrite(string $name = ''): ExtendedPdoInterface; 88 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Apr 1 05:10:01 2025 | Cross-referenced by PHPXref 0.7.1 |