SchedulerUnpublishOnConstraint.php in Scheduler 8
File
src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraint.php
View source
<?php
namespace Drupal\scheduler\Plugin\Validation\Constraint;
use Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase;
class SchedulerUnpublishOnConstraint extends CompositeConstraintBase {
public $messageUnpublishOnRequiredIfPublishOnEntered = "If you set a 'publish on' date then you must also set an 'unpublish on' date.";
public $messageUnpublishOnRequiredIfPublishing = "Either you must set an 'unpublish on' date or save this node as unpublished.";
public $messageUnpublishOnDateNotInFuture = "The 'unpublish on' date must be in the future.";
public $messageUnpublishOnTooEarly = "The 'unpublish on' date must be later than the 'publish on' date.";
public function coversFields() {
return [
'unpublish_on',
];
}
}