You are here

public function GatherContentCurl::getFiles in GatherContent 7.2

Get file array for a specific page.

File

includes/curl.inc, line 138
Contains functions used to process and retrieve data from GatherContent.

Class

GatherContentCurl
@file Contains functions used to process and retrieve data from GatherContent.

Code

public function getFiles($page_id) {
  $files = $this
    ->get('get_files_by_page', array(
    'id' => $page_id,
  ));
  if ($files && isset($files->files) && $this
    ->foreachSafe($files->files)) {
    foreach ($files->files as $file) {
      if (!isset($this->files[$file->page_id])) {
        $this->files[$file->page_id] = array();
      }
      if (!isset($this->files[$file->page_id][$file->field])) {
        $this->files[$file->page_id][$file->field] = array();
      }
      $this->files[$file->page_id][$file->field][] = $file;
    }
  }
}