public function __construct(array $config = [])
{
if (empty($config['type'])) {
$config['type'] = $this->getType();
$config['name'] = $this->getName();
if (empty($config['name'])) {
$config['name'] = $this->getAutoName();
}
}
if (TypeService::isScalarType($config['type'])) {
$config['type'] = TypeFactory::getScalarType($config['type']);
}
$this->nameCache = isset($config['name']) ? $config['name'] : $this->getAutoName();
$this->config = new FieldConfig($config, $this, $this->isFinal);
$this->build($this->config);
}