lamoda / enum-bundle
Utility wrapper around PHP-enum
Installs: 1 608
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 31
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.1 || ^8.0
- doctrine/dbal: ^2.11 || ^3.2
- paillechat/php-enum: ^1.2 || ^2.1
- symfony/config: ^3.4 || ^4.0 || ^5.0 || ^6.0
- symfony/dependency-injection: ^3.4 || ^4.0 || ^5.0 || ^6.0
- symfony/http-kernel: ^3.4 || ^4.0 || ^5.0 || ^6.0
Requires (Dev)
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.0
- symfony/yaml: ^3.4 || ^4.0 || ^5.0 || ^6.0
README
Utility wrapper for https://github.com/paillechat/php-enum
Installation
Usage is as simple as
composer require lamoda/enum-bundle:^1.0
// Kernel public function registerBundles() { // ... $bundles[] = new \Lamoda\EnumBundle\LamodaEnumBundle(); // ... }
# config.yml lamoda_enum: dbal_types: # short example my_domain_enum: My\Domain\Enum # full example my_domain_enum_2: class: My\Domain\Enum # identical strategy saves enum as its name as is, no conversion # lowercase strategy converts enum name to lowercase and vice versa on fetch strategy: identical
class MyEntity { /** @ORM\Column(type="my_domain_enum") */ private $value; }
This will enable conversion of value field from your enum