コード例 #1
0
ファイル: User.php プロジェクト: cmsgears/module-core
 /**
  * @return Option - from Category 'gender' assigned to user.
  */
 public function getGender()
 {
     return $this->hasOne(Option::className(), ['id' => 'genderId']);
 }
コード例 #2
0
ファイル: Category.php プロジェクト: cmsgears/module-core
 /**
  * @return array - list of Option having all the options belonging to this category
  */
 public function getOptions()
 {
     return $this->hasMany(Option::className(), ['categoryId' => 'id']);
 }