public function FieldFormBase::uniqueFieldName in Display Suite 8.2
Same name and namespace in other branches
- 8.4 src/Form/FieldFormBase.php \Drupal\ds\Form\FieldFormBase::uniqueFieldName()
- 8.3 src/Form/FieldFormBase.php \Drupal\ds\Form\FieldFormBase::uniqueFieldName()
Returns whether a field machine name is unique.
File
- src/
Form/ FieldFormBase.php, line 224
Class
- FieldFormBase
- Base form for fields.
Namespace
Drupal\ds\FormCode
public function uniqueFieldName($name) {
$value = strtr($name, array(
'-' => '_',
));
$config = $this
->configFactory()
->get('ds.field.' . $value);
if ($config
->get()) {
return TRUE;
}
return FALSE;
}