how Ignoring field when inserting data with Doctrine ORM #5314

Closed
opened 2026-01-22 15:04:09 +01:00 by admin · 3 comments
Owner

Originally created by @akmumu on GitHub (Nov 4, 2016).

Originally assigned to: @Ocramius on GitHub.

i got SQLSTATE[23000]: Integrity constraint violation: 1048 Unknown error 1048 error,
this because my table has too many fileds, some of that i hope doctrine will ignore that when insert,but i got many null.

Originally created by @akmumu on GitHub (Nov 4, 2016). Originally assigned to: @Ocramius on GitHub. i got `SQLSTATE[23000]: Integrity constraint violation: 1048 Unknown error 1048` error, this because my table has too many fileds, some of that i hope doctrine will ignore that when insert,but i got many null.
admin closed this issue 2026-01-22 15:04:11 +01:00
Author
Owner

@Ocramius commented on GitHub (Nov 4, 2016):

Don't map it in your entity, and it will not be persisted.

On 4 Nov 2016 08:01, "Qinglong Zhang" notifications@github.com wrote:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6114, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakHgAFGp4G2C1-VXE7V5fM1O3Cx8Tks5q6tgrgaJpZM4KpPpg
.

@Ocramius commented on GitHub (Nov 4, 2016): Don't map it in your entity, and it will not be persisted. On 4 Nov 2016 08:01, "Qinglong Zhang" notifications@github.com wrote: > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > https://github.com/doctrine/doctrine2/issues/6114, or mute the thread > https://github.com/notifications/unsubscribe-auth/AAJakHgAFGp4G2C1-VXE7V5fM1O3Cx8Tks5q6tgrgaJpZM4KpPpg > .
Author
Owner

@akmumu commented on GitHub (Nov 4, 2016):

@Ocramius if i do not map these, i can not use getXXX,and setXXX

@akmumu commented on GitHub (Nov 4, 2016): @Ocramius if i do not map these, i can not use getXXX,and setXXX
Author
Owner

@Ocramius commented on GitHub (Nov 4, 2016):

Yes, either that or set defaults on the entity fields. DB-side generated
fields are not supported.

On 4 Nov 2016 08:18, "Qinglong Zhang" notifications@github.com wrote:

@Ocramius https://github.com/Ocramius if i do not map these, i can not
use getXXX,and setXXX


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6114#issuecomment-258360098,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakI_f0Y5V3Gb8kOHZZd5tJy0_B5Q0ks5q6twpgaJpZM4KpPpg
.

@Ocramius commented on GitHub (Nov 4, 2016): Yes, either that or set defaults on the entity fields. DB-side generated fields are not supported. On 4 Nov 2016 08:18, "Qinglong Zhang" notifications@github.com wrote: > @Ocramius https://github.com/Ocramius if i do not map these, i can not > use getXXX,and setXXX > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > https://github.com/doctrine/doctrine2/issues/6114#issuecomment-258360098, > or mute the thread > https://github.com/notifications/unsubscribe-auth/AAJakI_f0Y5V3Gb8kOHZZd5tJy0_B5Q0ks5q6twpgaJpZM4KpPpg > .
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5314