You are here

class SchedulerPublishOnConstraint in Scheduler 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Validation/Constraint/SchedulerPublishOnConstraint.php \Drupal\scheduler\Plugin\Validation\Constraint\SchedulerPublishOnConstraint

Validates publish on values.

Plugin annotation


@Constraint(
  id = "SchedulerPublishOn",
  label = @Translation("Scheduler publish on", context = "Validation"),
  type = "entity:node"
)

Hierarchy

Expanded class hierarchy of SchedulerPublishOnConstraint

File

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

Namespace

Drupal\scheduler\Plugin\Validation\Constraint
View source
class SchedulerPublishOnConstraint extends CompositeConstraintBase {

  /**
   * Message shown when publish_on is not the future.
   *
   * @var string
   */
  public $messagePublishOnDateNotInFuture = "The 'publish on' date must be in the future.";

  /**
   * {@inheritdoc}
   */
  public function coversFields() {
    return [
      'publish_on',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SchedulerPublishOnConstraint::$messagePublishOnDateNotInFuture public property Message shown when publish_on is not the future.
SchedulerPublishOnConstraint::coversFields public function An array of entity fields which should be passed to the validator. Overrides CompositeConstraintBase::coversFields