Skip to content
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
8 changes: 4 additions & 4 deletions en/orm/query-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ When using aggregate functions like ``count`` and ``sum`` you may want to use
'count' => $query->func()->count('view_count'),
'published_date' => 'DATE(created)'
])
->group('published_date')
->groupBy('published_date')
->having(['count >' => 3]);

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

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

.. warning::

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

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

// Attach the new query to the table expression
return $cte
Expand Down
6 changes: 3 additions & 3 deletions en/orm/retrieving-data-and-resultsets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ by using the ``finder`` option::
$article = $articles->get($id, [
'finder' => 'translations',
]);

The list of options supported by get() are:

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

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

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