public function TripalFieldDownloader::isFieldSupported

3.x TripalFieldDownloader.inc public TripalFieldDownloader::isFieldSupported($field, $instance)

Inidcates if a given field is supported by this Downloader class.

Parameters

$field: A field info array.

3 calls to TripalFieldDownloader::isFieldSupported()
TripalCSVDownloader::isFieldSupported in tripal/includes/TripalFieldDownloaders/TripalCSVDownloader.inc
TripalFieldDownloader::setPrintableFields in tripal/includes/TripalFieldDownloaders/TripalFieldDownloader.inc
Conslidates all the fields into a single list of accession numbers.
TripalTabDownloader::isFieldSupported in tripal/includes/TripalFieldDownloaders/TripalTabDownloader.inc
2 methods override TripalFieldDownloader::isFieldSupported()
TripalCSVDownloader::isFieldSupported in tripal/includes/TripalFieldDownloaders/TripalCSVDownloader.inc
TripalTabDownloader::isFieldSupported in tripal/includes/TripalFieldDownloaders/TripalTabDownloader.inc

File

tripal/includes/TripalFieldDownloaders/TripalFieldDownloader.inc, line 187

Class

TripalFieldDownloader

Code

public function isFieldSupported($field, $instance) {
  $field_name = $field['field_name'];
  $field_type = $field['type'];
  $this_formatter = get_class($this);

  // If a field is a TripalField then check its supported downloaders.
  if (tripal_load_include_field_class($field_type)) {
    $formatters = $field_type::$download_formatters;
    if (in_array($this_formatter, $formatters)) {
      return TRUE;
    }
  }

  // If this is a remote field then check that differently.
  if ($field['storage']['type'] == 'tripal_remote_field') {
    if (in_array($this_formatter, $instance['formatters'])) {
      return TRUE;
    }
  }
}