Debian Codegraph @

lib/3rdParty/composer/symfony/serializer/Mapping/AttributeMetadataInterface.php

raw symbols SCIP
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 use Symfony\Component\PropertyAccess\PropertyPath;
15
16 /**
17 * Stores metadata needed for serializing and deserializing attributes.
18 *
19 * Primarily, the metadata stores serialization groups.
20 *
21 * @psalm-inheritors AttributeMetadata
22 *
23 * @author Kévin Dunglas <[email protected]>
24 */
25 interface AttributeMetadataInterface
26 {
27 /**
28 * Gets the attribute name.
29 */
30 public function getName(): string;
31
32 /**
33 * Adds this attribute to the given group.
34 */
35 public function addGroup(string $group): void;
36
37 /**
38 * Gets groups of this attribute.
39 *
40 * @return string[]
41 */
42 public function getGroups(): array;
43
44 /**
45 * Sets the serialization max depth for this attribute.
46 */
47 public function setMaxDepth(?int $maxDepth): void;
48
49 /**
50 * Gets the serialization max depth for this attribute.
51 */
52 public function getMaxDepth(): ?int;
53
54 /**
55 * Sets the serialization name for this attribute.
56 */
57 public function setSerializedName(?string $serializedName): void;
58
59 /**
60 * Gets the serialization name for this attribute.
61 */
62 public function getSerializedName(): ?string;
63
64 public function setSerializedPath(?PropertyPath $serializedPath): void;
65
66 public function getSerializedPath(): ?PropertyPath;
67
68 /**
69 * Sets if this attribute must be ignored or not.
70 */
71 public function setIgnore(bool $ignore): void;
72
73 /**
74 * Gets if this attribute is ignored or not.
75 */
76 public function isIgnored(): bool;
77
78 /**
79 * Merges an {@see AttributeMetadataInterface} with in the current one.
80 */
81 public function merge(self $attributeMetadata): void;
82
83 /**
84 * Gets all the normalization contexts per group ("*" being the base context applied to all groups).
85 */
86 public function getNormalizationContexts(): array;
87
88 /**
89 * Gets the computed normalization contexts for given groups.
90 */
91 public function getNormalizationContextForGroups(array $groups): array;
92
93 /**
94 * Sets the normalization context for given groups.
95 */
96 public function setNormalizationContextForGroups(array $context, array $groups = []): void;
97
98 /**
99 * Gets all the denormalization contexts per group ("*" being the base context applied to all groups).
100 */
101 public function getDenormalizationContexts(): array;
102
103 /**
104 * Gets the computed denormalization contexts for given groups.
105 */
106 public function getDenormalizationContextForGroups(array $groups): array;
107
108 /**
109 * Sets the denormalization context for given groups.
110 */
111 public function setDenormalizationContextForGroups(array $context, array $groups = []): void;
112 }