/** * Setup column types in provided columns object * @param $columns static|\stdClass */ static function setUpColumns($columns) { $columns->resultId = Result::columns()->id; $columns->tagId = Tag::columns()->id; //$columns->resultId = Column::INTEGER + Column::NOT_NULL; //$columns->tagId = Column::INTEGER + Column::NOT_NULL; }
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; }
/** * Required setup column types in provided columns object * @param $columns static|\stdClass */ static function setUpColumns($columns) { $columns->seriesId = Series::columns()->id; $columns->tagId = Tag::columns()->id; }