Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SF7.4 - User mapping roles - array type undefined #3100

Description

@Philalawst

I'm on symfony 4
I have a class class User that extends FOS\UserBundle\Model\User

I get this error :

Doctrine\DBAL\Types\Exception\UnknownColumnType:
Unknown column type "array" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgotten to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information.

the mapping type "array' for roles doesn't exist

I try this

#[ORM\AttributeOverrides([
    new AttributeOverride(
        name: 'roles',
        column: new Column(type: SerializedArrayType::NAME)
    )
])]

but i get this error

The column type of attribute 'roles' on class 'App\UserBundle\Entity\User' could not be changed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions