Doctrine ORM - how to map jsonb / yaml?
This is supported by doctrine/dbal v2.6+ (it requires PHP 7.1). All you need to do is use json_array
and set options={"jsonb"=true}
I tested this on doctrine/dbal v2.6.3
This is what it looks like in PHP format
/**
* @ORM\Column(type="json_array",nullable=true,options={"jsonb"=true})
*/
private $details;
and it creates query such as (for existing talble):
ALTER TABLE mytable ADD details JSONB NOT NULL;
more details about type mapping can be found at Doctrine mapping matrix.