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