function Comment::bundleFieldDefinitions
Overrides ContentEntityBase::bundleFieldDefinitions
File
-
core/
modules/ comment/ src/ Entity/ Comment.php, line 339
Class
- Comment
- Defines the comment entity class.
Namespace
Drupal\comment\EntityCode
public static function bundleFieldDefinitions(EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
if ($comment_type = CommentType::load($bundle)) {
$fields['entity_id'] = clone $base_field_definitions['entity_id'];
$fields['entity_id']->setSetting('target_type', $comment_type->getTargetEntityTypeId());
return $fields;
}
return [];
}