protected function getCoreFieldType($identifier)
{
if (!isset($this->coreFieldTypeMap[$identifier])) {
throw new FieldTypeNotFoundException($identifier);
}
$fieldType = $this->coreFieldTypeMap[$identifier];
if (!$this->coreFieldTypeMap[$identifier] instanceof FieldTypeInterface) {
if (!is_callable($this->coreFieldTypeMap[$identifier])) {
throw new RuntimeException("FieldType '{$identifier}' is not callable or instance");
}
/** @var $fieldType \Closure */
$fieldType = $fieldType();
}
return $fieldType;
}