Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 17 |
Ratio | 100 % |
1 | <?php |
||
28 | View Code Duplication | public function spam(SS_HTTPRequest $request) { |
|
29 | $ids = array(); |
||
30 | |||
31 | foreach($this->getRecords() as $record) { |
||
32 | array_push($ids, $record->ID); |
||
33 | $record->markSpam(); |
||
34 | } |
||
35 | |||
36 | $response = new SS_HTTPResponse(Convert::raw2json(array( |
||
37 | 'done' => true, |
||
38 | 'records' => $ids |
||
39 | ))); |
||
40 | |||
41 | $response->addHeader('Content-Type', 'text/json'); |
||
42 | |||
43 | return $response; |
||
44 | } |
||
45 | |||
64 | } |