1
0
mirror of synced 2025-02-02 21:41:45 +03:00

439 Commits

Author SHA1 Message Date
Marco Pivetta
53c5824a6b #6017 removed clear($entityName) parameter validity checks
The `UnitOfWork` is advanced stuff: don't touch if you don't know what you are doing.
2016-11-27 18:37:45 +01:00
Marco Pivetta
dffd765b1e #6017 requesting clear('nonExistingEntityName') now raises a MappingException 2016-11-27 18:36:48 +01:00
Marco Pivetta
754e1f5d42 #6017 throwing an ORMInvalidArgumentException when clearing with non-string data. Also removing duplicate null checking 2016-11-27 18:36:48 +01:00
Jeremy Benoist
be4aafd4f6 Use ORMException instead of a default exception 2016-11-27 18:36:48 +01:00
Jeremy Benoist
2a7d21ad18 Throw an exception instead of a workaround 2016-11-27 18:36:48 +01:00
Jeremy Benoist
4a87f00fab Avoid error when entityName isn't a string 2016-11-27 18:36:48 +01:00
Marco Pivetta
e736d19677 #5935 #5684 #6020 #6152 extracted identifier conversion to a private method 2016-11-27 17:42:12 +01:00
Renan Gonçalves
52badf1cdd
Convert generated id value to its PHP representation.
According to the conversion rules of a specific DBAL mapping type.
2016-11-27 01:43:50 +01:00
ReenExe
2ee56a595b remove excess check 2016-09-15 19:41:34 +03:00
Mathieu De Zutter
b8c7d871be Remove old code in comments. 2016-09-09 23:22:31 +02:00
Mathieu De Zutter
01d51bfca3 Avoid conflicts due to spl_object_hash().
When merging an entity with a to-many association, it will store the
original entity data using the object hash of the to-be-merged entity
instead of the managed entity. Since this to-be-merged entity is not
managed by Doctrine, it can disappear from the memory. A new object
can reuse the same memory location and thus have the same object hash.
When one tries to persist this object as new, Doctrine will refuse it
because it thinks that the entity is managed+dirty.

This patch is a very naive fix: it just disables storing the original
entity data in case of to-many associations. It may not be the ideal
or even a good solution at all, but it solves the problem of object
hash reuse.

The test case relies on the immediate reusing of memory locations by
PHP. The variable $user has twice the same object hash, though referring
a different object. Tested on PHP 5.6.17

Without the fix, the test fails on the last line with:
A managed+dirty entity Doctrine\Tests\Models\CMS\CmsUser@[...] can not
be scheduled for insertion.
2016-09-09 23:22:31 +02:00
Marco Pivetta
dbcdc1d42a Empty identifiers must be disallowed 2016-07-07 20:57:49 +02:00
Marco Pivetta
1cb8d790b6 Disallowing null as part of the entity identifier 2016-07-07 20:29:00 +02:00
ReenExe
bcc7983934 after review 2016-07-05 19:15:47 +03:00
ReenExe
c0fc4f1158 use internal function 2016-07-02 23:02:13 +03:00
ReenExe
52b2d9022a use ternary 2016-07-02 23:00:40 +03:00
ReenExe
a7c4ca82fd use ternary 2016-07-02 22:59:16 +03:00
ReenExe
6bf6bae219 clear code 2016-07-02 22:51:44 +03:00
ReenExe
c6675b0ce3 use ternary 2016-07-02 22:42:46 +03:00
ReenExe
db6c593463 clear code 2016-07-02 22:37:12 +03:00
ReenExe
347d1625bc merge conditions 2016-07-02 22:33:23 +03:00
ReenExe
16cddd4693 claar code from Scrutinizer 2016-07-02 22:13:06 +03:00
Marco Pivetta
68c5d761a8 #5849 #5850 minor performance optimization - avoiding get_class() calls on all entity insertions 2016-06-06 00:25:48 +02:00
Marco Pivetta
b9b952ce8a #5849 #5850 renamed clearEntityInsertions to clearEntityInsertionsForEntityName, for clarity 2016-06-06 00:13:39 +02:00
Marco Pivetta
20d86c5b27 #5849 #5850 refactored clearIdentityMapForEntityName to remove useless looping 2016-06-06 00:11:19 +02:00
Marco Pivetta
14e0800293 #5849 #5850 renamed clearIdentityMap to clearIdentityMapForEntityName, for clarity 2016-06-06 00:10:18 +02:00
Rico Humme
beb2641492 Correct naming convention of function. Was confusing otherwise 2016-06-05 23:16:09 +02:00
Rico Humme
4d48781e2b Split of functionality in separate functions 2016-06-05 23:16:09 +02:00
Rico Humme
70603ee3db Clear entityInsertions for specific entityName 2016-06-05 23:16:09 +02:00
Mikhail Shamin
bf322b903d Optimize imports. Remove full qualified class names 2016-05-11 01:55:12 +07:00
Guilherme Blanco
9b4c50e81e Final work around entity changeset fix 2016-02-16 05:03:11 +00:00
Guilherme Blanco
b784a04cf7 Fixed only variables should be passed by reference issue 2016-02-16 04:46:34 +00:00
Guilherme Blanco
86cde3a9df Fixed #5605 2016-02-16 03:21:53 +00:00
Steve Müller
1697293591 Merge pull request #1563 from rawkode/bugfix/incorrect-rollback-method-name
Fixing method name 'rollBack', which was documented as 'rollback'
2016-01-06 11:49:32 +01:00
Jeroen Thora
6dcb97a20e Fixed many small phpcs issues 2015-12-11 20:30:41 +01:00
Marco Pivetta
3971e8c55b Merge branch 'hotfix/#1573-merge-associated-versioned-entity'
Close #1573
2015-12-11 20:17:05 +01:00
Marco Pivetta
16baa8d60f #1573 - correcting docblock arguments/description 2015-12-11 20:00:08 +01:00
bilouwan
fb4d02c69b Refactor testing Proxy not initilized 2015-12-04 14:49:01 +01:00
Maximilian Bosch
f840f0d464 DDC-4022 execute callback parameter directly instead of using call_user_func 2015-12-01 22:31:27 +01:00
Maximilian Bosch
11f9b00d53 DDC-4022 method naming 2015-12-01 22:31:26 +01:00
Maximilian Bosch
33476d8c34 DDC-4022 minor improvements 2015-12-01 22:31:25 +01:00
Maximilian Bosch
c337f8f5c7 DDC-4022 deduplication of internal UnitOfWork methods
the methods UnitOfWork#afterTransactionRolledBack() and UnitOfWork#afterTransactionComplete do almost the same, so it can be abstracted into another private method.
2015-12-01 22:31:25 +01:00
David McKay
3c7d92e4cc Fixed incorrect case of another two references of rollback 2015-11-30 16:53:31 +00:00
Guilherme Blanco
8ea62b95b8 Tests around reported cases over DDC-2524 2015-11-27 18:44:23 +00:00
bilouwan
832adae6b4 Unit test & fix for merge versionned entity 2015-11-27 17:28:45 +01:00
Guilherme Blanco
58992ad523 Fixed support for inverse side second level cache 2015-11-12 05:00:08 +00:00
Guilherme Blanco
1587aac4ff Added support for OneToMany with orphanRemoval. Replacing entire collection now deletes the replaced collection (scheduled for deletion). No event handling is done as it happens at DBAL level. 2015-11-05 00:08:44 -05:00
Lenard Palko
977f0a5b5c Fix skipping properties if they are listed after a not loaded relation. 2015-07-15 21:26:45 +01:00
Christian Schmidt
96dbecec24 [DDC-3382] Allow orphan removal to be cancelled 2015-06-12 16:44:13 +02:00
Josef Kříž
e57be9da5e Fix: generated IDs are converted to integer 2015-03-23 17:51:04 +01:00