Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function delete() |
||
44 | { |
||
45 | //security checks |
||
46 | $this->onlyAdmin(); |
||
47 | $this->onlyPost(); |
||
48 | |||
49 | //preparing our return results |
||
50 | $result = array(); |
||
51 | $DeleteJson = ($this->request->getData('tag-delete')); |
||
52 | $Delete = json_decode($DeleteJson); |
||
53 | |||
54 | //Converting our array of objects to simple array |
||
55 | $send = array(); |
||
56 | foreach ($Delete as $item) { |
||
57 | $send[$item->name] = $item->value; |
||
58 | } |
||
59 | |||
60 | $tagModel = new TagModel($this->container); |
||
61 | $result['success'] = $tagModel->delete($send["idtags"]); |
||
62 | echo json_encode($result); |
||
63 | } |
||
64 | } |