Internal: Adapt schema for gradebook entity that can have many documents - refs BT#20864

pull/5764/head
NicoDucou 1 year ago
parent 4a89a770e9
commit 71e3ec3e26
  1. 2
      src/CoreBundle/Entity/GradebookCategory.php
  2. 4
      src/CourseBundle/Entity/CDocument.php

@ -112,7 +112,7 @@ class GradebookCategory
#[ORM\Column(name: 'certif_min_score', type: 'integer', nullable: true)] #[ORM\Column(name: 'certif_min_score', type: 'integer', nullable: true)]
protected ?int $certifMinScore = null; protected ?int $certifMinScore = null;
#[ORM\OneToOne(inversedBy: 'gradebookCategory', targetEntity: CDocument::class)] #[ORM\ManyToOne(inversedBy: 'gradebookCategory', targetEntity: CDocument::class)]
#[ORM\JoinColumn(name: 'document_id', referencedColumnName: 'iid', onDelete: 'set null')] #[ORM\JoinColumn(name: 'document_id', referencedColumnName: 'iid', onDelete: 'set null')]
#[Groups(['gradebookCategory:read', 'gradebookCategory:write'])] #[Groups(['gradebookCategory:read', 'gradebookCategory:write'])]
protected ?CDocument $document = null; protected ?CDocument $document = null;

@ -171,9 +171,9 @@ class CDocument extends AbstractResource implements ResourceInterface, ResourceS
#[ORM\Column(name: 'template', type: 'boolean', nullable: false)] #[ORM\Column(name: 'template', type: 'boolean', nullable: false)]
protected bool $template; protected bool $template;
#[ORM\OneToOne(mappedBy: 'document', targetEntity: GradebookCategory::class)] #[ORM\OneToMany(mappedBy: 'document', targetEntity: GradebookCategory::class)]
#[Groups(['document:read'])] #[Groups(['document:read'])]
protected ?GradebookCategory $gradebookCategory = null; protected Collection $gradebookCategories = null;
public function __construct() public function __construct()
{ {

Loading…
Cancel
Save