Skip to content

Instantly share code, notes, and snippets.

@xtrasmal
Forked from gquemener/Repository.php
Created July 1, 2018 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xtrasmal/0119dd443b892f6fcca7c668ec79739e to your computer and use it in GitHub Desktop.
Save xtrasmal/0119dd443b892f6fcca7c668ec79739e 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