public function Content::updateStatus in GatherContent 7.3
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
- includes/
Content.inc, line 73 - Contains GatherContent\Accont class.
Class
- Content
- Class Account.
Namespace
GatherContentCode
public function updateStatus($content_id, $status_id) {
try {
$response = $this->client
->post('/items/' . $content_id . '/choose_status', array(
'body' => array(
'status_id' => $status_id,
),
));
if ($response
->getStatusCode() === 202) {
return TRUE;
}
else {
return FALSE;
}
} catch (\Exception $e) {
drupal_set_message($e
->getMessage(), 'error');
watchdog('gathercontent', $e
->getMessage(), array(), WATCHDOG_ERROR);
return FALSE;
}
}