Skip to content

Commit

Permalink
Merge pull request #3232 from morozov/remove-now
Browse files Browse the repository at this point in the history
Removed NOW() from QueryBuilder usage examples
  • Loading branch information
Ocramius authored Jul 28, 2018
2 parents 5405427 + aa25877 commit 2d3c0f1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/Doctrine/DBAL/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,9 @@ public function delete($delete = null, $alias = null)
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->update('users', 'u')
* ->set('u.last_login', 'NOW()')
* ->where('u.id = ?');
* ->update('counters', 'c')
* ->set('c.value', 'c.value + 1')
* ->where('c.id = ?');
* </code>
*
* @param string $update The table whose rows are subject to the update.
Expand Down Expand Up @@ -745,9 +745,9 @@ public function rightJoin($fromAlias, $join, $alias, $condition = null)
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->update('users', 'u')
* ->set('u.last_login', 'NOW()')
* ->where('u.id = ?');
* ->update('counters', 'c')
* ->set('c.value', 'c.value + 1')
* ->where('c.id = ?');
* </code>
*
* @param string $key The column to set.
Expand All @@ -766,19 +766,19 @@ public function set($key, $value)
*
* <code>
* $qb = $conn->createQueryBuilder()
* ->select('u.name')
* ->from('users', 'u')
* ->where('u.id = ?');
* ->select('c.value')
* ->from('counters', 'c')
* ->where('c.id = ?');
*
* // You can optionally programatically build and/or expressions
* $qb = $conn->createQueryBuilder();
*
* $or = $qb->expr()->orx();
* $or->add($qb->expr()->eq('u.id', 1));
* $or->add($qb->expr()->eq('u.id', 2));
* $or->add($qb->expr()->eq('c.id', 1));
* $or->add($qb->expr()->eq('c.id', 2));
*
* $qb->update('users', 'u')
* ->set('u.last_login', 'NOW()')
* $qb->update('counters', 'c')
* ->set('c.value', 'c.value + 1')
* ->where($or);
* </code>
*
Expand Down

0 comments on commit 2d3c0f1

Please sign in to comment.