Same name in other branches
- 8.x-1.x src/EntityClone/Content/ContentEntityCloneBase.php \Drupal\entity_clone\EntityClone\Content\ContentEntityCloneBase::fieldIsClonable()
Determines if a field is clonable.
Parameters
\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition.
Return value
bool TRUE if the field is clonable; FALSE otherwise.
1 call to ContentEntityCloneBase::fieldIsClonable()
- ContentEntityCloneBase::cloneEntity in src/
EntityClone/ Content/ ContentEntityCloneBase.php - Clone an entity.
File
-
src/
EntityClone/ Content/ ContentEntityCloneBase.php, line 158
Class
- ContentEntityCloneBase
- Class Content Entity Clone Base.
Namespace
Drupal\entity_clone\EntityClone\ContentCode
protected function fieldIsClonable(FieldDefinitionInterface $field_definition) {
$clonable_field_types = [
'entity_reference',
'entity_reference_revisions',
];
$type_is_clonable = in_array($field_definition->getType(), $clonable_field_types, TRUE);
if ($field_definition instanceof FieldConfigInterface && $type_is_clonable) {
return TRUE;
}
return FALSE;
}