You are here

class TweetEmbedCodeConstraint in Media entity Twitter 8

Checks if a value is a valid Tweet embed code/URL.

Plugin annotation


@Constraint(
  id = "TweetEmbedCode",
  label = @Translation("Tweet embed code", context = "Validation"),
  type = { "link", "string", "string_long" }
)

Hierarchy

  • class \Drupal\media_entity_twitter\Plugin\Validation\Constraint\TweetEmbedCodeConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of TweetEmbedCodeConstraint

1 file declares its use of TweetEmbedCodeConstraint
ConstraintsTest.php in tests/src/Unit/ConstraintsTest.php

File

src/Plugin/Validation/Constraint/TweetEmbedCodeConstraint.php, line 16

Namespace

Drupal\media_entity_twitter\Plugin\Validation\Constraint
View source
class TweetEmbedCodeConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'Not valid Tweet URL/embed code.';

}

Members

Namesort descending Modifiers Type Description Overrides
TweetEmbedCodeConstraint::$message public property The default violation message.