<?php
require_once("classes/SubjectData.php");
require_once("classes/TopicData.php");
require_once("classes/Task.php");

foreach (SubjectData::getAll() as $subject) {
    foreach ($subject->getTopics() as $topic) {
        $topic->save();
    }
    $subject->save();
}