Gedmo Doctrine 映射仅限于字符串 - 整数不可用?

Gedmo Doctrine mapping restricted to strings - integer not available?

在构建类型为 integer 的 Doctrine 映射文件后 运行 doctrine:migrations:diff 时出现以下错误。

[Gedmo\Exception\InvalidMappingException] Field - [createdBy] type is not valid and must be 'string' or a reference in class - AyrshireMinis\CourseBundle\Entity\Category

我的 Category.orm.yml 文件包含以下内容:

    createdBy:
        type: string
        gedmo:
            blameable:
                on: create

此列的目的是表示一个用户 ID,因此整数比此配置将生成的 VARCHAR(255) 更有意义。

有没有办法将其设置为整数?

如果您将用户和类别之间的关系设置为 ManyToOne 会更有意义:

  manyToOne:
    createdBy:
      targetEntity: User
      joinColumn:
        name: created_by
        referencedColumnName: id