CatalogueMetadataAwareInterface.php 1.4 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. * 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. public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages');
  32. /**
  33. * Deletes catalogue metadata for the given key and domain.
  34. *
  35. * Passing an empty domain will delete all catalogue metadata. Passing an empty key will
  36. * delete all metadata for the given domain.
  37. */
  38. public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages');
  39. }