Validator/ReplyAuthorizationValidator.php
/**
     * Indicates whether the constraint is valid.
     *
     * @param object|MessageInterface     $value
     * @param Constraint $constraint
     */
Indicates whether the constraint is valid.
@param object|MessageInterface     $value
@param Constraint $constraint
Indicates whether the constraint is valid . @param object|MessageInterface $value @param Constraint $constraint
public function validate($value, Constraint $constraint)
    {
        $sender = $this->participantProvider->getAuthenticatedParticipant();
        $recipients = $value->getThread()->getOtherParticipants($sender);
        foreach ($recipients as $recipient) {
            if (!$this->authorizer->canMessageParticipant($recipient)) {
                $this->getContext()->addViolation($constraint->message);
                return;
            }
        }
    }
public function validate ( $ value , Constraint $ constraint ) { $ sender = $ this -> participantProvider -> getAuthenticatedParticipant ( ) ; $ recipients = $ value -> getThread ( ) -> getOtherParticipants ( $ sender ) ; foreach ( $ recipients as $ recipient ) { if ( ! $ this -> authorizer -> canMessageParticipant ( $ recipient ) ) { $ this -> getContext ( ) -> addViolation ( $ constraint -> message ) ; return ; } } }
Indicates whether the constraint is valid.
Indicates whether the constraint is valid .