<?php
namespace CoreBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\JoinTable;
use Doctrine\ORM\Mapping\ManyToMany;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\PersistentCollection;
use UserBundle\Entity\User;
/**
* @ORM\Table("training_performance")
* @ORM\Entity(repositoryClass="TrainingPerformanceRepository")
*/
class TrainingPerformance extends SessionTypePerformance
{
/** @ManyToOne(targetEntity="Session") */
private $session;
/**
* @ManyToMany(targetEntity="TopicPerformance")
* @JoinTable(name="training_performance_topic_performance",
* joinColumns={@JoinColumn(name="training_performance_id")},
* inverseJoinColumns={@JoinColumn(name="topic_performance_id", unique=true)}
* )
*/
private $topicPerformances;
public function __construct(User $student, Session $session)
{
parent::__construct($student);
$this->session = $session;
$this->topicPerformances = new ArrayCollection();
}
/** @return PersistentCollection | ArrayCollection */
public function getTopicPerformances(): Collection
{
return $this->topicPerformances;
}
public function setTopicPerformances(ArrayCollection $topicPerformances): void
{
$this->topicPerformances = $topicPerformances;
}
}