Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #360 from doctrine/DDC-1840
Browse files Browse the repository at this point in the history
[DDC-1840] Implemented parameters as a collection.
  • Loading branch information
guilhermeblanco committed May 29, 2012
2 parents 1f2ce21 + 15f76c6 commit e4935e5
Show file tree
Hide file tree
Showing 14 changed files with 404 additions and 182 deletions.
18 changes: 18 additions & 0 deletions UPGRADE_TO_2_3
Expand Up @@ -7,3 +7,21 @@ and strip a trailing "s" character if there is one.
# Merge copies non persisted properties too

When merging an entity in UoW not only mapped properties are copied, but also others.

# Query, QueryBuilder and NativeQuery parameters *BC break*

From now on, parameters in queries is an ArrayCollection instead of a simple array.
This affects heavily the usage of setParameters(), because it will not append anymore
parameters to query, but will actually override the already defined ones.
Whenever you are retrieving a parameter (ie. $query->getParameter(1)), you will
receive an instance of Query\Parameter, which contains the methods "getName",
"getValue" and "getType". Parameters are also only converted to when necessary, and
not when they are set.

Also, related functions were affected:

* execute($parameters, $hydrationMode) the argument $parameters can be either an key=>value array or an ArrayCollection instance
* iterate($parameters, $hydrationMode) the argument $parameters can be either an key=>value array or an ArrayCollection instance
* setParameters($parameters) the argument $parameters can be either an key=>value array or an ArrayCollection instance
* getParameters() now returns ArrayCollection instead of array
* getParameter($key) now returns Parameter instance instead of parameter value

0 comments on commit e4935e5

Please sign in to comment.