gollumsf / doctrine-arraypipe
An array pipe type for Doctrine MYSQL
v1.1.3
2022-05-20 21:56 UTC
Requires
- php: >=7.0
- doctrine/dbal: ^2|^3
README
An array pipe type for Doctrine MYSQL
Installation:
composer require gollumsf/doctrine-arraypipe
Configuration:
doctrine: dbal: types: array_pipe: GollumSF\Doctrine\ArrayPipe
Usage:
namespace App\Entity; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Table() */ class Entity { /** * @ORM\Column(type="array_pipe") * @var int */ private $arrayPipe = [ 'ROLE_EXAMPLE', 'ROLE_USER', 'ROLE_ADMIN' ]; // Storage data in database with value: ROLE_EXAMPLE|ROLE_USER|ROLE_ADMIN ///////// // ... // ///////// }