Skip to content

Commit f809b33

Browse files
authored
Refactor database query selection method
1 parent 1e24e0e commit f809b33

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/guide/start/databases.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ final readonly class PageRepository
294294
295295
public function findOneBySlug(string $slug): ?Page
296296
{
297-
$query = (new Query($this->connection))
298-
->select('*')
297+
$query = $this->connection
298+
->select()
299299
->from('{{%page}}')
300300
->where('slug = :slug', ['slug' => $slug]);
301301
@@ -307,8 +307,8 @@ final readonly class PageRepository
307307
*/
308308
public function findAll(): iterable
309309
{
310-
$data = (new Query($this->connection))
311-
->select('*')
310+
$data = $this->connection
311+
->select()
312312
->from('{{%page}}')
313313
->all();
314314

0 commit comments

Comments
 (0)