CatalogueMetadataAwareInterface.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. * This interface is used to get, set, and delete metadata about the Catalogue.
  13. *
  14. * @author Hugo Alliaume <hugo@alliau.me>
  15. */
  16. interface CatalogueMetadataAwareInterface
  17. {
  18. /**
  19. * Gets catalogue metadata for the given domain and key.
  20. *
  21. * Passing an empty domain will return an array with all catalogue metadata indexed by
  22. * domain and then by key. Passing an empty key will return an array with all
  23. * catalogue 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 getCatalogueMetadata(string $key = '', string $domain = 'messages'): mixed;
  28. /**
  29. * Adds catalogue metadata to a message domain.
  30. *
  31. * @return void
  32. */
  33. public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages');
  34. /**
  35. * Deletes catalogue metadata for the given key and domain.
  36. *
  37. * Passing an empty domain will delete all catalogue metadata. Passing an empty key will
  38. * delete all metadata for the given domain.
  39. *
  40. * @return void
  41. */
  42. public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages');
  43. }