public function Content::getFiles in GatherContent 7.3
Get list of files.
Parameters
int $content_id: ID of content, we want to fetch files for.
Return value
array Array with accounts.
File
- includes/
Content.inc, line 207 - Contains GatherContent\Accont class.
Class
- Content
- Class Account.
Namespace
GatherContentCode
public function getFiles($content_id) {
$accounts = array();
try {
$response = $this->client
->get('/items/' . $content_id . '/files');
if ($response
->getStatusCode() === 200) {
$data = json_decode($response
->getBody());
$accounts = $data->data;
}
else {
drupal_set_message(t("User with provided credentials wasn't found."), 'error');
}
} catch (\Exception $e) {
drupal_set_message($e
->getMessage(), 'error');
watchdog('gathercontent', $e
->getMessage(), array(), WATCHDOG_ERROR);
}
return $accounts;
}