Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Eloquent's run participation repository implementation
<?php
declare(strict_types = 1);
namespace Infrastructure\Eloquent\Repository;
use Domain\Model\RunParticipation;
use Infrastructure\Eloquent\Transformer\RunParticipationTransformer;
class RunParticipationRepository implements \Domain\Repository\RunParticipationRepository
{
private $runParticipationTransformer;
public function __construct(RunParticipationTransformer $runParticipationTransformer)
{
$this->runParticipationTransformer = $runParticipationTransformer;
}
/**
* {@inheritdoc}
*/
public function save(RunParticipation $runParticipation): void
{
$dbRunParticipation = $this->runParticipationTransformer->domainToEntity($runParticipation);
$dbRunParticipation->save();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment