Conditions | 2 |
Paths | 1 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function add(array $p) |
||
12 | { |
||
13 | $stmt = $this->pdo->prepare("INSERT INTO {$this->prefix}menu_types SET |
||
14 | title = :title, description = :description, menu_type = :menu_type"); |
||
15 | $stmt->bindValue(':title', $p['title']); |
||
16 | $stmt->bindValue(':description', $p['description']); |
||
17 | $stmt->bindValue(':menu_type', Text::sluger(empty($p['menu_type']) ? $p['title'] : $p['menu_type'])); |
||
18 | |||
19 | $stmt->execute(); |
||
20 | |||
21 | return $this->pdo->lastInsertId(); |
||
22 | } |
||
23 | } |
||
24 |