fixed: voter and permissions in accompanying course document

This commit is contained in:
2022-07-11 12:55:02 +02:00
parent 3bb8b713d1
commit ab08dab88a
5 changed files with 36 additions and 33 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\DocStoreBundle\Entity;
use Chill\MainBundle\Entity\HasScopesInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\Mapping as ORM;
@@ -18,7 +19,7 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Entity
* @ORM\Table("chill_doc.accompanyingcourse_document")
*/
class AccompanyingCourseDocument extends Document
class AccompanyingCourseDocument extends Document implements HasScopesInterface
{
/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class)
@@ -31,6 +32,15 @@ class AccompanyingCourseDocument extends Document
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;