public static function migrate() { $migrationManager = new Manager(); $migrationManager->setLog(new Log('colored-stdout')); $migrationManager->add(Host::table()->migration()); $migrationManager->add(Tag::table()->migration()); $migrationManager->add(Result::table()->migration()); $migrationManager->add(Suite::table()->migration()); $migrationManager->add(ResultTag::table()->migration()); $migrationManager->add(Session::table()->migration()); $migrationManager->add(Series::table()->migration()); $migrationManager->add(SeriesTag::table()->migration()); $migrationManager->run(); }
public static function session() { $layout = new Layout(); $id = $_GET['id']; if (!$id) { return self::notFound(); } /** @var Session $session */ $session = Session::find($id); if (!$session) { return self::notFound(); } /** @var Tag[] $tags */ $tags = Series::find()->select(Tag::columns())->leftJoin('? ON ? = ?', SeriesTag::table(), SeriesTag::columns()->seriesId, Series::columns()->id)->leftJoin('? ON ? = ?', Tag::table(), Tag::columns()->id, SeriesTag::columns()->tagId)->where('? = ?', Series::columns()->sessionId, $session->id)->groupBy(Tag::columns()->id)->bindResultClass(Tag::className())->query()->fetchAll(); $layout->setList(new TagsFilter($tags)); $layout->render(); return true; }