Skip to content

Commit ec0cae2

Browse files
authored
Merge pull request #7583 from rochamarcelo/feature/depreated-query-group
Feature/depreated query group
2 parents 397eacc + d73e157 commit ec0cae2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

en/orm/query-builder.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ When using aggregate functions like ``count`` and ``sum`` you may want to use
485485
'count' => $query->func()->count('view_count'),
486486
'published_date' => 'DATE(created)'
487487
])
488-
->group('published_date')
488+
->groupBy('published_date')
489489
->having(['count >' => 3]);
490490

491491
Case Statements
@@ -1145,7 +1145,7 @@ expression objects to add snippets of SQL to your queries::
11451145
$query->select(['two' => $expr]);
11461146

11471147
``Expression`` objects can be used with any query builder methods like
1148-
``where()``, ``limit()``, ``group()``, ``select()`` and many other methods.
1148+
``where()``, ``limit()``, ``groupBy()``, ``select()`` and many other methods.
11491149

11501150
.. warning::
11511151

@@ -1227,7 +1227,7 @@ this query for retrieving article ids and their comments count::
12271227
$query = $articles->find();
12281228
$query->select(['Articles.id', $query->func()->count('Comments.id')])
12291229
->matching('Comments')
1230-
->group(['Articles.id']);
1230+
->groupBy(['Articles.id']);
12311231
$total = $query->count();
12321232

12331233
After counting, the query can still be used for fetching the associated
@@ -1758,7 +1758,7 @@ To build that query with the ORM query builder we would use::
17581758
'order_count' => $q->func()->count('*'),
17591759
'customer_id'
17601760
])
1761-
->group('customer_id');
1761+
->groupBy('customer_id');
17621762

17631763
// Attach the new query to the table expression
17641764
return $cte

en/orm/retrieving-data-and-resultsets.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ by using the ``finder`` option::
7777
$article = $articles->get($id, [
7878
'finder' => 'translations',
7979
]);
80-
80+
8181
The list of options supported by get() are:
8282

8383
- ``cache`` cache config.
@@ -861,7 +861,7 @@ data, you can use the ``leftJoinWith()`` function::
861861
$query = $articlesTable->find();
862862
$query->select(['total_comments' => $query->func()->count('Comments.id')])
863863
->leftJoinWith('Comments')
864-
->group(['Articles.id'])
864+
->groupBy(['Articles.id'])
865865
->enableAutoFields(true);
866866

867867
The results for the above query will contain the article data and the
@@ -877,7 +877,7 @@ word, per author::
877877
->leftJoinWith('Articles.Tags', function ($q) {
878878
return $q->where(['Tags.name' => 'awesome']);
879879
})
880-
->group(['Authors.id'])
880+
->groupBy(['Authors.id'])
881881
->enableAutoFields(true);
882882

883883
This function will not load any columns from the specified associations into the

0 commit comments

Comments
 (0)