Skip to content

Commit

Permalink
BooleanEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
Majkl578 committed Oct 12, 2017
1 parent 729ee86 commit c9dfa81
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"consistence/consistence-doctrine": "~1.1",
"consistence/consistence-doctrine": "~1.2",
"doctrine/doctrine-bundle": "~1.3",
"symfony/config": "~3.0",
"symfony/dependency-injection": "~3.0",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Now you can use the `Sex` enum in your `User` entity. There are two important th

You can specify any other parameters for `ORM\Column` as you would usually (nullability, length...).

There is also `integer_enum` and `float_enum` which can be used respectively for their types.
There is also `integer_enum`, `float_enum` and `boolean_enum` which can be used respectively for their types.

2) `@Enum(class=Sex::class)` - this will be used for reconstructing the `Sex`
enum object when loading the value back from database
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/ConsistenceDoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Consistence\Doctrine\SymfonyBundle\DependencyInjection;

use Consistence\Doctrine\Enum\Type\BooleanEnumType;
use Consistence\Doctrine\Enum\Type\FloatEnumType;
use Consistence\Doctrine\Enum\Type\IntegerEnumType;
use Consistence\Doctrine\Enum\Type\StringEnumType;
Expand All @@ -29,6 +30,7 @@ public function prepend(ContainerBuilder $container)
$container->loadFromExtension(self::DOCTRINE_BUNDLE_ALIAS, [
'dbal' => [
'types' => [
BooleanEnumType::NAME => BooleanEnumType::class,
FloatEnumType::NAME => FloatEnumType::class,
IntegerEnumType::NAME => IntegerEnumType::class,
StringEnumType::NAME => StringEnumType::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Consistence\Doctrine\SymfonyBundle\DependencyInjection;

use Consistence\Doctrine\Enum\EnumPostLoadEntityListener;
use Consistence\Doctrine\Enum\Type\BooleanEnumType;
use Consistence\Doctrine\Enum\Type\FloatEnumType;
use Consistence\Doctrine\Enum\Type\IntegerEnumType;
use Consistence\Doctrine\Enum\Type\StringEnumType;
Expand All @@ -16,6 +17,7 @@ class ConsistenceDoctrineExtensionTest extends \PHPUnit\Framework\TestCase

/** @var string[] */
private static $enumTypes = [
BooleanEnumType::NAME => BooleanEnumType::class,
FloatEnumType::NAME => FloatEnumType::class,
IntegerEnumType::NAME => IntegerEnumType::class,
StringEnumType::NAME => StringEnumType::class,
Expand Down

0 comments on commit c9dfa81

Please sign in to comment.