CommentNameConstraintValidator
class CommentNameConstraintValidator extends ConstraintValidator implements ContainerInjectionInterface (View source)
Validates the CommentName constraint.
Properties
| protected ExecutionContextInterface | $context | Validator 2.5 and upwards compatible execution context. |
|
| protected UserStorageInterface | $userStorage | User storage handler. |
Methods
Instantiates a new instance of this class.
{@inheritdoc}
Gets the anonymous contact details setting from the comment.
Details
__construct(UserStorageInterface $user_storage)
Constructs a new CommentNameConstraintValidator.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
validate($entity, Constraint $constraint)
{@inheritdoc}
protected int
getAnonymousContactDetailsSetting(CommentInterface $comment)
Gets the anonymous contact details setting from the comment.