-
-
Save maciejmiara/beb282e01f894aa8ceff9237d1921ed9 to your computer and use it in GitHub Desktop.
Eloquent's run participation repository implementation
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 | |
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