Created
May 7, 2019 01:08
-
-
Save maciejmiara/fc6639d60ca8769b91fc1d3c4b0a3ba3 to your computer and use it in GitHub Desktop.
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\Framework\Entity; | |
use Common\Id; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="run_participations") | |
*/ | |
final class RunParticipation | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\ManyToOne(targetEntity="Run", cascade={"persist"}) | |
*/ | |
private $run; | |
/** | |
* @ORM\Id | |
* @ORM\ManyToOne(targetEntity="Runner", inversedBy="participations", cascade={"persist"}) | |
*/ | |
private $runner; | |
public function __construct(Run $run, Runner $runner) | |
{ | |
$this->run = $run; | |
$this->runner = $runner; | |
} | |
public function getRun(): Run | |
{ | |
return $this->run; | |
} | |
public function getRunnerId(): string | |
{ | |
return $this->runner->getId(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment