ekapusta / doctrine-custom-types-bundle
Add custom types like MySQL's enum
Installs: 71 825
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
pkg:composer/ekapusta/doctrine-custom-types-bundle
Requires
- php: ^5.5 || ^7.0 || ^8.0
- doctrine/doctrine-bundle: ^1.6 || ^2.0
- doctrine/orm: ^2.5.14
Requires (Dev)
- doctrine/annotations: ^1.0 || ^2.0
- symfony/dependency-injection: ^3.4 || ^4 || ^5 || ^6
- symfony/phpunit-bridge: >=5.2.12
- symfony/yaml: ^3 || ^4 || ^5 || ^6
README
Add custom types like MySQL's enum.
To add new type
- Add it to
Ekapusta\DoctrineCustomTypesBundle\DBAL\Types - Register it at
Ekapusta\DoctrineCustomTypesBundle\DBAL\TypeRegistry
MySQL ENUM type
To use it in annotations, pass values through options:
/**
* @var string
*
* @ORM\Column(name="sex", type="enum", options={
* "values": {"yes", "no", "maybe"},
* "default": "yes"
* })
*/
private $sex;
PostgreSQL CUBE type
Supports both points and point's sets. Also all cube's functions added. See https://www.postgresql.org/docs/current/static/cube.html
/**
* @var Value\Point
*
* @ORM\Column(name="n_space_point", type="cube", options={
* "default": "(1, 2, 3)"
* })
*/
private $nSpacePoint;
/**
* @var Value\PointSet
*
* @ORM\Column(name="n_space_cube", type="cube", options={
* "default": "(1, 2), (3, 4)"
* })
*/
private $nSpaceCube;