Browse Source

Fix deprecated order direction usage example.

ndm2 5 years ago
parent
commit
348ab2c8f5
2 changed files with 6 additions and 2 deletions
  1. 3 1
      src/Database/Query.php
  2. 3 1
      src/Datasource/QueryInterface.php

+ 3 - 1
src/Database/Query.php

@@ -1140,7 +1140,9 @@ class Query implements ExpressionInterface, IteratorAggregate
      * `ORDER BY title DESC, author_id ASC`
      *
      * ```
-     * $query->order(['title' => 'DESC NULLS FIRST'])->order('author_id');
+     * $query
+     *     ->order(['title' => $query->newExpr('DESC NULLS FIRST')])
+     *     ->order('author_id');
      * ```
      *
      * Will generate:

+ 3 - 1
src/Datasource/QueryInterface.php

@@ -218,7 +218,9 @@ interface QueryInterface
      * `ORDER BY title DESC, author_id ASC`
      *
      * ```
-     * $query->order(['title' => 'DESC NULLS FIRST'])->order('author_id');
+     * $query
+     *     ->order(['title' => $query->newExpr('DESC NULLS FIRST')])
+     *     ->order('author_id');
      * ```
      *
      * Will generate: