@@ -184,23 +184,23 @@ methods will let you re-use your queries and make testing easier.
184184### Getting Arrays Instead of Entities
185185
186186By default, queries and result sets return [ Entities] ( ../orm/entities ) objects.
187- When you only need plain arrays, use ` findUnhydrated ()` instead of ` find() ` :
187+ When you only need plain arrays, use ` unhydratedFind ()` instead of ` find() ` :
188188
189189``` php
190- $query = $articles->findUnhydrated ();
190+ $query = $articles->unhydratedFind ();
191191
192192// $data is a ResultSet that contains array data.
193193$data = $query->all();
194194
195195// Terminal methods are typed as arrays too.
196- $row = $articles->findUnhydrated ()->where(['id' => 1])->first(); // array<string , mixed >|null
196+ $row = $articles->unhydratedFind ()->where(['id' => 1])->first(); // array<string , mixed >|null
197197```
198198
199- ` findUnhydrated ()` accepts the same finder type and arguments as ` find() ` , so
199+ ` unhydratedFind ()` accepts the same finder type and arguments as ` find() ` , so
200200your existing [ custom finders] ( #custom-find-methods ) are reused unchanged:
201201
202202``` php
203- $rows = $articles->findUnhydrated ('published')->all();
203+ $rows = $articles->unhydratedFind ('published')->all();
204204```
205205
206206It returns a ` Cake\ORM\Query\UnhydratedSelectQuery ` . This behaves exactly like
@@ -210,14 +210,14 @@ result shape, so static analyzers no longer see `entity|array` on `first()`,
210210flows through a custom finder.
211211
212212> [ !NOTE]
213- > ` findUnhydrated ()` only changes the result shape for row-returning finders.
213+ > ` unhydratedFind ()` only changes the result shape for row-returning finders.
214214> ` findList() ` and ` findThreaded() ` produce a key/value map or nested tree
215215> regardless of hydration, so there is nothing to type differently for them.
216216
217217> [ !WARNING]
218218> ` SelectQuery::disableHydration() ` is deprecated as of 5.4.0 and will be
219219> removed in 6.0. The fluent toggle returns a query whose static type still
220- > claims to produce entities; prefer ` findUnhydrated ()` instead.
220+ > claims to produce entities; prefer ` unhydratedFind ()` instead.
221221
222222<a id =" table-find-first " ></a >
223223
@@ -1104,7 +1104,7 @@ section show how you can add calculated fields, or replace the result set.
11041104> Depending on your use case, you may also consider skipping hydration:
11051105>
11061106> ` ` ` bash
1107- > $results = $articles->findUnhydrated ()
1107+ > $results = $articles->unhydratedFind ()
11081108> ->all ();
11091109> ` ` `
11101110>
@@ -1274,7 +1274,7 @@ $reducer = function ($occurrences, $word, $mapReduce) {
12741274Finally, we put everything together:
12751275
12761276```php
1277- $wordCount = $articles->findUnhydrated ()
1277+ $wordCount = $articles->unhydratedFind ()
12781278 ->where([' published' => true])
12791279 ->andWhere([' published_date > =' => new DateTime(' 2014-01-01' )])
12801280 ->mapReduce($mapper, $reducer)
@@ -1346,7 +1346,7 @@ $reducer = function ($friends, $user, $mr) {
13461346And we supply our functions to a query:
13471347
13481348` ` ` php
1349- $fakeFriends = $friends->findUnhydrated ()
1349+ $fakeFriends = $friends->unhydratedFind ()
13501350 -> mapReduce($mapper , $reducer )
13511351 ->all ()
13521352 ->toArray ();
0 commit comments