You are here

FacebookEmbedCodeConstraint.php in Media entity facebook 8

File

src/Plugin/Validation/Constraint/FacebookEmbedCodeConstraint.php
View source
<?php

namespace Drupal\media_entity_facebook\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Check if a value is a valid Facebook embed code or post URL.
 *
 * @constraint(
 *   id = "FacebookEmbedCode",
 *   label = @Translation("Facebook embed code", context = "Validation"),
 *   type = { "link", "string", "string_long" }
 * )
 */
class FacebookEmbedCodeConstraint extends Constraint {

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

}

Classes

Namesort descending Description
FacebookEmbedCodeConstraint Check if a value is a valid Facebook embed code or post URL.