protected function CommentNameConstraintValidator::getAnonymousContactDetailsSetting in Drupal 9
Same name and namespace in other branches
- 8 core/modules/comment/src/Plugin/Validation/Constraint/CommentNameConstraintValidator.php \Drupal\comment\Plugin\Validation\Constraint\CommentNameConstraintValidator::getAnonymousContactDetailsSetting()
- 10 core/modules/comment/src/Plugin/Validation/Constraint/CommentNameConstraintValidator.php \Drupal\comment\Plugin\Validation\Constraint\CommentNameConstraintValidator::getAnonymousContactDetailsSetting()
Gets the anonymous contact details setting from the comment.
Parameters
\Drupal\comment\CommentInterface $comment: The entity.
Return value
int The anonymous contact setting.
1 call to CommentNameConstraintValidator::getAnonymousContactDetailsSetting()
- CommentNameConstraintValidator::validate in core/
modules/ comment/ src/ Plugin/ Validation/ Constraint/ CommentNameConstraintValidator.php
File
- core/
modules/ comment/ src/ Plugin/ Validation/ Constraint/ CommentNameConstraintValidator.php, line 95
Class
- CommentNameConstraintValidator
- Validates the CommentName constraint.
Namespace
Drupal\comment\Plugin\Validation\ConstraintCode
protected function getAnonymousContactDetailsSetting(CommentInterface $comment) {
return $comment
->getCommentedEntity()
->get($comment
->getFieldName())
->getFieldDefinition()
->getSetting('anonymous');
}