| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function isUnique(string $slug, string $table, string $columnName) |
||
| 12 | { |
||
| 13 | $slugTbl = $this->getTablePrefix($table); |
||
| 14 | |||
| 15 | //TODO verify vars |
||
| 16 | |||
| 17 | $sql = "SELECT * FROM $slugTbl WHERE $columnName = :slug"; |
||
| 18 | $stmt = $this->dbh->prepare($sql); |
||
| 19 | $stmt->bindValue(':slug', $slug); |
||
| 20 | $stmt->execute(); |
||
| 21 | return !$stmt->rowCount() > 0; |
||
| 22 | |||
| 24 | } |