class WeatherDisplayConstraintValidator in Weather 2.0.x
Same name and namespace in other branches
- 8 src/Plugin/Validation/Constraint/WeatherDisplayConstraintValidator.php \Drupal\weather\Plugin\Validation\Constraint\WeatherDisplayConstraintValidator
Constraint validator for changing path aliases in pending revisions.
Hierarchy
- class \Drupal\weather\Plugin\Validation\Constraint\WeatherDisplayConstraintValidator extends \Symfony\Component\Validator\ConstraintValidator implements ContainerInjectionInterface
Expanded class hierarchy of WeatherDisplayConstraintValidator
File
- src/
Plugin/ Validation/ Constraint/ WeatherDisplayConstraintValidator.php, line 15
Namespace
Drupal\weather\Plugin\Validation\ConstraintView source
class WeatherDisplayConstraintValidator extends ConstraintValidator implements ContainerInjectionInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
private $entityTypeManager;
/**
* Creates a new PathAliasConstraintValidator instance.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('entity_type.manager'));
}
/**
* {@inheritdoc}
*/
public function validate($entity, Constraint $constraint) {
if ($entity instanceof ContentEntityInterface && $entity
->isNew()) {
$type = $entity->type->value;
$number = $entity->number->value;
$sdf = '';
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
WeatherDisplayConstraintValidator:: |
private | property | The entity type manager. | |
WeatherDisplayConstraintValidator:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
WeatherDisplayConstraintValidator:: |
public | function | ||
WeatherDisplayConstraintValidator:: |
public | function | Creates a new PathAliasConstraintValidator instance. |