/** * @return \yii\db\ActiveQuery */ public function getTemplate() { return $this->hasOne(PageTemplate::className(), ['id' => 'template_id'])->where(['active' => 1]); }
/** * Returns an array of page templates * * @return PageTemplate[] */ protected function getTemplates() { return PageTemplate::find()->orderBy(['name' => SORT_ASC])->all(); }