public function TripalEntityCollection::getOutfilePath

3.x TripalEntityCollection.inc public TripalEntityCollection::getOutfilePath($formatter)

Retrieves the path for the downloadable file.

The path is in the Drupal URI format.

Parameters

$formatter: The name of the class

1 call to TripalEntityCollection::getOutfilePath()
TripalEntityCollection::getOutfileURL in tripal/includes/TripalEntityCollection.inc
Retrieves the URL for the downloadable file.

File

tripal/includes/TripalEntityCollection.inc, line 457

Class

TripalEntityCollection

Code

public function getOutfilePath($formatter) {
  if (!$this->isFormatterCompatible($formatter)) {
    throw new Exception(t('The formatter, "@formatter", is not compatible with this data collection.', array('@formatter' => $formatter)));
  }
  if (!tripal_load_include_downloader_class($formatter)) {
    throw new Exception(t('Cannot find the formatter named "@formatter".', array('@formatter', $formatter)));
  }

  $outfile = $this->getOutfile($formatter);
  // Make sure the user directory exists
  $user_dir = 'public://tripal/users/' . $this->user->uid;
  $outfilePath = $user_dir . '/' . $outfile;
  return $outfilePath;
}