Commit 9cbec9f2 authored by sergei_semipiadniy's avatar sergei_semipiadniy Committed by bojanz

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

Issue #3063450 by sergei_semipiadniy: Replace \Drupal:: typedDataManager() with a service in AddressItem and CountryItem
parent d78ba8f5
......@@ -296,7 +296,7 @@ class AddressItem extends FieldItemBase implements AddressInterface {
*/
public function getConstraints() {
$constraints = parent::getConstraints();
$constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager();
$constraint_manager = $this->getTypedDataManager()->getValidationConstraintManager();
$field_overrides = new FieldOverrides($this->getFieldOverrides());
$constraints[] = $constraint_manager->create('ComplexData', [
'country_code' => [
......
......@@ -76,7 +76,7 @@ class CountryItem extends FieldItemBase {
*/
public function getConstraints() {
$constraints = parent::getConstraints();
$constraint_manager = \Drupal::typedDataManager()->getValidationConstraintManager();
$constraint_manager = $this->getTypedDataManager()->getValidationConstraintManager();
$constraints[] = $constraint_manager->create('ComplexData', [
'value' => [
'Country' => [
......
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