AttributeMetadataInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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\Serializer\Mapping;
  11. /**
  12. * Stores metadata needed for serializing and deserializing attributes.
  13. *
  14. * Primarily, the metadata stores serialization groups.
  15. *
  16. * @internal
  17. *
  18. * @author Kévin Dunglas <dunglas@gmail.com>
  19. */
  20. interface AttributeMetadataInterface
  21. {
  22. /**
  23. * Gets the attribute name.
  24. *
  25. * @return string
  26. */
  27. public function getName();
  28. /**
  29. * Adds this attribute to the given group.
  30. *
  31. * @param string $group
  32. */
  33. public function addGroup($group);
  34. /**
  35. * Gets groups of this attribute.
  36. *
  37. * @return string[]
  38. */
  39. public function getGroups();
  40. /**
  41. * Merges an {@see AttributeMetadataInterface} with in the current one.
  42. *
  43. * @param AttributeMetadataInterface $attributeMetadata
  44. */
  45. public function merge(AttributeMetadataInterface $attributeMetadata);
  46. }