Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 2 | public function test($value) |
|
23 | { |
||
24 | 2 | $statement = $this->pdo->prepare(sprintf( |
|
25 | 2 | 'SELECT COUNT(`%s`) FROM `%s` WHERE `%1$s` = :value', |
|
26 | 2 | $this->field, |
|
27 | 2 | $this->table |
|
28 | 2 | )); |
|
29 | |||
30 | 2 | $statement->bindValue(':value', $value); |
|
31 | 2 | $statement->execute(); |
|
32 | |||
33 | 2 | return $statement->fetchColumn() == 0; |
|
34 | } |
||
35 | } |