/** * @param Attribute $attribute * @return AttributeTypeInterface */ protected function getAttributeType(Attribute $attribute) { $type = $attribute->getType(); if (!$type) { throw new TransformationFailedException('Attribute type is not defined'); } $typeObject = $this->typeRegistry->getTypeByName($type); if (!$typeObject) { throw new TransformationFailedException(sprintf('Unknown attribute type "%s"', $type)); } return $typeObject; }