public function Content::updateStatus in GatherContent 8.3
Same name and namespace in other branches
- 8 src/DAO/Content.php \Drupal\gathercontent\DAO\Content::updateStatus()
Update status of content.
Parameters
int $content_id: ID of content we want to update.
int $status_id: Status ID.
Return value
bool Return TRUE on success.
File
- src/
DAO/ Content.php, line 66
Class
- Content
- Class Account.
Namespace
Drupal\gathercontent\DAOCode
public function updateStatus($content_id, $status_id) {
try {
$response = $this->client
->post('/items/' . $content_id . '/choose_status', [
'form_params' => [
'status_id' => $status_id,
],
]);
if ($response
->getStatusCode() === 202) {
return TRUE;
}
else {
return FALSE;
}
} catch (\Exception $e) {
drupal_set_message($e
->getMessage(), 'error');
\Drupal::logger('gathercontent')
->error($e
->getMessage(), []);
return FALSE;
}
}