Last active
August 18, 2020 15:09
-
-
Save gquemener/477742e06e5aca94092a2fe07a60c473 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 | |
class Repository | |
{ | |
public function findAll(): array | |
{ | |
return $this->connection->project( | |
sprintf('SELECT * FROM %s', self::TABLE_NAME), | |
[], | |
function(array $row): Domain\MyObject { | |
return Domain\MyObject::fromArray($row); | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment