Potential Produkt Increment #83

Merged
mg8220s merged 40 commits from dev into main 2024-12-11 14:16:27 +01:00
Showing only changes of commit 45010810f7 - Show all commits

View File

@@ -167,6 +167,36 @@ class SubjectData
return true;
}
/**
* Fügt ein neues Thema zum Fach hinzu
* @param TopicData $topic Das neue Thema
* @return bool true, wenn erfolgreich, sonst false
*/
public function addTopic(TopicData $topic): bool
{
if(isset($this->topics[$topic->getId()])) {
return false;
}
$this->topics[] = $topic;
return true;
}
/**
* Entfernt ein Thema vom Fach
* @param TopicData $topic Das zu entfernende Thema
* @return bool true, wenn erfolgreich, sonst false
*/
public function removeTopic(TopicData $topic): bool
{
if(!isset($this->topics[$topic->getId()])) {
return false;
}
$this->topics = array_diff($this->topics, [$topic]);
return true;
}
public function getId(): string
{
return $this->id;