/** * @return Role - from the mapping. */ public function getRole() { return $this->hasOne(Role::className(), ['id' => 'roleId']); }
/** * @return Role array */ public function getRoles() { return $this->hasMany(Role::className(), ['id' => 'roleId'])->viaTable(CoreTables::TABLE_ROLE_PERMISSION, ['permissionId' => 'id']); }