Commit d974ddc7 authored by sergei_semipiadniy's avatar sergei_semipiadniy Committed by bojanz

Issue #3063454 by sergei_semipiadniy: Replace \Drupal:: typedDataManager()...

Issue #3063454 by sergei_semipiadniy: Replace \Drupal:: typedDataManager() with a service in DimensionsItem and MeasurementItem
parent 04d8de1c
......@@ -85,9 +85,9 @@ class DimensionsItem extends FieldItemBase {
* {@inheritdoc}
*/
public function getConstraints() {
$manager = \Drupal::typedDataManager()->getValidationConstraintManager();
$constraint_manager = $this->getTypedDataManager()->getValidationConstraintManager();
$constraints = parent::getConstraints();
$constraints[] = $manager->create('Dimensions', []);
$constraints[] = $constraint_manager->create('Dimensions', []);
return $constraints;
}
......
......@@ -69,9 +69,9 @@ class MeasurementItem extends FieldItemBase implements PreconfiguredFieldUiOptio
* {@inheritdoc}
*/
public function getConstraints() {
$manager = \Drupal::typedDataManager()->getValidationConstraintManager();
$constraint_manager = $this->getTypedDataManager()->getValidationConstraintManager();
$constraints = parent::getConstraints();
$constraints[] = $manager->create('ComplexData', [
$constraints[] = $constraint_manager->create('ComplexData', [
'number' => [
'Regex' => [
'pattern' => '/^[+-]?((\d+(\.\d*)?)|(\.\d+))$/i',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment