class AttributeMetadata in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/serializer/Mapping/AttributeMetadata.php \Symfony\Component\Serializer\Mapping\AttributeMetadata
@author Kévin Dunglas <dunglas@gmail.com>
Hierarchy
- class \Symfony\Component\Serializer\Mapping\AttributeMetadata implements AttributeMetadataInterface
Expanded class hierarchy of AttributeMetadata
5 files declare their use of AttributeMetadata
- AnnotationLoader.php in vendor/
symfony/ serializer/ Mapping/ Loader/ AnnotationLoader.php - AttributeMetadataTest.php in vendor/
symfony/ serializer/ Tests/ Mapping/ AttributeMetadataTest.php - TestClassMetadataFactory.php in vendor/
symfony/ serializer/ Tests/ Mapping/ TestClassMetadataFactory.php - XmlFileLoader.php in vendor/
symfony/ serializer/ Mapping/ Loader/ XmlFileLoader.php - YamlFileLoader.php in vendor/
symfony/ serializer/ Mapping/ Loader/ YamlFileLoader.php
File
- vendor/
symfony/ serializer/ Mapping/ AttributeMetadata.php, line 19
Namespace
Symfony\Component\Serializer\MappingView source
class AttributeMetadata implements AttributeMetadataInterface {
/**
* @var string
*
* @internal This property is public in order to reduce the size of the
* class' serialized representation. Do not access it. Use
* {@link getName()} instead.
*/
public $name;
/**
* @var array
*
* @internal This property is public in order to reduce the size of the
* class' serialized representation. Do not access it. Use
* {@link getGroups()} instead.
*/
public $groups = array();
/**
* Constructs a metadata for the given attribute.
*
* @param string $name
*/
public function __construct($name) {
$this->name = $name;
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this->name;
}
/**
* {@inheritdoc}
*/
public function addGroup($group) {
if (!in_array($group, $this->groups)) {
$this->groups[] = $group;
}
}
/**
* {@inheritdoc}
*/
public function getGroups() {
return $this->groups;
}
/**
* {@inheritdoc}
*/
public function merge(AttributeMetadataInterface $attributeMetadata) {
foreach ($attributeMetadata
->getGroups() as $group) {
$this
->addGroup($group);
}
}
/**
* Returns the names of the properties that should be serialized.
*
* @return string[]
*/
public function __sleep() {
return array(
'name',
'groups',
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AttributeMetadata:: |
public | property | @internal This property is public in order to reduce the size of the class' serialized representation. Do not access it. Use {@link getGroups()} instead. | |
AttributeMetadata:: |
public | property | @internal This property is public in order to reduce the size of the class' serialized representation. Do not access it. Use {@link getName()} instead. | |
AttributeMetadata:: |
public | function |
Adds this attribute to the given group. Overrides AttributeMetadataInterface:: |
|
AttributeMetadata:: |
public | function |
Gets groups of this attribute. Overrides AttributeMetadataInterface:: |
|
AttributeMetadata:: |
public | function |
Gets the attribute name. Overrides AttributeMetadataInterface:: |
|
AttributeMetadata:: |
public | function |
Merges an { Overrides AttributeMetadataInterface:: |
|
AttributeMetadata:: |
public | function | Constructs a metadata for the given attribute. | |
AttributeMetadata:: |
public | function | Returns the names of the properties that should be serialized. |