Skip to content

Instantly share code, notes, and snippets.

@damiankloip
Created June 14, 2012 10:36
Show Gist options
  • Save damiankloip/2929509 to your computer and use it in GitHub Desktop.
Save damiankloip/2929509 to your computer and use it in GitHub Desktop.
public function getExporter() {
if (empty($this->exporter)) {
if (class_exists($this->info['exporter class'])) {
$reflection = new \ReflectionClass($this->info['exporter class']);
if ($reflection->implementsInterface('Drupal\ctools\ExporterInterface')) {
$this->exporter = $reflection->newInstance();
}
else {
return FALSE;
}
}
else {
return FALSE;
}
}
return $this->exporter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment