I have a column with type "simple_array" in my schema definition:
public function up(Schema $schema)
{
$users = $schema->createTable('users');
$users->addColumn('id', 'integer', ['unsigned' => true,
'autoincrement' => true]);
$users->addColumn('email', 'string', ['length' => 100]);
$users->addColumn('roles', 'simple_array');
$users->setPrimaryKey(['id']);
}
With that code above, I was able to generate a table like this:
Now, somewhere in my code, I inserted a record for that users
table:
$connection->insert('users', ['email' => '[email protected]', 'roles' => ['admin', 'editor']]);
I was able to successfully execute that insertion call. But the thing is that the roles
column is not stored as the doctrine's documentation promised - see simple_array in Doctrine Types. Here is how it is actually stored on my part:
I traced the core codebase of Doctrine and I can't really find any hint of transformer codes to transform that "simple_array" type to a comma-imploded string.
I worked with Doctrine ORM before and this was working fine. Is this something that the Doctrine ORM implemented and not by the Doctrine DBAL itself? If so, how should this be done in DBAL? manually?
Thanks.