chill-bundles/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php

51 lines
1.1 KiB
PHP

<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\DocStoreBundle\Entity;
use Chill\MainBundle\Entity\HasScopesInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table("chill_doc.accompanyingcourse_document")
*/
class AccompanyingCourseDocument extends Document implements HasScopesInterface
{
/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class)
* @ORM\JoinColumn(nullable=false)
*/
private ?AccompanyingPeriod $course = null;
public function getCourse(): ?AccompanyingPeriod
{
return $this->course;
}
public function getScopes(): iterable
{
if (null !== $this->course) {
return [];
}
return $this->course->getScopes();
}
public function setCourse(?AccompanyingPeriod $course): self
{
$this->course = $course;
return $this;
}
}