| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 54 | public function approve(HTTPRequest $request) |
||
| 55 | { |
||
| 56 | $ids = array(); |
||
| 57 | |||
| 58 | foreach ($this->getRecords() as $record) { |
||
| 59 | array_push($ids, $record->ID); |
||
| 60 | $record->markApproved(); |
||
| 61 | } |
||
| 62 | |||
| 63 | $response = new HTTPResponse(json_encode(array( |
||
| 64 | 'done' => true, |
||
| 65 | 'records' => $ids |
||
| 66 | ))); |
||
| 67 | |||
| 68 | $response->addHeader('Content-Type', 'text/json'); |
||
| 69 | |||
| 70 | return $response; |
||
| 71 | } |
||
| 73 |