You are here

class InstagramEmbedCodeConstraint in Media entity Instagram 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Validation/Constraint/InstagramEmbedCodeConstraint.php \Drupal\media_entity_instagram\Plugin\Validation\Constraint\InstagramEmbedCodeConstraint

Check if a value is a valid Instagram embed code/URL.

Plugin annotation


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

Hierarchy

  • class \Drupal\media_entity_instagram\Plugin\Validation\Constraint\InstagramEmbedCodeConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of InstagramEmbedCodeConstraint

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

File

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

Namespace

Drupal\media_entity_instagram\Plugin\Validation\Constraint
View source
class InstagramEmbedCodeConstraint extends Constraint {

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

}

Members

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