MetadataAwareInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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'): mixed;
  28. /**
  29. * Adds metadata to a message domain.
  30. */
  31. public function setMetadata(string $key, mixed $value, string $domain = 'messages');
  32. /**
  33. * Deletes metadata for the given key and domain.
  34. *
  35. * Passing an empty domain will delete all metadata. Passing an empty key will
  36. * delete all metadata for the given domain.
  37. */
  38. public function deleteMetadata(string $key = '', string $domain = 'messages');
  39. }