-
-
Save doctrinebot/a7aa165388fe76b70e1f to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1850 - https://github.com/doctrine/doctrine2/issues/2511
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This patch file was generated by NetBeans IDE | |
# Following Index: paths are relative to: /home/pablo/www/site/backend/vendor/doctrine/lib/Doctrine/ORM/Persisters | |
# This patch can be applied using context Tools: Patch action on respective folder. | |
# It uses platform neutral UTF-8 encoding and \n newlines. | |
# Above lines and this line are ignored by the patching process. | |
Index: BasicEntityPersister.php | |
--- BasicEntityPersister.php Base (BASE) | |
+++ BasicEntityPersister.php Locally Modified (Based On LOCAL) | |
@@ -408,8 +408,20 @@ | |
} | |
} | |
+ foreach ($keys as $value) { | |
+ if ($this->_class->fieldMappings[$this->_class->fieldNames[$value]]['quoted']) { | |
+ $id[] = $this->_platform->quoteIdentifier($value); | |
+ } else { | |
+ $id[] = $value; | |
+ } | |
+ } | |
+ | |
if ( ! isset($mapping['isOnDeleteCascade'])) { | |
- $this->_conn->delete($mapping['joinTable']['name'], array_combine($keys, $identifier)); | |
+ if ($mapping['joinTable']['quoted']) { | |
+ $this->_conn->delete($this->_class->getQuotedJoinTableName($mapping, $this->_platform), array_combine($id, $identifier)); | |
+ } else { | |
+ $this->_conn->delete($mapping['joinTable']['name'], array_combine($id, $identifier)); | |
+ } | |
if ($selfReferential) { | |
$this->_conn->delete($mapping['joinTable']['name'], array_combine($otherKeys, $identifier)); | |
@@ -431,10 +443,18 @@ | |
*/ | |
public function delete($entity) | |
{ | |
+ | |
$identifier = $this->_em->getUnitOfWork()->getEntityIdentifier($entity); | |
$this->deleteJoinTableRecords($identifier); | |
- $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier); | |
+// $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier); // To Remove | |
+ foreach ($identifier as $columnName => $value) { | |
+ if ($this->_class->fieldMappings[$columnName]['quoted']) { | |
+ $id[$this->_platform->quoteIdentifier($this->_class->fieldMappings[$columnName]['columnName'])] = $value; | |
+ } else { | |
+ $id[$columnName] = $value; | |
+ } | |
+ } | |
$this->_conn->delete($this->_class->getQuotedTableName($this->_platform), $id); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment