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

464 Commits

Author SHA1 Message Date
Guilherme Lopes
a7e13f89cc #6723 Remove variable from UnitOfWork#createEntity() 2017-09-26 12:52:18 +02:00
Dariusz Ruminski
c7d6d62393 Use newer PHP syntax 2017-09-06 01:32:49 +02:00
Marco Pivetta
12043cd845
#5796 minor CS fixes (imported symbols) and removing last PHP5 compliance bits 2017-09-02 13:47:58 +02:00
Marco Pivetta
a1c93bfd48
#5796 replacing Exception catching with Throwable catching, removing PHP5 compliance code 2017-09-02 13:44:12 +02:00
Benjamin Morel
874a5e3547
Catch Throwable in PHP 7 2017-09-02 13:41:53 +02:00
Marco Pivetta
2be32f249c
#1521 DDC-2922 adapting UoW and exception implementation to the new specification 2017-08-22 09:57:57 +02:00
Marco Pivetta
2751c0fff2
#1521 DDC-2922 minor code cleanup - renaming internal private methods, variables, removing redundant if/else 2017-08-21 20:08:20 +02:00
Darien Hager
b456cffa2d
Move final cascade-persist-checking so that it covers not just normal flushes, but also flushes where specific entities are singled out. 2017-08-21 09:08:31 +02:00
Darien Hager
17b996da8c
Speculative fix: Defer any errors for missing cascade-persist until object graph has been better-explored 2017-08-21 09:08:31 +02:00
Marco Pivetta
496c22db0e
#5579 completely removing a changeset when cleaning up 2017-08-18 09:27:47 +02:00
Marco Pivetta
ff15a2bc79
#5579 correcting visibility of clearEntityChangeSet, which should be reverted to public 2017-08-18 09:23:28 +02:00
Marco Pivetta
9d7be0f927
#5579 s/clear/cleanup 2017-08-18 09:22:23 +02:00
Marco Pivetta
2921f068b7
#5579 cleaning up postCommitClear implementation 2017-08-18 09:21:53 +02:00
xhuberty
866a424963
Fix issue when using notify tracking policy with multiple flush on entity 2017-08-18 09:07:40 +02:00
Marco Pivetta
a0c0d3bf2a
Revert "Merge branch 'fix/#6499-#6533-fix-commit-order-calculation-consider-all-join-column-fields'"
This reverts commit 2a58645cb5870f0ab61e918c7165c248d225dbac, reversing
changes made to 6d428c90e24c914c1e5d817d74646f3b94757c43.
2017-08-11 22:29:45 +02:00
Marco Pivetta
1ede3c514f
#6499 #6533 simplifying nullable column check - null coalesce operator makes it *SOMEWHAT* more readable (no miracles) 2017-08-11 22:13:20 +02:00
Gabe van der Weijde
db2530d6fd
-- Proposed fix due to logic error. 2017-08-11 21:51:17 +02:00
Marco Pivetta
a22f165026 #6174 #5570 removed unused/dead code 2016-12-18 14:45:08 +01:00
Marco Pivetta
ab0e854830 #6174 #5570 CS - spacing 2016-12-18 14:39:46 +01:00
Marco Pivetta
85e2dc8f22 #6174 #5570 CS - spacing 2016-12-18 14:38:10 +01:00
Marco Pivetta
3ce262a61a #6174 #5570 flattened nested conditionals 2016-12-18 14:36:39 +01:00
Marco Pivetta
81d44d4d6e #6174 #5570 documenting thrown exception types 2016-12-18 14:32:31 +01:00
Marco Pivetta
754f36ef65 #6174 #5570 CS - alignment 2016-12-18 14:27:35 +01:00
bilouwan
493d39f5df doMerge will mergeEntityStateIntoManagedCopy BEFORE persistNew to let lifecyle events changes be persisted 2016-12-15 12:49:11 +01:00
Luís Cobucci
234989d069
Use short-array syntax on "lib" directory 2016-12-08 00:31:12 +01:00
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