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

Fix update/delete aliases in documentation #6470

Merged
Merged
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
2 changes: 1 addition & 1 deletion docs/en/reference/query-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ user-input:
<?php

$queryBuilder
->update('users', 'u')
->update('users u')
->set('u.logins', 'u.logins + 1')
->set('u.last_login', '?')
->setParameter(0, $userInputLastLogin)
Expand Down
14 changes: 7 additions & 7 deletions src/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ public function addSelect(string $expression, string ...$expressions): self
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->delete('users')
* ->where('users.id = :user_id')
* ->delete('users u')
* ->where('u.id = :user_id')
* ->setParameter(':user_id', 1);
* </code>
*
Expand All @@ -606,9 +606,9 @@ public function delete(string $table): self
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->update('counters')
* ->set('counters.value', 'counters.value + 1')
* ->where('counters.id = ?');
* ->update('counters c')
* ->set('c.value', 'c.value + 1')
* ->where('c.id = ?');
* </code>
*
* @param string $table The table whose rows are subject to the update.
Expand Down Expand Up @@ -785,7 +785,7 @@ public function rightJoin(string $fromAlias, string $join, string $alias, ?strin
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->update('counters', 'c')
* ->update('counters c')
* ->set('c.value', 'c.value + 1')
* ->where('c.id = ?');
* </code>
Expand Down Expand Up @@ -821,7 +821,7 @@ public function set(string $key, string $value): self
* $or->add($qb->expr()->eq('c.id', 1));
* $or->add($qb->expr()->eq('c.id', 2));
*
* $qb->update('counters', 'c')
* $qb->update('counters c')
* ->set('c.value', 'c.value + 1')
* ->where($or);
* </code>
Expand Down
Loading