DDC-3529: [GH-1275] [WIP] Nullable embedded objects. #4341

Closed
opened 2026-01-22 14:39:40 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 21, 2015).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of lcobucci:

Url: https://github.com/doctrine/doctrine2/pull/1275

Message:

The idea was to have a simple (and clean) way to override the nullable property of embedded objects, so I've
added the nullable attribute on the @Embedded annotation and it have 3 possible values:

  • NULL: The nullable option that was defined on the attributes of the embeddable class won't be overriden;
  • TRUE: All attributes of the embeddable class will be marked as nullable and the embeddable instance only would be created when data is not NULL;
  • FALSE: All attributes of the embeddable class will be marked as non-nullable.

There's a lot of things to be improved (mostly on UnitOfWork), but it's fully working with basic tests as you can see on ValueObjectsTest::testCRUDOfNullableEmbedded() case.

I would appreciate a lot your opinions!

Originally created by @doctrinebot on GitHub (Jan 21, 2015). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of lcobucci: Url: https://github.com/doctrine/doctrine2/pull/1275 Message: The idea was to have a simple (and clean) way to override the nullable property of embedded objects, so I've added the `nullable` attribute on the `@Embedded` annotation and it have 3 possible values: - NULL: The nullable option that was defined on the attributes of the embeddable class won't be overriden; - TRUE: All attributes of the embeddable class will be marked as nullable and the embeddable instance only would be created when data is not NULL; - FALSE: All attributes of the embeddable class will be marked as non-nullable. There's a lot of things to be improved (mostly on UnitOfWork), but it's fully working with basic tests as you can see on ValueObjectsTest::testCRUDOfNullableEmbedded() case. I would appreciate a lot your opinions!
admin added the Improvement label 2026-01-22 14:39:40 +01:00
admin closed this issue 2026-01-22 14:39:40 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 24, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1275] was labeled:
https://github.com/doctrine/doctrine2/pull/1275

@doctrinebot commented on GitHub (Jan 24, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1275] was labeled: https://github.com/doctrine/doctrine2/pull/1275
Author
Owner

@doctrinebot commented on GitHub (Jan 24, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1275] was labeled:
https://github.com/doctrine/doctrine2/pull/1275

@doctrinebot commented on GitHub (Jan 24, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1275] was labeled: https://github.com/doctrine/doctrine2/pull/1275
Author
Owner

@doctrinebot commented on GitHub (Mar 11, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1275] was closed:
https://github.com/doctrine/doctrine2/pull/1275

@doctrinebot commented on GitHub (Mar 11, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1275] was closed: https://github.com/doctrine/doctrine2/pull/1275
Author
Owner

@doctrinebot commented on GitHub (Mar 13, 2015):

Issue was closed with resolution "Incomplete"

@doctrinebot commented on GitHub (Mar 13, 2015): Issue was closed with resolution "Incomplete"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4341