You are here

public function Content::postContent in GatherContent 7.3

Update content in GatherContent.

Parameters

int $content_id: ID of content we want to update.

array $config: Configration array.

Return value

bool Return boolean value.

File

includes/Content.inc, line 183
Contains GatherContent\Accont class.

Class

Content
Class Account.

Namespace

GatherContent

Code

public function postContent($content_id, array $config) {
  try {
    $response = $this->client
      ->post('/items/' . $content_id . '/save', array(
      'body' => array(
        'config' => base64_encode(json_encode($config)),
      ),
    ));
    if ($response
      ->getStatusCode() === 202) {
      return TRUE;
    }
    else {
      return FALSE;
    }
  } catch (\Exception $e) {
    return FALSE;
  }
}