Created
May 13, 2020 19:48
-
-
Save kelunik/e7288bb28faa979d32504a61df80bec0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$confirmedEmails = yield $db->select() | |
->stream() | |
->filter(fn (User $user) => $user->isEmailConfirmed()) | |
->map(fn (User $user) => $user->getEmail()) | |
->toArray(); | |
$pagedConfirmedUsers = yield $db->select() | |
->stream() | |
->filter(fn (User $user) => $user->isEmailConfirmed()) | |
->skip(10 * ($page - 1)) | |
->limit(10) | |
->toArray(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
map(callable): Stream
filter(callable): Stream
each(callable): Promise
drop(int): Stream
/skip(int): Stream
dropWhile(callable): Stream
/skipWhile(callable): Stream
dropUntil(callable): Stream
/skipUntil(callable): Stream
limit(int): Stream
/take(int): Stream
count(): Promise
sum(): Promise
toArray(): Promise