Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fre5h committed Jan 11, 2014
1 parent 278e41d commit a511b67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ use Application\Bundle\DefaultBundle\DBAL\Types\BasketballPositionType;
```

`NULL` values are also supported by ENUM field.
You can set *nullable* parameter of column to `true` or `false` depends on if you want or not to allow `NULL` values.
You can set *nullable* parameter of column to `true` or `false` depends on if you want or not to allow `NULL` values:

```php
/** @ORM\Column(name="position", type="BasketballPositionType", nullable=true) */
Expand Down Expand Up @@ -231,6 +231,9 @@ $builder->add('position', 'choice', [
]);
```

[EnumTypeGuesser](./Form/EnumTypeGuesser.php "EnumTypeGuesser") process only DBAL types that are children of [AbstractEnumType](./DBAL/Types/AbstractEnumType.php "AbstractEnumType").
All other custom DBAL types, which are defined, will be skipped from guessing.

##### Readable ENUM values in templates
You would want to show ENUM values rendered in your templates in *readable format* instead of the values that would be stored in DB. It is easy to do by using the Twig filter `|readable` that was implemented for that purpose. In the example below if the player is a point guard of his team then his position will be rendered in template as `Point guard` instead of `PG`.

Expand Down

0 comments on commit a511b67

Please sign in to comment.