CodeExplorer implementsFieldInterface example
return $class;
} public function createField(array
$field): Field
{ $class =
new Field();
$class->
setName($field['name'
]);
$class->
setLabel($field['label'
]);
$class->
setTypeName($field['type'
]);
$className =
$this->
getClassByAlias($field['type'
]) ?:
$field['type'
];
if (!\
is_string($className) || !
class_exists($className) || !
$this->
implementsFieldInterface($className)) { $className = DummyField::
class;
} $class->
setType(new $className());
if (isset($field['showListing'
])) { $class->
setShowListing($field['showListing'
]);
} if (isset($field['searchAble'
])) { $class->
setSearchAble($field['searchAble'
]);
}