[DDC 2004] addFilter class name or instance #557

Closed
wants to merge 170 commits into
from

Projects

None yet
@gimler
Contributor
gimler commented Jan 26, 2013

Make it possible to add filter class name or instance to addFilter. This is useful to use services to inject other dependencies.

stof and others added some commits Jul 16, 2012
@stof @beberlei stof Changed commands to use command.name in the help 3e53d9d
@guilhermeblanco @beberlei guilhermeblanco Moved implementation from EntityRepository to EntityManager. This dec…
…ouples ER implementation from EM, as it should be.
5b55739
@guilhermeblanco @beberlei guilhermeblanco Fixed DefaultRepositoryClassName which should follow the Persistence …
…interface, not ORM class.
2389f77
@igorw igorw [2.3] Use HelperSet in cli-config.php 2158a07
@guilhermeblanco @beberlei guilhermeblanco Fixed is_subclass_of comparing an interface which brought our require…
…ment to 5.3.9. Changed to reflection approach which still keep us at the same dependency as before.
ac9df05
@stof @beberlei stof Added the new DBAL 2.3 types in the EntityGenerator typehint map 369a30a
@beberlei beberlei Merge pull request #410 from igorw/helper-set
[2.3] Use HelperSet in cli-config.php
bd1e6ac
@beberlei beberlei Merge remote-tracking branch 'origin/2.3' into 2.3 13d32e6
@beberlei beberlei Merge remote-tracking branch 'origin/2.3' into 2.3 ef27721
@Ocramius @beberlei Ocramius DDC-1939 - Removing references to non-existing AssociationMapping class dfa6ff6
@beberlei beberlei [DDC-1939] Add test for persistent collection delete with composite key e2c40dc
@beberlei beberlei Merge branch 'DDC-1939' into 2.3 d7bdae3
@schmittjoh @beberlei schmittjoh added failing test for refresh with eager fetching e63575e
@beberlei beberlei [DDC-1964] Fix issue with refresh and and object hydrator not setting…
… field to null explicitly to override possible previous values.
7f68347
@beberlei beberlei Merge branch 'DDC-1964' into 2.3 7029d37
@Ocramius @beberlei Ocramius DDC-1933 - Fixing cloning of QueryBuilder and adding related tests 1e2eca1
@beberlei beberlei [DDC-1937] Fix bug with apc and annotation caching using a workaround. 6dd3078
@beberlei beberlei Merge branch 'DDC-1937' into 2.3 1676cf2
@beberlei beberlei Bump dependencies c55394c
@beberlei beberlei Release 2.3.0-RC1 5527e12
@beberlei beberlei Bump dev version to 2.3.0 992b51e
@Majkl578 Majkl578 [DDC-1961] Fixed parameter type support in Parameter 3b3d762
@guilhermeblanco guilhermeblanco Merge pull request #416 from Majkl578/DDC-1961
[DDC-1961] Fixed parameter type support in Parameter
3f2ddc6
@beberlei beberlei Update EntityRepository and PersistentCollection to new Criteria#expr…
…() method instead of having to implement themselves.
c99c7b6
@beberlei beberlei Merge branch 'CriteriaExpressionBuilder' into 2.3 17862d9
@asm89 Martin Meredith Create the setCustomHydrationMode function
This allows multiple hydrators to be set at once, and also allows for
the customHydrationMode options to be set via DoctrineORMModule
2e6b50b
@asm89 asm89 Fix setCustomHydrationModes + added test af08f05
@asm89 asm89 Merge branch 'config' into 2.3 971865f
@chEbba chEbba Fix ORMInvalidArgumentException factory methods with return instead o…
…f throw
3aaa90e
@FabioBatSilva @beberlei FabioBatSilva Fix DDC-1977 9d909cd
@beberlei beberlei Merge pull request #427 from chEbba/return-exception
Fix ORMInvalidArgumentException factory methods with return instead of throw
48e9434
@beberlei beberlei Merge remote-tracking branch 'origin/master' into 2.3 131d300
@beberlei beberlei [DDC-1918] Fix weird results at the end of paginator when using fetch…
… joins
f4ba583
@beberlei beberlei Merge remote-tracking branch 'origin/2.3' into 2.3 8c1d643
@beberlei beberlei Merge branch 'DDC-1918' into 2.3 bdb36a7
@beberlei beberlei Revert "Merge remote-tracking branch 'origin/master' into 2.3"
This reverts commit 131d300, reversing
changes made to 9d909cd.
114e233
@beberlei beberlei Release 2.3.0-RC2 d181fbc
@beberlei beberlei Bump dev version to 2.3.0 1a81444
@beberlei beberlei Release 2.3.0-RC2 9308afc
@beberlei beberlei Bump dev version to 2.3.0 bbf527a
@Josiah @beberlei Josiah Added a failing test for DDC-2003 2597192
@Josiah @beberlei Josiah Fixed DDC-2003 using closures to reference the functionality of the c…
…alling entity persister from the SQL value visitor.
366c6a7
@Josiah @beberlei Josiah Removed the closure keyword as it isn't supported in PHP 5.3 0dcfabb
@Josiah @beberlei Josiah Fixed formatting issues identified by Stof c76280b
@Josiah @beberlei Josiah Refactored the SqlValueVisitor to move all type processing to the ent…
…ity persister.
9cdee12
@beberlei beberlei [DDC-2003] Remove unused variable 30ad1b0
@beberlei beberlei Merge branch 'DDC-2003' into 2.3 741080d
@beberlei beberlei Bump DBAL dependency 8edecfd
@beberlei beberlei Release 2.3.0-RC3 a96bbbb
@beberlei beberlei Bump dev version to 2.3.0 4d9f24b
@beberlei Cas Update lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
Allow 'nullable' attribute to be exported for fields, something which already worked in YamlExport. This addition saved me a lot of time during development, not having to manually re-factor after each export.

