class SchedulerUnpublishOnConstraint in Scheduler 8
Same name and namespace in other branches
- 2.x src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraint.php \Drupal\scheduler\Plugin\Validation\Constraint\SchedulerUnpublishOnConstraint
Validates unpublish on values.
Plugin annotation
@Constraint(
id = "SchedulerUnpublishOn",
label = @Translation("Scheduler unpublish on", context = "Validation"),
type = "entity:node"
)
Hierarchy
- class \Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase extends \Symfony\Component\Validator\Constraint
- class \Drupal\scheduler\Plugin\Validation\Constraint\SchedulerUnpublishOnConstraint
Expanded class hierarchy of SchedulerUnpublishOnConstraint
File
- src/
Plugin/ Validation/ Constraint/ SchedulerUnpublishOnConstraint.php, line 16
Namespace
Drupal\scheduler\Plugin\Validation\ConstraintView source
class SchedulerUnpublishOnConstraint extends CompositeConstraintBase {
/**
* Message shown when unpublish_on is missing but publish_on has been entered.
*
* @var string
*/
public $messageUnpublishOnRequiredIfPublishOnEntered = "If you set a 'publish on' date then you must also set an 'unpublish on' date.";
/**
* Message shown when unpublish_on is missing but node is published directly.
*
* @var string
*/
public $messageUnpublishOnRequiredIfPublishing = "Either you must set an 'unpublish on' date or save this node as unpublished.";
/**
* Message shown when unpublish_on is not in the future.
*
* @var string
*/
public $messageUnpublishOnDateNotInFuture = "The 'unpublish on' date must be in the future.";
/**
* Message shown when unpublish date is not later than the publish date.
*
* @var string
*/
public $messageUnpublishOnTooEarly = "The 'unpublish on' date must be later than the 'publish on' date.";
/**
* {@inheritdoc}
*/
public function coversFields() {
return [
'unpublish_on',
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SchedulerUnpublishOnConstraint:: |
public | property | Message shown when unpublish_on is not in the future. | |
SchedulerUnpublishOnConstraint:: |
public | property | Message shown when unpublish_on is missing but node is published directly. | |
SchedulerUnpublishOnConstraint:: |
public | property | Message shown when unpublish_on is missing but publish_on has been entered. | |
SchedulerUnpublishOnConstraint:: |
public | property | Message shown when unpublish date is not later than the publish date. | |
SchedulerUnpublishOnConstraint:: |
public | function |
An array of entity fields which should be passed to the validator. Overrides CompositeConstraintBase:: |