protected function getCallbackResults()
{
$source_file = empty($this->element['source_file']) ? '' : (string) $this->element['source_file'];
$source_class = empty($this->element['source_class']) ? '' : (string) $this->element['source_class'];
$source_method = empty($this->element['source_method']) ? '' : (string) $this->element['source_method'];
if (empty($source_class) || empty($source_method)) {
return '';
}
// Maybe we have to load a file?
if (!empty($source_file)) {
$source_file = $this->form->getContainer()->template->parsePath($source_file, true);
if ($this->form->getContainer()->filesystem->fileExists($source_file)) {
include_once $source_file;
}
}
// Make sure the class exists
if (class_exists($source_class, true)) {
// ...and so does the option
if (in_array($source_method, get_class_methods($source_class))) {
return $source_class::$source_method(array('model' => $this->form->getModel(), 'form' => $this->form, 'formType' => $this->form->getAttribute('type', 'edit'), 'fieldValue' => $this->value, 'fieldElement' => $this->element));
}
}
return '';
}