[DBAL-385] Null need set to NULL in array type Created: 17/Nov/12 Updated: 25/Nov/12 Resolved: 25/Nov/12 |
|
| Status: | Resolved |
| Project: | Doctrine DBAL |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Ivan Borzenkov | Assignee: | Benjamin Eberlei |
| Resolution: | Can't Fix | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When use Array type and NULL value set null give in database 'N;' (serialise(null)) |
| Comments |
| Comment by Benjamin Eberlei [ 25/Nov/12 ] |
|
This would be a BC Break and cannot be done anymore. You can add your own array type that has this behavior. |
| Comment by Ivan Borzenkov [ 25/Nov/12 ] |
|
It will not be a loss of backward compatibility. |
| Comment by Benjamin Eberlei [ 25/Nov/12 ] |
|
The field might be NOT NULL, that is what might break BC. |
| Comment by Ivan Borzenkov [ 25/Nov/12 ] |
|
and if field is null? /** * @var array $yandexReg * * @ORM\Column(name="yandexReg", type="array", nullable=true) */ private $yandexReg; |
| Comment by Benjamin Eberlei [ 25/Nov/12 ] |
|
Well in this case it works obviously, however the Type API doesn't have access to that information. Thats why I meant you should build your own array type and override the internal implementation. This is explained in the Mapping Fields Document of ORM and in the Type Documentation of DBAL. |