Skip to content

Instantly share code, notes, and snippets.

@gquemener
Last active August 18, 2020 15:09
Show Gist options
  • Save gquemener/477742e06e5aca94092a2fe07a60c473 to your computer and use it in GitHub Desktop.
Save gquemener/477742e06e5aca94092a2fe07a60c473 to your computer and use it in GitHub Desktop.
<?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