You are here

public function MessageCatalogue::getMetadata in Plug 7

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

lib/Symfony/translation/MessageCatalogue.php, line 241

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];
    }
  }
}