public function map(array $fields, EntityDefinition $entityDefinition) { $entityReflection = new \ReflectionClass($entityDefinition->getClassName()); $instance = $this->createEntityInstance($entityReflection); $this->mapEntityFields($fields, $entityReflection, $instance, $entityDefinition->getFields()); return $instance; }
public function testCanCreateADefinitionForDateTimeField() { $definition = $this->definitionCreator->create(EntityWithSingleDateTime::class); $expectedDefinition = new EntityDefinition(EntityWithSingleDateTime::class); $expectedDefinition->addField(new EntityFieldDefinition('field', 'field', 'DateTime')); $this->assertEquals($expectedDefinition, $definition); }