/** * @return \yii\db\ActiveQuery */ public function getCategory() { return $this->hasOne(Category::className(), ['id' => 'category_id']); }
/** * @param string action * @param mixed $constrain * @return array */ public static function getCategories($constrain = null) { $ret_val = []; $where = is_array($constrain) ? $constrain : ['type_id' => 1]; return Category::find()->where($where)->orderBy('slug'); }
public function requestFor() { return \nitm\helpers\Relations::getRelatedRecord('requestFor', $this, CategoryModel::className()); }