Skip to content

Commit 3a5db33

Browse files
committed
Update content about count
1 parent e31d894 commit 3a5db33

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

guide/index.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1807,12 +1807,22 @@ The Model has some extra methods for doing common operations:
18071807
Count
18081808
"""""
18091809

1810-
A basic function to count all rows in the table.
1810+
A basic function to count rows in the table.
18111811

18121812
.. code-block:: php
18131813
18141814
$count = $model->count(); // int
18151815
1816+
Optionally, with a parameter to the WHERE clause:
1817+
1818+
.. code-block:: php
1819+
1820+
$where = [
1821+
['id', '<', 100], // WHERE `id` < 100
1822+
['name', 'like', 'Pa%'], // AND `name` LIKE 'Pa%'
1823+
];
1824+
$count = $model->count($where); // int
1825+
18161826
Replace
18171827
"""""""
18181828

0 commit comments

Comments
 (0)