/RunParticipationRepository.php Secret
Created
March 11, 2019 09:51
Star
You must be signed in to star a gist
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