Skip to content

Instantly share code, notes, and snippets.

@maciejmiara
Created May 7, 2019 01:08
Show Gist options
  • Save maciejmiara/fc6639d60ca8769b91fc1d3c4b0a3ba3 to your computer and use it in GitHub Desktop.
Save maciejmiara/fc6639d60ca8769b91fc1d3c4b0a3ba3 to your computer and use it in GitHub Desktop.
<?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