Skip to content

Possible redesign of the EntityTermsProvider interface #347

Description

@thiemowmde

This is an alternative proposal to #301.
#343 is a first step towards this.

  • The idea is to refactor the EntityTerms class in a way that it represents 1 label, 1 description and 1 set of aliases that all have the same (base a.k.a. requested) language. Note that everything in that class should be represented as Term objects to support language fallbacks.
  • AliasGroup will either be dropped in favor of EntityTerms or refactored to contain a list of Term objects, not a list of strings (this is a bit unrelated to this proposal, see Add requirements for language fall backs. #272 (comment) for the reasoning).
  • The EntityTermsProvider interface will have a single method, getEntityTermsForLanguage( $languageCode ).
  • TermList and AliasGroupList will be dropped.

This proposal will drop the possibility to get a list of all labels in all languages. This is on purpose since I think this use case is not relevant. If it turns out to be relevant we can add EntityTermsProvider::getEntityTerms, which returns an associative array of language code => EntityTerms objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions