/** * @return Option - from Category 'gender' assigned to user. */ public function getGender() { return $this->hasOne(Option::className(), ['id' => 'genderId']); }
/** * @return array - list of Option having all the options belonging to this category */ public function getOptions() { return $this->hasMany(Option::className(), ['categoryId' => 'id']); }