MetadataAwareInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Translation;
  11. /**
  12. * MetadataAwareInterface.
  13. *
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. interface MetadataAwareInterface
  17. {
  18. /**
  19. * Gets metadata for the given domain and key.
  20. *
  21. * Passing an empty domain will return an array with all metadata indexed by
  22. * domain and then by key. Passing an empty key will return an array with all
  23. * metadata for the given domain.
  24. *
  25. * @return mixed The value that was set or an array with the domains/keys or null
  26. */
  27. public function getMetadata(string $key = '', string $domain = 'messages');
  28. /**
  29. * Adds metadata to a message domain.
  30. *
  31. * @param mixed $value
  32. */
  33. public function setMetadata(string $key, $value, string $domain = 'messages');
  34. /**
  35. * Deletes metadata for the given key and domain.
  36. *
  37. * Passing an empty domain will delete all metadata. Passing an empty key will
  38. * delete all metadata for the given domain.
  39. */
  40. public function deleteMetadata(string $key = '', string $domain = 'messages');
  41. }