You are here

public function MessageCatalogue::getMetadata in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/MessageCatalogue.php \Symfony\Component\Translation\MessageCatalogue::getMetadata()

Gets metadata for the given domain and key.

Passing an empty domain will return an array with all metadata indexed by domain and then by key. Passing an empty key will return an array with all metadata for the given domain.

Parameters

string $key The key:

string $domain The domain name:

Return value

mixed The value that was set or an array with the domains/keys or null

Overrides MetadataAwareInterface::getMetadata

File

vendor/symfony/translation/MessageCatalogue.php, line 218

Class

MessageCatalogue
MessageCatalogue.

Namespace

Symfony\Component\Translation

Code

public function getMetadata($key = '', $domain = 'messages') {
  if ('' == $domain) {
    return $this->metadata;
  }
  if (isset($this->metadata[$domain])) {
    if ('' == $key) {
      return $this->metadata[$domain];
    }
    if (isset($this->metadata[$domain][$key])) {
      return $this->metadata[$domain][$key];
    }
  }
}