1
0
mirror of synced 2025-01-08 10:07:10 +03:00
Commit Graph

5313 Commits

Author SHA1 Message Date
Marco Pivetta
6448627bc9 Merge pull request #1233 from SofHad/refactoring-duplicate-code
[Minor] Refactoring to avoid duplicate code
2015-01-04 22:59:05 +01:00
SofHad
eb22db0dcf remove the unnecessary check 2015-01-04 21:01:32 +01:00
Martin Prebio
8f15c5e905 Consistent return type confirming with interface 2014-12-31 01:28:05 +01:00
Sofiane HADDAG
8d91f7de60 Rename handleCache to updateCache 2014-12-30 14:49:12 +01:00
shaddag
ccb09ad0ac Rename the private method 2014-12-30 14:10:56 +01:00
shaddag
12b5a0cdd7 Extracted ony the common logic 2014-12-30 14:06:48 +01:00
shaddag
50ef1369c3 [Minor] Refactoring to avoid duplicate code 2014-12-30 10:03:49 +01:00
Johannes Schlüter
cdb62a70cd Allow dumping SQL query when passing DQL on cli 2014-12-24 14:15:23 +01:00
Christian Schmidt
61c72e4aa7 Ensure query cache is not ArrayCache in production 2014-12-19 20:18:45 +01:00
James Murray
d9cbe1a8b7 removed unnecessary fieldIdentificationVariable property check 2014-12-19 14:10:47 -05:00
James Murray
2f76571d3a Added a fix for ObjectHydrator when the same number of scalar results and new object results exist
Adding additional tests for mixed New object and scalar query
2014-12-19 14:06:03 -05:00
Gareth Evans
2fac6272a1 Checks key exists rather than isset
If the default value is set to `null`, `isset` will return `false` even though the key is actually there for a reason.
2014-12-08 01:31:14 +01:00
Marco Pivetta
cf1b16a505 #1213 - DDC-3437 - renaming variables/alignment/clarifications in docblocks 2014-12-08 01:22:20 +01:00
Austin Morris
d48546d2dd fix instantiation of embedded object in ReflectionEmbeddedProperty 2014-12-08 01:06:11 +01:00
Fedik
c1eff7045a XML export driver: fix export options 2014-12-07 13:05:19 +02:00
Guilherme Blanco
0059e01936 Merge pull request #1208 from Ocramius/hotfix/DDC-3427-class-metadata-factory-should-accept-entitymanagerinterface-instances
DDC-3427 - class metadata factory should accept `EntityManagerInterface` instances
2014-12-05 12:22:23 -05:00
Marco Pivetta
ac67a10d4c DDC-3434 - adding note on why restoring 'HIDDEN' selected fields is relevant 2014-12-05 18:02:12 +01:00
Marco Pivetta
6169175a89 DDC-3434 - HIDDEN modifier marked fields in ORDER BY clause are always preserved when creating a paginator subquery 2014-12-05 17:11:57 +01:00
Guilherme Blanco
a6cf714f41 Merge pull request #1210 from Ocramius/hotfix/DDC-3336-undefined-property-with-paginator-and-scalar-expression-select
DDC-3336 - undefined property with paginator walker and scalar expression in ORDER BY clause
2014-12-05 10:42:55 -05:00
Marco Pivetta
e53e8bfe8e DDC-3336 - applied hotfix: only PathExpression instances have a $field property 2014-12-05 14:56:47 +01:00
Marco Pivetta
e65417f1f6 DDC-3427 - Adding setting an EntityManagerInterface instance in the ClassMetadataFactory#setEntityManager() 2014-12-05 13:49:42 +01:00
Marco Pivetta
b4a23e97a9 ReflectionEmbeddedProperty should be like any ReflectionProperty, and should therefore extend it for type compatibility 2014-12-05 13:06:41 +01:00
Marco Pivetta
112fdf46d0 Using instantiator to work with internal PHP classes as embeddables 2014-12-05 13:00:54 +01:00
Marco Pivetta
fc3f233923 Yodaism good for you: is. 2014-12-05 11:18:10 +01:00
Marco Pivetta
1d5a0a0a1b Adding docblocks 2014-12-05 11:17:43 +01:00
Marco Pivetta
ce308dc476 #1204 - refactored sequence-generator metadata exporting into own private method for simplicity 2014-12-04 14:00:05 +01:00
Paulo de Freitas
aa1454562c Fix sequence-generator in MetaData exporter for XML Driver. 2014-12-04 14:00:05 +01:00
Marco Pivetta
9d2c0481ae #1200 - removing console deprecation errors by using the new Symfony\Component\Console\Helper\Table instead of the deprecated TableHelper 2014-12-04 13:40:22 +01:00
Marco Pivetta
d3b1bf571b #1200 - removing Yaml::parse() deprecation errors by passing in file contents instead of file paths 2014-12-04 13:37:59 +01:00
Marco Pivetta
b761d84d4f #1196 DDC-3418 DDC-3419 - refactoring class metadata factory to avoid duplicate checks 2014-11-27 18:54:10 +01:00
Marco Pivetta
7648a3c590 #1196 DDC-3418 DDC-3419 - refactoring inherited indexes copying logic into separate private method 2014-11-27 18:52:03 +01:00
Dustin Thomson
17ec1aab77 Modified class metadata factory to have entity tables inherit indexes from mapped superclasses 2014-11-27 18:41:33 +01:00
Marco Pivetta
f536daa1e4 #1188 - Simplified and optimized parameter un-setting logic 2014-11-27 18:08:11 +01:00
Marco Pivetta
ac0f1b2ce2 #1188 - Importing parser class 2014-11-27 17:59:12 +01:00
Marco Pivetta
69064ac13d #1188 - making Doctrine\ORM\Tools\Pagination\Paginator#getCountQuery() private, as it is an implementation detail 2014-11-27 17:48:37 +01:00
Marco Pivetta
a80117a4ee #1188 - removing unused variable assignments 2014-11-27 17:42:14 +01:00
Paweł Kolanowski
af39fce6e5 Missing doc block, removed parse() parameter.
Missing doc block, removed parse() parameter.
2014-11-27 17:27:22 +01:00
Merixstudio
d02ea224df Allowed to get count query from paginator. 2014-11-27 17:27:22 +01:00
Merixstudio
42aff75108 Fixed counting exception
Fixed "Invalid parameter number: number of bound variables does not match number of tokens " exception during execution count on Query where select part of query contains :parameters.
2014-11-27 17:27:22 +01:00
Christian Schmidt
89684b4ce9 Document that AUTOGENERATE_ constants are allowed 2014-11-21 21:11:32 +01:00
Asmir Mustafic
a1660997ff Postgres SERIAL is not a post-insert identifier generation strategy 2014-11-12 10:10:06 +01:00
Marco Pivetta
ab62914f87 Merge pull request #1089 from encoder32/EntityRepositoryGeneratorDefaultRepository
EntityRepositoryGenerator default repository
2014-11-11 16:22:51 +01:00
Marco Pivetta
511893e182 #1173 - applying CS fixes on top of the patch 2014-11-11 12:27:57 +01:00
Mathieu De Zutter
2ead9e23ab Fix merging of entities with associations to identical entities.
Without this patch, when an entity that refers multiple times to the same
associated entity gets merged, the second references becomes null.

The main issue is that even though doMerge returns a managed copy, that value
is not used while cascading the merge. These identicial entities are already
detected through the visitor map, but they are ignored.  There should be some
refactoring so cascadeMerge calls a function that checks if the parent must be
updated, based on the return value of its call to doMerge.  However, this patch
tries to impact the code as little as possible, and only introduces a new
function to avoid duplicate code.

The secondary issue arises when using inverted associations. In that case, it
is possible that an entity to be merged is already merged, so the the visitor
map is looked up by the hash of a managed copy instead of the original entity.
This means that in this case the visitor map entries should also be set to the
entity, instead of being set to 'true'.
2014-11-11 12:12:25 +01:00
Christian Schmidt
3287ce12a4 Fix namespace collission 2014-11-11 08:31:36 +01:00
Christian Schmidt
c973d8df1a Code style fixes. 2014-11-11 07:35:52 +01:00
jaimz22
dd012dfd90 oops.. forgot to add a condition 2014-11-08 16:56:42 +00:00
jaimz22
e2f1ea7f23 stupid cloud 9 ide broke my code :( sorry 2014-11-08 16:45:58 +00:00
jaimz22
c47a072815 fixed for failing test case. when a single DTO is specified in the query, you no longer get a multidimensional array returned. 2014-11-08 16:36:55 +00:00
jaimz22
2ffda34f23 fixing a missing index error 2014-11-08 10:15:33 -05:00
Christian Schmidt
0990d64756 Ensure metadata cache is not ArrayCache in production 2014-11-08 15:05:56 +01:00
Marco Pivetta
76e1a469ef Merge pull request #1027 from PowerKiKi/feature-partial-indexes
Support for Partial Indexes for PostgreSql and Sqlite
2014-11-05 13:19:29 +01:00
James Murray
da7e4ed8de removing orphaned scalar results and allowing mixed results when use new object expressions 2014-10-28 17:59:37 -04:00
James Murray
85eac7200d Adding the ability to alias new object expressions 2014-10-28 17:34:57 -04:00
Guilherme Blanco
b7d104d2a2 Fixed typo 2014-10-21 22:43:26 -04:00
Guilherme Blanco
3a0d7d1d6b Merge pull request #1146 from c960657/order-by-assoc
Allow orderBy to reference associations
2014-10-21 21:40:04 -04:00
Kim Hemsø Rasmussen
6fc6d18882 Merge pull request #1165 from Ocramius/feature/#1120-metadata-info-command
[DDC-3205] #1120 - metadata info command
2014-10-20 20:46:33 +02:00
Marco Pivetta
95bc0fb456 #1120 - using the Symfony\Component\Console\Helper\TableHelper for symfony/symfony:~2.3 compatibility
(Instead of `Symfony\Component\Console\Helper\Table`)
2014-10-20 18:49:54 +02:00
Marco Pivetta
a0e107249f Removing public properties validation (supported) 2014-10-20 15:15:05 +02:00
Marco Pivetta
9ccb56a7ab #1120 - applying CS fixes as per @dantleech's review 2014-10-19 19:56:21 +02:00
Marco Pivetta
29e99b2b89 #1120 - removed duplication: field and association mappings actually use the same dump format 2014-10-19 18:57:58 +02:00
Marco Pivetta
d5d64b756d #1120 - removed redundant if block 2014-10-19 18:42:14 +02:00
Marco Pivetta
1208cc836a #1120 - registering the new MappingDescribeCommand with the ORM's ConsoleRunner 2014-10-19 18:41:14 +02:00
Marco Pivetta
806068b0df #1120 - removing useless variables, refactoring 2014-10-19 18:36:08 +02:00
Marco Pivetta
39a8a31de9 #1120 - removing unused private properties 2014-10-19 18:34:42 +02:00
Marco Pivetta
574f3ea909 #1120 - map functions over array iteration/mutation 2014-10-19 18:34:06 +02:00
Marco Pivetta
254a46e79c #1120 - avoiding mutable state for rows/output 2014-10-19 18:32:12 +02:00
Marco Pivetta
250b38710c #1120 - missing docblock parameter 2014-10-19 18:23:50 +02:00
Marco Pivetta
0f289a1270 #1120 - cs cleanups - moving success cases at the end of methods 2014-10-19 18:21:45 +02:00
Marco Pivetta
97fdd0adb7 #1120 - cleaning up try-catch code when fetching metadata 2014-10-19 18:14:33 +02:00
Marco Pivetta
100766e360 #1120 - Removing example array('Foo', 'Bar', 'Boo') dumped data 2014-10-19 18:13:46 +02:00
Marco Pivetta
dcdffbffc7 #1120 - assuming existence of Symfony\Component\Console\Helper\Table 2014-10-19 18:13:01 +02:00
Marco Pivetta
7cf427cfbf #1120 - avoiding version comparisons when working with version-dependant constants 2014-10-19 17:53:40 +02:00
Marco Pivetta
ed79648d7d #1120 - avoiding storing the Doctrine\ORM\EntityManager in the command itself 2014-10-19 17:51:17 +02:00
Marco Pivetta
cf078d8da8 #1120 - avoiding storing the Doctrine\ORM\EntityManager in the command itself 2014-10-19 17:49:28 +02:00
Marco Pivetta
e9d7c23261 #1120 - MappingDescribeCommand can be final 2014-10-19 17:43:32 +02:00
dantleech
37de75b2ae Split new functionality into new command 2014-10-19 17:40:50 +02:00
dantleech
c71b489e9e Added preg_quote and doc blocks 2014-10-19 17:40:50 +02:00
dantleech
b5552a82e3 Code review fixes 2014-10-19 17:40:50 +02:00
dantleech
51cd8f7ce8 Added test 2014-10-19 17:40:50 +02:00
dantleech
45ce6a41a3 Expanded scope of orm:info to include metadata information 2014-10-19 17:40:50 +02:00
Marco Pivetta
b989175754 #615 - Removing unused assignment 2014-10-19 17:24:07 +02:00
Marco Pivetta
a4e9c235f8 #615 - assignment alignment 2014-10-19 17:08:33 +02:00
Mike Meier
fb5f76f025 rewrite tablePrefixAlias 2014-10-19 17:05:34 +02:00
Mike Meier
ebc996c820 Update SqlWalker.php
Always be sure that only a-z characters are used for table alias, otherwise use generic "t" for "table"
2014-10-19 17:05:34 +02:00
Steve Müller
06b5c84728 Merge pull request #1160 from Ocramius/hotfix/#1159-multiple-entity-managers-per-repository-factory
#1159 - multiple entity managers per repository factory should be supported
2014-10-19 14:58:04 +02:00
Marco Pivetta
0f26c62e73 Merge pull request #1143 from MajorCaiger/master
Fixed a bug so that a versioned entity with a oneToOne id can be created
2014-10-19 11:52:37 +02:00
Alex Bakhturin
b33c9befb7 [QueryBuilder] Remove unused method parameters that are shadowed by local variables
PHP5 treats the left part of such assignment as an independent local variable, while HHVM treats it as a reference to the method parameter. This leads to the value of the parameter being changed, which, in turn, causes func_get_args() to return not what is expected.
This commit is a part of the effort to make Symfony run flawlessly on HHVM. This issue causes a bunch of Symfony tests to fail on HHVM.
2014-10-17 11:17:33 -07:00
Marco Pivetta
8093c6ddb0 #1159 - protecting Doctrine\ORM\Repository\DefaultRepositoryFactory API by making it final and its protected members private 2014-10-14 01:46:50 +02:00
Marco Pivetta
a9847533e5 #1159 - Doctrine\ORM\Repository\DefaultRepositoryFactory keeps separate caches per entity manager used to build repositories 2014-10-14 01:46:14 +02:00
Ala Eddine Khefifi
f2bdfe102e Fixed missed initialization in CommitOrderCalculator.php 2014-10-12 14:04:41 +01:00
Christian Schmidt
94f5f53d2a Allow orderBy to reference associations 2014-10-05 10:16:58 +02:00
Rob Caiger
dd398ce577 - Fixed the basic entity persister so that versioned OneToOne entities can be created
- Created an IdentifierFlattener utility class
- Moved the logic for the flatten identifier method into the new utility class
- Replaced calls for private flattenIdentifier to use new utility
- Added appropriate unit tests
2014-10-01 14:01:44 +01:00
Marco Pivetta
3f8865c6fb Merge pull request #1092 from birko/pagination-count-walker
[DDC-2794] Arbitrary Join count walkers solution
2014-09-23 00:30:30 +02:00
Steve Müller
b291d8d589 add support for embeddables in entity generator 2014-09-12 20:29:37 +02:00
Marco Pivetta
4974edc70a DDC-3272 - fixing issue with mapped superclass name, minor refactoring 2014-09-10 17:00:06 +02:00
encoder64
e295a6d05e visibility changed && few simple fixes 2014-09-09 22:17:10 +03:00
encoder64
859a5f88cb Unit Tests && simple fixes 2014-09-06 18:14:16 +03:00
encoder64
dc3bc45d1d Merge remote-tracking branch 'upstream/master' into EntityRepositoryGeneratorDefaultRepository 2014-09-06 15:33:48 +03:00
František Bereň
589d26fc5e Changed calling $from[0] to using reset($from)
changed usage $from[0] according suggestion from @Ocramius  to use array
reset function
2014-09-02 08:39:29 +02:00
Marco Pivetta
d9b43dc649 Merge pull request #1116 from deeky666/DDC-3265
[DDC-3265] Fix DocBlock
2014-08-30 04:22:47 +02:00
Marco Pivetta
6e79515a75 Merge pull request #1123 from stof/patch-1
Fixed the structure of the reverse-engineered mapping
2014-08-30 04:19:55 +02:00
Javier Spagnoletti
f731a66e1c Removed extra line breaks for docblocks in set, get, add and remove method templates. 2014-08-29 23:11:49 -03:00
Javier Spagnoletti
1378626937 Fixed new line in docblock (247803715b). 2014-08-29 22:49:23 -03:00
František Bereň
d48be34696 CS Fixes 2014-08-28 13:17:25 +02:00
Guilherme Blanco
4b504c9436 Merge pull request #1109 from doctrine/hotfix/DDC-3120-php-5.6-RC3-compat
DDC-3120 - PHP 5.6-RC3 compatibility
2014-08-27 12:27:05 -04:00
Christophe Coevoet
00eb0d3b67 Fixed the structure of the reverse-engineered mapping 2014-08-27 13:56:02 +02:00
Marco Pivetta
45d74e7220 DDC-3276 - #1122 - updating EBNF in docblock to reflect new syntax support 2014-08-27 02:12:08 +02:00
Marco Pivetta
097840dc93 Allowing expression in COUNT() DQL aggregation functions 2014-08-27 01:56:11 +02:00
encoder64
c8565c2772 Visibility for EntityRepositoryGenerator::generateClassName() 2014-08-26 21:42:55 +03:00
Steve Müller
8d3fba5540 improve schema validator error message for invalid bi-directional relations 2014-08-26 19:46:17 +02:00
Steve Müller
ad1f228ef6 fix DocBlock 2014-08-22 09:26:54 +02:00
Guilherme Blanco
400acad533 Merge pull request #1105 from deeky666/nested-embeddables
Add support for nesting embeddables
2014-08-21 16:33:44 -04:00
Marco Pivetta
ff80187930 Merge pull request #1098 from encoder32/DDC-1590
#DDC-1590: Fix Inheritance in Code-Generation
2014-08-18 22:35:52 +02:00
Marco Pivetta
dfbaac0401 #1112 - Fixed type-hint that is incompatible with most IDEs 2014-08-18 15:18:59 +02:00
Marco Pivetta
aab7fce2d4 #1112 - Elvis operator reduces code duplication even more 2014-08-18 15:17:54 +02:00
Marco Pivetta
bf03694e28 #1112 - Yoday need you may, better IDE hinting as well needed is. 2014-08-18 15:16:45 +02:00
Marco Pivetta
19d3552f2a #1112 - Removing useless trimming of the entity name being passed in 2014-08-18 15:14:53 +02:00
Marco Pivetta
3fed769b40 #1112 - avoiding useless assignments/splitted return statement 2014-08-18 15:02:34 +02:00
Marco Pivetta
7865de92ab #1112 - renamed $class to $className 2014-08-18 15:01:52 +02:00
Giorgio Premi
a665cb0229 DefaultRepositoryFactory: single repository for aliased entities 2014-08-18 14:52:01 +02:00
Vincent Composieux
edc2ed9512 Fix QueryException::instanceOfUnrelatedClass() message 2014-08-15 15:39:56 +02:00
Marco Pivetta
361ec2a474 DDC-3120 - using Doctrine\Instantiator when building new instances 2014-08-14 15:51:48 +02:00
Saša Stamenković
133bd288bf Minor CS fix 2014-08-12 09:57:19 +02:00
Steve Müller
0768916a06 fix handling infinite nesting of embeddables 2014-08-12 07:56:39 +02:00
Steve Müller
bca9d31531 add support for nesting embeddables 2014-08-11 16:53:18 +02:00
encoder64
20b72ef344 Visibility for EntityRepositoryGenerator::$repositoryName 2014-08-09 13:20:27 +03:00
Adrien Crivelli
1003466a5f Surround ! with spaces according to code style 2014-08-05 18:07:00 +09:00
Marco Pivetta
723529ffff Merge pull request #1069 from anho/reuse-console-app
added method to be able to reuse the console application
2014-08-04 16:17:11 +02:00
encoder64
4e805bb59a #DDC-1590: Fix Inheritance in Code-Generation: Code Style Fixes 2014-08-03 17:07:20 +03:00
encoder64
e0ae7634d5 #DDC-1590: Fix Inheritance in Code-Generation 2014-08-03 17:02:33 +03:00
František Bereň
a37f99f242 Root selection according other pagination tools
changed root selection in Walkers from looping queryComponents to using
$AST->fromClause as other walkers have
2014-07-30 15:55:14 +02:00
František Bereň
114bd2435f Arbitrary Join count walkers solution
Possible solution for Arbitrary Join problem in pagination count
walkers:
https://groups.google.com/forum/#!topic/doctrine-user/rpPYCDNKOU8

Added a condition to test query component against  SelectStatement from
clause
2014-07-30 09:56:22 +02:00
encoder64
df80d82aab Reverted visibility for EntityRepositoryGenerator::generateEntityRepositoryNamespace() 2014-07-27 20:15:18 +03:00
encoder64
5d608b6206 Private method EntityRepositoryGenerator::generateEntityRepositoryNamespace() changed to protected 2014-07-27 19:05:42 +03:00
encoder64
a4c7a89507 className fix: If namespace is not set then ClassName will be cut of 2014-07-27 17:28:06 +03:00
encoder64
c04b01cbd7 Added NS checking 2014-07-27 17:02:19 +03:00
encoder64
3dc2a68583 simple fixes 2014-07-27 15:22:51 +03:00
encoder64
90efaeec42 Code Style fixes 2014-07-27 14:54:35 +03:00
encoder64
c0ee57ae55 Default/Custom Entity Repository for Entity Repository Generator 2014-07-27 14:44:31 +03:00
Adrien Crivelli
27adf8d6e9 Refactor partial into options array
This coherent with what is done for Table. All platform specific things
are grouped into an options array. Eventually flags should be migrated
into options as well.
2014-07-22 10:32:31 +09:00
Adrien Crivelli
eeb7ff4a6d Support for Partial Indexes for PostgreSql and Sqlite
Support for Partial Indexes was available in Doctrine 1 following
http://www.doctrine-project.org/jira/browse/DC-82. This commit
reintroduce support for Doctrine 2. We use the same syntax with an
optionnal "where" attribute for Index and UniqueConstraint.
2014-07-22 10:32:30 +09:00
Rhodri Pugh
ad10a18071 added more informative error messages when invalid parameter count 2014-07-15 13:17:22 +01:00
Andreas Flack
0ade3aa62a Improve phrasing on exception message instead of trying to fix callers 2014-07-14 11:25:04 +02:00
flack
b8ef3af982 Small grammar fix
The exception was reading 

```
A detached entity was found during {removed|persisted} [entityName] 
```

I changed the verbs to infinitive now. Alternatively, the text in ``ORMInvalidArgumentException::detachedEntityCannot`` could also be changed to read 


```
Detached entity [entityName] cannot be {removed|persisted}  
```
2014-07-14 11:25:04 +02:00
Marco Pivetta
90dee7036d Merge pull request #1067 from albertvolkman/add-fullstop-and-newline
Add fullstop and newline after property description.
2014-07-14 11:09:40 +02:00
Marco Pivetta
b80149344d Merge pull request #1073 from kamazee/add_passing_type_to_rsm_in_sql_walker
Add missing type mapping
2014-07-14 10:51:13 +02:00
Alexander Kurilo
38fcc66c16 Add missing type mapping
Fixes DDC-3192
Refs DDC-2494

This is essentially a fix from DDC-2494 applied to SQLWalker.
The issue: type was not converted to PHP value when the result is fetched by
executing DQL query rather than using entity manager's findX(). Similar issue
for BasicEntityPersister (which is used when em's findX is executed) was fixed
in DDC-2494, but SQLWalker made the issue valid for any custom query.
2014-07-14 11:22:08 +03:00
Daniel Sippel
45358bf5d0 possible fix for DDC-2021 2014-07-09 16:39:44 +02:00
Marco Pivetta
a8035f25a2 Merge pull request #1074 from zimmermanj42/DDC-3160
[DDC-3160] Alternate fix for DDC-2996 bug
2014-07-06 16:07:43 +02:00