コード例 #1
0
 /**
  * @return Role - from the mapping.
  */
 public function getRole()
 {
     return $this->hasOne(Role::className(), ['id' => 'roleId']);
 }
コード例 #2
0
ファイル: Permission.php プロジェクト: cmsgears/module-core
 /**
  * @return Role array
  */
 public function getRoles()
 {
     return $this->hasMany(Role::className(), ['id' => 'roleId'])->viaTable(CoreTables::TABLE_ROLE_PERMISSION, ['permissionId' => 'id']);
 }