Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 17 |
Ratio | 100 % |
1 | <?php |
||
47 | View Code Duplication | public function approve(SS_HTTPRequest $request) { |
|
48 | $ids = array(); |
||
49 | |||
50 | foreach($this->getRecords() as $record) { |
||
51 | array_push($ids, $record->ID); |
||
52 | $record->markApproved(); |
||
53 | } |
||
54 | |||
55 | $response = new SS_HTTPResponse(Convert::raw2json(array( |
||
56 | 'done' => true, |
||
57 | 'records' => $ids |
||
58 | ))); |
||
59 | |||
60 | $response->addHeader('Content-Type', 'text/json'); |
||
61 | |||
62 | return $response; |
||
63 | } |
||
64 | } |