You are here

protected function CommentNameConstraintValidator::getAnonymousContactDetailsSetting in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 98
Contains \Drupal\comment\Plugin\Validation\Constraint\CommentNameConstraintValidator.

Class

CommentNameConstraintValidator
Validates the CommentName constraint.

Namespace

Drupal\comment\Plugin\Validation\Constraint

Code

protected function getAnonymousContactDetailsSetting(CommentInterface $comment) {
  return $comment
    ->getCommentedEntity()
    ->get($comment
    ->getFieldName())
    ->getFieldDefinition()
    ->getSetting('anonymous');
}