| Total Complexity | 7 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class Client |
||
| 14 | { |
||
| 15 | /** @var Connection */ |
||
| 16 | protected $Conn; |
||
| 17 | /** @var string */ |
||
| 18 | protected $connection_string; |
||
| 19 | |||
| 20 | public function __construct($connection_string = '') |
||
| 21 | { |
||
| 22 | $this->connection_string = $connection_string; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return Connection |
||
| 27 | * @throws DBALException |
||
| 28 | */ |
||
| 29 | public function getConnection() |
||
| 30 | { |
||
| 31 | if (null === $this->Conn) { |
||
| 32 | $config = new Configuration(); |
||
| 33 | $connectionParams = ['url' => $this->connection_string]; |
||
| 34 | $this->Conn = DriverManager::getConnection($connectionParams, $config); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $this->Conn; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param Connection $Conn |
||
| 42 | * @return $this |
||
| 43 | */ |
||
| 44 | public function setConnection(Connection $Conn) |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $connection_string |
||
| 52 | * @return $this |
||
| 53 | */ |
||
| 54 | public function setConnectionString($connection_string) |
||
| 55 | { |
||
| 56 | $this->connection_string = $connection_string; |
||
| 57 | return $this; |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getConnectionString() |
||
| 64 | { |
||
| 65 | return $this->connection_string; |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @throws DBALException |
||
| 70 | */ |
||
| 71 | public function createTable() |
||
| 82 | } |
||
| 83 | } |
||
| 84 |