Don't know why this was missing, maybe it's me who is missing something, so let me know ;)
53e164b
@beberlei beberlei Merge branch 'DDC-2027' into 2.3 387516f
@FabioBatSilva @beberlei FabioBatSilva remove duplicate code 0da0d02
@beberlei beberlei Merge branch 'DDC-2026' into 2.3 3fd8392
@Powerhamster @beberlei Powerhamster Several fixes for comments
updated @param and @throws annotations
85e5398
@Powerhamster @beberlei Powerhamster added missing use statement d7da012
@beberlei beberlei Merge branch 'DDC-2014' into 2.3 c2b82fa
@beberlei Stefano Rodriguez Fixes PersistentCollection::matching() when collection is not initial…
…ized and there are NEW entities in the collection
18a7fc5
@beberlei Stefano Rodriguez Added a failing test case on PersistentCollection::matching() when co…
…llection is not initialized and there are NEW entities in the collection
44a56e8
@beberlei Stefano Rodriguez use of assertCount 586aea0
@beberlei beberlei Merge branch 'DDC-2015' into 2.3 2353736
@beberlei beberlei Update dependencies 3294900
@beberlei beberlei Adjust MysqlSchemaToolTest to DBAL changes 75e968b
@beberlei beberlei Release 2.3.0-RC4 477642a
@beberlei beberlei Bump dev version to 2.3.0 c610131
@beberlei beberlei Bump versions 585c9fd
@beberlei beberlei Release 2.3.0 b5e19dc
@beberlei beberlei Bump dev version to 2.3.1 ea2b288
@FabioBatSilva @beberlei FabioBatSilva Fix DDC-2012 084101e
@beberlei beberlei Merge branch 'DDC-2012' into 2.3 04262e2
@FabioBatSilva @beberlei FabioBatSilva Fix test case c60e652
@beberlei beberlei [DDC-2059] Fix column and foreign key interfering with each other dur…
…ing reverse engineering.
4109f22
@beberlei beberlei Merge branch 'DDC-2059' into 2.3 518357d
@beberlei Marcin Radziwoński Fixed unique-constraint name in XML Exporter abd1137
@beberlei beberlei Merge branch 'DDC-2044' into 2.3 825a68b
@goetas @beberlei goetas typo fix 8b2c92a
@goetas @beberlei goetas spaces cb0cdde
@beberlei beberlei Merge branch 'DDC-2028' into 2.3 564ec1e
@jakoch @beberlei jakoch fix typo 1988944
@okovalov @beberlei okovalov Fixed bug with comment option not being added to column. 2e5d741
@beberlei beberlei Merge branch 'DDC-2068' into 2.3 e8412b8
@beberlei beberlei [DDC-2067] Refactor and fix bug in boolean evaluation inside XML Driver. 26cfbdd
@beberlei beberlei Merge branch 'DDC-2067' into 2.3 6bad010
@mnapoli @beberlei mnapoli Fix and test for DDC-2073 b53c81a
@mnapoli @beberlei mnapoli Fix and test for DDC-2073 ef4ff8b
@beberlei beberlei Merge branch 'DDC-2073' into 2.3 737e47e
@FabioBatSilva @beberlei FabioBatSilva Fix DDC-2121 d64be28
@beberlei beberlei Merge branch 'DDC-2121' into 2.3 994917a
@beberlei Benjamin Morel Fixed errors:
 - Typo in variable name in JoinClassPathExpression;
 - Undefined class AST\ArithmeticPrimary (x2);
 - QueryException::invalidPathExpression() expects a PathExpression, not a string.
