| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function create(array $data) : int |
||
| 25 | 1 | { |
|
| 26 | $conn = $this->db(); |
||
| 27 | 1 | $sql = sprintf( |
|
| 28 | 1 | "INSERT INTO %s (%s) VALUES (:name)", |
|
| 29 | 1 | _DOMAIN::table(), |
|
| 30 | 1 | _DOMAIN::NAME |
|
| 31 | 1 | ); |
|
| 32 | 1 | $stmt = $conn->prepare($sql); |
|
| 33 | 1 | $stmt->bindParam(':name', $data[_DOMAIN::NAME]); |
|
| 34 | 1 | $stmt->execute(); |
|
| 35 | 1 | return (int) $conn->lastInsertId(); |
|
| 36 | 1 | } |
|
| 38 | } |