You are here

class PinEmbedCodeConstraint in Media entity Pinterest 8

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

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

Plugin annotation


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

Hierarchy

  • class \Drupal\media_entity_pinterest\Plugin\Validation\Constraint\PinEmbedCodeConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of PinEmbedCodeConstraint

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

File

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

Namespace

Drupal\media_entity_pinterest\Plugin\Validation\Constraint
View source
class PinEmbedCodeConstraint extends Constraint {

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

}

Members

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