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