/**
  * Test that the factory information makes sense - a type is exactly either translated, simple or complex.
  *
  * @param IAttributeTypeFactory $attributeFactory The attribute type factory to test.
  *
  * @return void
  */
 public function attributeTypeInformationMakesSense($attributeFactory)
 {
     $this->assertTrue($attributeFactory->isTranslatedType() || $attributeFactory->isSimpleType() || $attributeFactory->isComplexType(), $attributeFactory->getTypeName() . ' is neither simple, complex nor translated. But must implement at least one.');
 }
Example #2
0
 /**
  * {@inheritdoc}
  *
  * @throws \RuntimeException When the type is already registered.
  */
 public function addTypeFactory(IAttributeTypeFactory $typeFactory)
 {
     $typeName = $typeFactory->getTypeName();
     if (isset($this->typeFactories[$typeName])) {
         throw new \RuntimeException('Attribute type ' . $typeName . ' is already registered.');
     }
     $this->typeFactories[$typeName] = $typeFactory;
     return $this;
 }