Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
7 / 7 |
CRAP | |
100.00% |
10 / 10 |
Connection | |
100.00% |
1 / 1 |
|
100.00% |
8 / 8 |
8 | |
100.00% |
10 / 10 |
__construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
|||
selectQuery | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
updateQuery | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
deleteQuery | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
insertQuery | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
countQuery | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
insertId | |
100.00% |
1 / 1 |
1 | ||||||
config | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
<?php | |
namespace PHPixie\Database; | |
abstract class Connection | |
{ | |
protected $name; | |
protected $config; | |
protected $driver; | |
public function __construct($driver, $name, $config) | |
{ | |
$this->driver = $driver; | |
$this->name = $name; | |
$this->config = $config; | |
} | |
public function selectQuery() | |
{ | |
return $this->driver->query('select', $this->name); | |
} | |
public function updateQuery() | |
{ | |
return $this->driver->query('update', $this->name); | |
} | |
public function deleteQuery() | |
{ | |
return $this->driver->query('delete', $this->name); | |
} | |
public function insertQuery() | |
{ | |
return $this->driver->query('insert', $this->name); | |
} | |
public function countQuery() | |
{ | |
return $this->driver->query('count', $this->name); | |
} | |
abstract public function insertId(); | |
public function config() | |
{ | |
return $this->config; | |
} | |
} |