@@ 954-957 (lines=4) @@ | ||
951 | */ |
|
952 | protected function saveOrPublish($data, $form, $doPublish = false) |
|
953 | { |
|
954 | if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
|
955 | return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
|
956 | ->addHeader('Content-Type', 'application/json'); |
|
957 | } |
|
958 | ||
959 | $id = (int) $data['ID']; |
|
960 | /** @var File $record */ |
|
@@ 1004-1007 (lines=4) @@ | ||
1001 | ||
1002 | public function unpublish($data, $form) |
|
1003 | { |
|
1004 | if (!isset($data['ID']) || !is_numeric($data['ID'])) { |
|
1005 | return (new HTTPResponse(json_encode(['status' => 'error']), 400)) |
|
1006 | ->addHeader('Content-Type', 'application/json'); |
|
1007 | } |
|
1008 | ||
1009 | $id = (int) $data['ID']; |
|
1010 | /** @var File $record */ |