Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ You can then use the `phone_number` mapping:

```php
/**
* @ORM\Column(type="phone_number")
* @ORM\Column(type="phone_number", nullable=true)
*/
private $phoneNumber;
```

This creates a `varchar(35)` column with a Doctrine mapping comment.

Note that if you're putting the `phone_number` type on an already-existing schema the current values must be converted to the `libphonenumber\PhoneNumberFormat::E164` format.
Note that if you're putting the `phone_number` type on an already-existing schema the current values must be converted to the `libphonenumber\PhoneNumberFormat::E164` format.
Also make sure that your field is `nullable` or convert `""` empty strings manually otherwise you will get a ConversionException `Could not convert database value "" to Doctrine Type phone_number`

### Templating

Expand Down