1
0
mirror of synced 2025-02-03 05:49:25 +03:00

5769 Commits

Author SHA1 Message Date
Steevan BARBOYON
fa09a95023 Clear $this->collection even when empty, to reset indexes 2016-11-26 05:57:56 +01:00
Marco Pivetta
3cd7b8c951 #5987 CS: spacing after ! (not) operator 2016-11-26 05:23:04 +01:00
Marco Pivetta
24da9061b9 #5987 inlined check for boolean 'true' literal 2016-11-26 05:22:43 +01:00
Javier Spagnoletti
e2b198112e [minor] Add missing type hints, add strictness for some checks, remove some useless calls 2016-11-26 05:18:46 +01:00
Marco Pivetta
e7f2e35383 Merge pull request #5977 from gadelat/cleanup-1
Remove unneeded ternary operator from Query::contains
2016-11-26 05:05:37 +01:00
Marco Pivetta
979fede80c Merge pull request #6038 from ReenExeContributor/cleanup-UnitOfWork
remove excess `check`
2016-11-26 04:59:16 +01:00
Marco Pivetta
8c38f5775d Merge pull request #6121 from kalessil/sca
Static Code Analysis with Php Inspections (EA Extended)
2016-11-26 04:57:48 +01:00
Luís Cobucci
1b39cd87ad
Allow using objects as discriminators 2016-11-23 18:56:36 +01:00
Luís Cobucci
317e86802d
Make child entity share the timestamp region with parent class 2016-11-20 19:27:53 +00:00
Marco Pivetta
e7856f90d8 Merge branch 'feature/#6136-better-exception-message-on-invalid-connection-object'
Close #6136
2016-11-18 09:21:18 +01:00
SpacePossum
e37041aa94 Update message. 2016-11-18 08:06:11 +01:00
Alexander Guz
8d433cdb39 #6129 Fixed code style and @depends in test. 2016-11-17 21:05:58 +01:00
SpacePossum
f9a605f6ca Add details about invalid Connection passed at creation. 2016-11-17 17:23:22 +01:00
Alexander Guz
7bf206adb4 #6129 Moved test to AbstractMappingDriverTest. 2016-11-16 20:01:11 +01:00
Vladimir Reznichenko
db375a22cc Static Code Analysis with Php Inspections (EA Extended): revert unsets 2016-11-06 17:58:45 +01:00
Vladimir Reznichenko
0bf3d7f84c Static Code Analysis with Php Inspections (EA Extended) 2016-11-06 14:22:47 +01:00
Jefersson Nathan
b8a18cd0a1
fix license header inconsistencies 2016-10-25 23:58:42 -03:00
ReenExe
2ee56a595b remove excess check 2016-09-15 19:41:34 +03:00
Ed Hartwell Goose
67e205b36a Fixes #5755, uses '->getReflectionProperties()' instead of '->getReflectionClass()->getProperties()' to ensure all fields are copied, and adds test to confirm behaviour 2016-09-10 20:37:20 +02:00
Marco Pivetta
22105058fa Merge branch 'fix/#5689-avoid-object-hash-conflicts-due-to-merge-operations'
Close #5689
2016-09-10 20:22:52 +02: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
Luís Cobucci
e43b9e9e3a
Use isIdGeneratorIdentity() to add the ID on query
It's quite handy when creating CUSTOM id generators that should also
rely on AUTO_INCREMENT stuff (one can just extend the `ClassMedatadaFactory`
and create a different instance of `ClassMetadata` that overrides that
method).
2016-09-09 07:52:44 +00:00
Javier Spagnoletti
5353137617 Update exception message at EntityRepository::__call() 2016-09-08 13:32:06 -03:00
Luís Cobucci
dd476094af The timestamp verification is now done by the validator
So it's useless to keep it here too.
2016-09-08 13:50:06 +02:00
Luís Cobucci
b431332cef Evict query cache when entities are updated 2016-09-08 13:50:06 +02:00
Luís Cobucci
b49026b657 Add timestamp key to QueryCacheKey 2016-09-08 13:50:06 +02:00
Luís Cobucci
16a3a2a132 Use microtime to have more precision on cache time 2016-09-08 13:50:06 +02:00
Carl Vuorinen
00bbf4f523 Use yoda condition in the null check 2016-09-08 13:37:00 +02:00
Carl Vuorinen
95546d68c5 Fix hydration in a joined inheritance with simple array or json array
SimpleArrayType and JsonArrayType convert NULL value to an empty array, which fails the null check that is used to prevent overwrite
Fixes issue #5989
2016-09-08 13:37:00 +02:00
Marco Pivetta
c5c56a9dad #6003 clarifying thrown exception 2016-09-08 00:55:49 +02:00
Marco Pivetta
36e9904082 #6003 inlined persister retrieval 2016-09-08 00:55:09 +02:00
Marco Pivetta
e2cba87662 #6003 corrected return type definition 2016-09-08 00:54:49 +02:00
Marco Pivetta
7bf4a65c92 #6003 imported used symbol 2016-09-08 00:53:35 +02:00
Marco Pivetta
de4c854ac9 #6003 removed useless count() call 2016-09-08 00:48:52 +02:00
Marco Pivetta
5e51a985b7 #6003 no default parameter needed 2016-09-08 00:47:39 +02:00
Marco Pivetta
6f79a378d5 #6003 removed useless method parameter count checking duplication 2016-09-08 00:43:29 +02:00
Javier Spagnoletti
61f6b667c0 Remove default clause at EntityRepository::resolveMagicCall() 2016-09-08 00:32:15 +02:00
Javier Spagnoletti
591bae0855 Swap logic from EntityRespository::__call() 2016-09-08 00:32:15 +02:00
Javier Spagnoletti
a90035e81a Expose EntityPersister::count() through EntityRepository::count() 2016-09-08 00:32:15 +02:00
Marco Pivetta
35341769ea Merge pull request #5972 from giginos/patch-1
Wrong return type of getResult()
2016-09-07 23:31:19 +02:00
Marco Pivetta
140960ebb1 #5975 short array syntax 2016-09-07 23:17:40 +02:00
John Keller
3bec698fed add functional test and bug fix for issue #5762 2016-09-07 23:15:00 +02:00
Gabriel Potkány
75f44008d6 Remove unneeded ternary operator from Query::contains 2016-08-16 01:31:46 +02:00
giginos
eb62ae5933 Wrong return type of getResult()
@see https://github.com/doctrine/doctrine2/issues/5971
2016-08-12 16:26:08 +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
Tony Nelson
cd36407f28 Update EntityManager.php 2016-07-05 12:48:00 -05:00
Marco Pivetta
27e9b49215 Merge pull request #5911 from ReenExeContributor/scrutinizer-clear-code
Scrutinizer clear code
2016-07-05 18:21:08 +02:00
ReenExe
bcc7983934 after review 2016-07-05 19:15:47 +03:00