class ScheduledDateProvidedConstraint in Sitewide Alert 8
Plugin implementation of the 'ScheduledDateProvided'.
Plugin annotation
@Constraint(
id = "ScheduledDateProvided",
label = @Translation("Scheduled date provided constraint", context = "Validation"),
type = "entity:sitewide_alert"
)
Hierarchy
- class \Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase extends \Symfony\Component\Validator\Constraint
- class \Drupal\sitewide_alert\Plugin\Validation\Constraint\ScheduledDateProvidedConstraint
Expanded class hierarchy of ScheduledDateProvidedConstraint
File
- src/
Plugin/ Validation/ Constraint/ ScheduledDateProvidedConstraint.php, line 17
Namespace
Drupal\sitewide_alert\Plugin\Validation\ConstraintView source
class ScheduledDateProvidedConstraint extends CompositeConstraintBase {
/**
* Message shown when the entity is marked as scheduled, but no scheduled date is provided.
*
* @var string
*/
public $messageDatesNotProvided = 'This alert is marked as scheduled, but scheduled dates are not provided.';
/**
* An array of entity fields which should be passed to the validator.
*
* @return string[]
* An array of field names.
*/
public function coversFields() {
return [
'scheduled_alert',
'scheduled_date',
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ScheduledDateProvidedConstraint:: |
public | property | Message shown when the entity is marked as scheduled, but no scheduled date is provided. | |
ScheduledDateProvidedConstraint:: |
public | function |
An array of entity fields which should be passed to the validator. Overrides CompositeConstraintBase:: |