Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docs to show QueryBuilder::setParameters with array instead of ArrayCollection #11295

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/en/reference/query-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ following syntax:
// $qb instanceof QueryBuilder

// Query here...
$qb->setParameters(new ArrayCollection([
new Parameter('1', 'value for ?1'),
new Parameter('2', 'value for ?2')
]));
$qb->setParameters([
1 => 'value for ?1',
2 => 'value for ?2',
]);

Getting already bound parameters is easy - simply use the above
mentioned syntax with "getParameter()" or "getParameters()":
Expand Down
8 changes: 4 additions & 4 deletions src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,10 @@ public function setParameter($key, $value, $type = null)
* ->select('u')
* ->from('User', 'u')
* ->where('u.id = :user_id1 OR u.id = :user_id2')
* ->setParameters(new ArrayCollection(array(
* new Parameter('user_id1', 1),
* new Parameter('user_id2', 2)
* )));
* ->setParameters([
* 'user_id1' => 1,
* 'user_id2' => 2,
* ]);
* </code>
*
* @param ArrayCollection|mixed[] $parameters The query parameters to set.
Expand Down
Loading