b610855
@beberlei beberlei Merge branch 'DDC-2126' into 2.3 9b198be
@nemekzg @beberlei nemekzg Proposed fix for DDC-1241 974f18d
@beberlei beberlei Merge branch 'DDC-1241' into 2.3 6fee945
@gws @beberlei gws Fix for invalid 'double-ON' SQL generation with entity inheritance ty…
…pe JOINED.

In SqlWalker::walkJoin(), SqlWalker::walkRangeVariableDeclaration() can be
called which may produce an 'ON' clause if the entity inheritance type is
JOINED. As walkJoin() may then produce another ON clause, this results in
invalid SQL (e.g. '... ON foo = bar ON (baz = quux) ...' when the inheritance
type is JOINED.

This adds a test and a fix for the problem, by checking for an inheritance type
of JOINED in walkJoin() and using AND instead of ON in the appropriate place.

It seems like this part of the code is begging to be refactored. This is my
first foray into Doctrine internals and can't see a way to do this without
stomping all over the rest of the code, but this section seems ripe for cleanup
by somebody who is familiar.
bbf092c
@beberlei beberlei Merge branch 'DDC-2123' into 2.3 2229a5e
@jeremymarc @beberlei jeremymarc Allow 0 id for Entity
When using a 0 id, it's throwing InvalidArgumentException (Binding entities to query parameters only allowed for entities that have an identifier.) 
9dbf4d8
@jeremymarc @beberlei jeremymarc Compare to null instead of using isset 045d058
@beberlei beberlei Merge branch 'DDC-2122' into 2.3 653aef2
@beberlei TR notice is thrown up if no identifier values found
wrapping the setting of value with an array_key_exists to prevent a notice from being thrown
461d201
@beberlei TR refactoring getIndividualValue for valid key value
refactoring getIndividualValue
c6118cb
@beberlei TR Update lib/Doctrine/ORM/Persisters/BasicEntityPersister.php
coding standards change
1627c97
@beberlei beberlei Merge branch 'DDC-2115' into 2.3 edaab11
@lanthaler @beberlei lanthaler Improve DocBlock annotations of generated entities
Currently, the DocBlock annotations for member variables contain the variable name as description which is redundant and should be removed. Furthermore the class is annotated with the FQN instead of just the name. This makes automatically generated documentation quite ugly.
95a85d6
@beberlei beberlei Merge branch 'DDC-2116' into 2.3 612ed2b
@beberlei Vaughn Clayton [DDC-2113] Surround WHERE clause with parens if using SQLFilter 6d35fad
@beberlei beberlei Merge branch 'DDC-2113' into 2.3 2ce877b
@beberlei justin.randell check for false as a return value from get_parent_class(), not null a3c98b1
@beberlei beberlei Merge branch 'DDC-2082' into 2.3 e4ef9e0
@jaspernbrouwer @beberlei jaspernbrouwer Prevented "Undefined index" notice when updating
While executing updates on an entity scheduled for update without
a change-set, an "Undefined index" notice is raised.
a1094d3
@jaspernbrouwer @beberlei jaspernbrouwer Added testcase for DDC-2086 1618a3e
@beberlei beberlei Merge branch 'DDC-2086' into 2.3 3c944b3
@FabioBatSilva @beberlei FabioBatSilva Fix DDC-2069 57db88b
@beberlei beberlei Merge branch 'DDC-2069' into 2.3 643ed0b
@FabioBatSilva @beberlei FabioBatSilva Fix DDC-2079 a7ed9e6
@FabioBatSilva @beberlei FabioBatSilva Fix typo 8c2009c
@beberlei beberlei Merge branch 'DDC-2079' into 2.3 c6eb04d
@HarmenM @beberlei HarmenM Update lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php
replaced the for-loop which adds the InputParameters for a single InputParameter for use with an array instead of a set of scalars.
e7e69da
@HarmenM @beberlei HarmenM Update lib/Doctrine/ORM/Tools/Pagination/Paginator.php
Replaced the foreach loop adding all IDs as single parameters with a single parameter which injects the IDs as an array.
ed11e61
@HarmenM @beberlei HarmenM Modified the WhereInWalkerTest to be compatible with a single InputPa…
…rameter.
4ea7a5d
@beberlei beberlei Merge branch 'DDC-2071' into 2.3 d069875
@beberlei Miha Vrhovnik The distinct query should replicate the fields in order by clause and…
… the order by clause itself from inner query

This fixes DDC-1958
8865a5b
@beberlei Miha Vrhovnik extracted pgsql sql generation into a helper method 006d383
@beberlei beberlei Merge branch 'DDC-1958' into 2.3 5756021
@beberlei beberlei [DDC-2109] Fix bug with ResolveTargetEntityListener and ManyToMany as…
…sociations.
01148e5
@beberlei beberlei Merge branch 'DDC-2109' into 2.3 77d060a
@fran6co
Contributor

This is causing a regression when using arbitrary left joins. For example

   SELECT e FROM Doctrine\Tests\Models\Company\CompanyEmployee e LEFT JOIN Doctrine\Tests\Models\Company\CompanyManager m WITH e.id = m.id

Generates

  SELECT c0_.id AS id0, c0_.name AS name1, c1_.salary AS salary2, c1_.department AS department3, c1_.startDate AS startDate4, c0_.discr AS discr5 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id LEFT JOIN company_managers c2_ INNER JOIN company_employees c3_ ON c2_.id = c3_.id INNER JOIN company_persons c4_ ON c2_.id = c4_.id AND (c0_.id = c4_.id)

instead of

 SELECT c0_.id AS id0, c0_.name AS name1, c1_.salary AS salary2, c1_.department AS department3, c1_.startDate AS startDate4, c0_.discr AS discr5 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id LEFT JOIN company_managers c2_ INNER JOIN company_employees c3_ ON c2_.id = c3_.id INNER JOIN company_persons c4_ ON c2_.id = c4_.id ON (c0_.id = c4_.id)

SQL needs that all LEFT JOIN to have an ON.

Contributor

This should be fixed by #518

fran6co and others added some commits Nov 20, 2012
@fran6co @beberlei fran6co regression fix for left joins (double ON) 24f74bc
@fran6co @beberlei fran6co added outer left join 469bd02
@beberlei beberlei Merge branch 'DDC-2158' into 2.3 1aab5fe
@jankramer @beberlei jankramer [DDC-2074] Added test for PersistentCollection#clear. 83943e8
@jankramer @beberlei jankramer [DDC-2074] Fixed bug regarding clearing PC's without owner
When calling clear on a PC that has no owner (e.g. because it was
cloned), it can't be deleted as there is no metadata available.
In these cases, it shouldn't be scheduled for deletion.
c90ed73
@beberlei beberlei Merge branch 'DDC-2074' into 2.3 a3fea32
@FabioBatSilva @beberlei FabioBatSilva Fix DDC-2172 45269fe
@FabioBatSilva @beberlei FabioBatSilva refactoring tests faedbfc
@FabioBatSilva @beberlei FabioBatSilva Fix CS 6e7e4dd
@beberlei beberlei Merge branch 'DDC-2172' into 2.3 f75c3b5
@beberlei beberlei Clarify BC break in DDC-2156 8613228
@beberlei beberlei Merge branch 'DDC-2156' into 2.3 287b29a
@beberlei Francis Besset Fixed typo e0aa01d
@beberlei Francis Besset Fixed trailing spaces on SchemaTool 660f89f
@beberlei Francis Besset Passed column options to the join column 0672688
@beberlei beberlei Merge branch 'DDC-2182' into 2.3 dab2b50
@beberlei beberlei Update DBAL dependency de22e72
@beberlei beberlei Release 2.3.1 173b398
@beberlei beberlei Bump dev version to 2.3.2 59aef2c
@beberlei beberlei DDC-2199 / DDC-2192 - Versioned fields didnt work in XML/YAML mapping f2f8c4f
@beberlei beberlei Merge branch 'DDC-2199' into 2.3 b666a62
@beberlei beberlei Merge remote-tracking branch 'origin/2.3' into 2.3 6d89875
@PSchwisow @beberlei PSchwisow Fix DDC-1690
Added the lines suggested by the original reporter.
22dc20c
@beberlei Patrick Schwisow [DDC-1690] Created unit test c120700
@PSchwisow @beberlei PSchwisow [DDC-1690] Added an empty line as requested. 0425e84
@beberlei beberlei Merge branch 'DDC-1690' into 2.3 b68c6b3
@beberlei beberlei Fix MySQL test f94b6c0
@beberlei beberlei [DDC-2206] Fix Setup::registerAutoloadPEAR() to work with Symfony nam…
…espaces from top PEAR directory
f05bcbc
@beberlei beberlei Merge branch 'DDC-2206' into 2.3 50132dd
@beberlei beberlei Merge branch '2.3' of github.com:doctrine/doctrine2 into 2.3 aee75d8
@beberlei beberlei [DDC-2175] Fix bug in JoinedSubclassPersister 88e8176
@beberlei beberlei Merge branch 'DDC-2175' into 2.3 0190946
@beberlei beberlei Bump submodule of DBAL to 2.3.2 b59cd04
@beberlei beberlei Release 2.3.2 c5725dd
@beberlei beberlei Bump dev version to 2.3.3 f5bb8be
@stefankleff @beberlei stefankleff The EntityManager was not injected in uninitialized proxys which are …
…ObjectManagerAware.

I ran into that problem while I had two objects in the identitymap while hydrating a collection: one was new a "real" entity and the other one was an uninitialized proxy. For "real" entities the em is injected in line 2427, for new entities it is injected in 2436->2364, but for proxies this is missing. According to the comment "inject ObjectManager into just loaded proxies." the code in line 2427 should do this, but in fact it is just used if it is a "real" entity or an already initialized proxy. Moving the injection to outside of the condition in line 2411 (if the entity is an unitialized proxy) solves this.
c4c70d6
@stefankleff @beberlei stefankleff fixed indentation
Restored old way of injection to just inject it during a refresh
Added injection for initialized proxies
8001cad
@stefankleff @beberlei stefankleff Added test 54193e7
@beberlei beberlei DDC-2231 - Simplify test fc2eebd
@beberlei beberlei Merge branch 'DDC-2231' into 2.3 6829c46
@beberlei beberlei [DDC-2246] Fix bug with UnitOfWork#getEntityState() and entities with…
… foreign identifier.
88cebe1
@beberlei beberlei Merge branch 'DDC-2246' into 2.3 d9f51eb
@beberlei beberlei Merge remote-tracking branch 'origin/2.3' into 2.3 6d25c4e
@beberlei beberlei [DDC-2243] Fix bug where a bigint identifier would be casted to an in…
…teger, causing inconsistency with the string handling.
f0312ed
@beberlei beberlei Merge branch 'DDC-2243' into 2.3 fdd0af3
@gimler gimler make it possible to add class or instance to addFilter 05830da
@doctrinebot

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DDC-2259

@gimler
Contributor
gimler commented Jan 26, 2013

all ready in master

@gimler gimler closed this Jan 26, 2013
@gimler gimler deleted the gimler:DDC-2004 branch Nov 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment