| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <[email protected]> |
| 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\Serializer\Mapping; |
| 13 | |
| 14 | /** |
| 15 | * Stores metadata needed for serializing and deserializing objects of specific class. |
| 16 | * |
| 17 | * Primarily, the metadata stores the set of attributes to serialize or deserialize. |
| 18 | * |
| 19 | * There may only exist one metadata for each attribute according to its name. |
| 20 | * |
| 21 | * @psalm-inheritors ClassMetadata |
| 22 | * |
| 23 | * @author Kévin Dunglas <[email protected]> |
| 24 | */ |
| 25 | interface ClassMetadataInterface |
| 26 | { |
| 27 | /** |
| 28 | * Returns the name of the backing PHP class. |
| 29 | */ |
| 30 | public function getName(): string; |
| 31 | |
| 32 | /** |
| 33 | * Adds an {@link AttributeMetadataInterface}. |
| 34 | */ |
| 35 | public function addAttributeMetadata(AttributeMetadataInterface $attributeMetadata): void; |
| 36 | |
| 37 | /** |
| 38 | * Gets the list of {@link AttributeMetadataInterface}. |
| 39 | * |
| 40 | * @return array<string, AttributeMetadataInterface> |
| 41 | */ |
| 42 | public function getAttributesMetadata(): array; |
| 43 | |
| 44 | /** |
| 45 | * Merges a {@link ClassMetadataInterface} in the current one. |
| 46 | */ |
| 47 | public function merge(self $classMetadata): void; |
| 48 | |
| 49 | /** |
| 50 | * Returns a {@link \ReflectionClass} instance for this class. |
| 51 | */ |
| 52 | public function getReflectionClass(): \ReflectionClass; |
| 53 | |
| 54 | public function getClassDiscriminatorMapping(): ?ClassDiscriminatorMapping; |
| 55 | |
| 56 | public function setClassDiscriminatorMapping(?ClassDiscriminatorMapping $mapping): void; |
| 57 | } |