protected function CommentNameConstraintValidator::getAnonymousContactDetailsSetting in Drupal 8
Same name and namespace in other branches
- 9 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 - Checks if the passed value is valid.
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');
}