Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function add($p) |
||
10 | { |
||
11 | $stmt = $this->pdo->prepare("INSERT INTO {$this->prefix}menu SET module_name = '', |
||
12 | parent_id = :parent_id, title = :title, slug = :slug, caption = :caption, |
||
13 | menu_type = :menu_type, item_type = :item_type, position = :position"); |
||
14 | $stmt->bindValue(':parent_id', $p['parent_id'], \PDO::PARAM_INT); |
||
15 | $stmt->bindValue(':title', $p['title']); |
||
16 | $stmt->bindValue(':slug', $p['slug']); |
||
17 | $stmt->bindValue(':caption', $p['caption']); |
||
18 | $stmt->bindValue(':menu_type', $p['menu_type']); |
||
19 | $stmt->bindValue(':item_type', $p['item_type']); |
||
20 | $stmt->bindValue(':position', (int) $p['position'], \PDO::PARAM_INT); |
||
21 | |||
22 | $stmt->execute(); |
||
23 | |||
24 | return $this->pdo->lastInsertId(); |
||
25 | } |
||
26 | } |
||
27 |