Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 2.2.1
-
Fix Version/s: None
-
Component/s: ORM
-
Security Level: All
-
Labels:None
Description
It is too hard handle rows duplication now. As adviced here http://stackoverflow.com/questions/3967226/checking-for-duplicate-keys-with-doctrine-2 we should catch \PDOException with code 23000. This is bad behavior.
So I propose:
a. Add DuplicateRowException wich will throwed by flush method (maybe wrapped PDOException) with method "getDuplicatedProperties" (based on sql error description parsing + mapping)
b. Add method findOneOrCreate (hello, Propel!) or updateIfExists to ObjectInterface, EntityManager
c. Combine a, b
Activity
Benjamin Eberlei
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Workflow | jira [ 13542 ] | jira-feedback [ 14031 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback [ 14031 ] | jira-feedback2 [ 15895 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 15895 ] | jira-feedback3 [ 18150 ] |