public function create($data, $entity = null)
    {
        $entity = $this->getEntity($entity);
        $fields = $this->getFields();

        // set fields
        foreach ($fields as $key => $mapping) {
            $fieldType = $this->fieldManager->get($mapping['fieldtype'], $mapping);

            // If we have a transformer setup then this takes precedence
            $mappedType = $mapping['fieldtype'];
            $handler = isset($this->transformers[$mappedType]) ? $this->transformers[$mappedType] : null;

            if ($handler) {
                $handler($entity, $data[$key]);
            } else {
                $val = isset($data[$key]) ? $data[$key] : null;
                if ($fieldType instanceof FieldTypeInterface) {
                    $fieldType->set($entity, $val);
                }
            }
        }

        return $entity;
    }