platform/api/symfony/Component/Validator/Mapping/ClassMetadata.yaml

294 lines
10 KiB
YAML
Raw Normal View History

2024-09-02 17:44:11 +00:00
name: ClassMetadata
class_comment: '# * Default implementation of {@link ClassMetadataInterface}.
# *
# * This class supports serialization and cloning.
# *
# * @author Bernhard Schussek <bschussek@gmail.com>
# * @author Fabien Potencier <fabien@symfony.com>'
dependencies:
- name: Constraint
type: class
source: Symfony\Component\Validator\Constraint
- name: Cascade
type: class
source: Symfony\Component\Validator\Constraints\Cascade
- name: Composite
type: class
source: Symfony\Component\Validator\Constraints\Composite
- name: GroupSequence
type: class
source: Symfony\Component\Validator\Constraints\GroupSequence
- name: Traverse
type: class
source: Symfony\Component\Validator\Constraints\Traverse
- name: Valid
type: class
source: Symfony\Component\Validator\Constraints\Valid
- name: ConstraintDefinitionException
type: class
source: Symfony\Component\Validator\Exception\ConstraintDefinitionException
- name: GroupDefinitionException
type: class
source: Symfony\Component\Validator\Exception\GroupDefinitionException
- name: GroupSequenceProviderInterface
type: class
source: Symfony\Component\Validator\GroupSequenceProviderInterface
properties: []
methods:
- name: getDefaultGroup
visibility: public
parameters: []
comment: "# * Default implementation of {@link ClassMetadataInterface}.\n# *\n#\
\ * This class supports serialization and cloning.\n# *\n# * @author Bernhard\
\ Schussek <bschussek@gmail.com>\n# * @author Fabien Potencier <fabien@symfony.com>\n\
# */\n# class ClassMetadata extends GenericMetadata implements ClassMetadataInterface\n\
# {\n# /**\n# * @internal This property is public in order to reduce the size\
\ of the\n# * class' serialized representation. Do not access it. Use\n\
# * {@link getClassName()} instead.\n# */\n# public string $name;\n\
# \n# /**\n# * @internal This property is public in order to reduce the size of\
\ the\n# * class' serialized representation. Do not access it. Use\n\
# * {@link getDefaultGroup()} instead.\n# */\n# public string $defaultGroup;\n\
# \n# /**\n# * @var MemberMetadata[][]\n# *\n# * @internal This property is public\
\ in order to reduce the size of the\n# * class' serialized representation.\
\ Do not access it. Use\n# * {@link getPropertyMetadata()} instead.\n\
# */\n# public array $members = [];\n# \n# /**\n# * @var PropertyMetadata[]\n\
# *\n# * @internal This property is public in order to reduce the size of the\n\
# * class' serialized representation. Do not access it. Use\n# * \
\ {@link getPropertyMetadata()} instead.\n# */\n# public array $properties\
\ = [];\n# \n# /**\n# * @var GetterMetadata[]\n# *\n# * @internal This property\
\ is public in order to reduce the size of the\n# * class' serialized\
\ representation. Do not access it. Use\n# * {@link getPropertyMetadata()}\
\ instead.\n# */\n# public array $getters = [];\n# \n# /**\n# * @internal This\
\ property is public in order to reduce the size of the\n# * class'\
\ serialized representation. Do not access it. Use\n# * {@link getGroupSequence()}\
\ instead.\n# */\n# public ?GroupSequence $groupSequence = null;\n# \n# /**\n\
# * @internal This property is public in order to reduce the size of the\n# *\
\ class' serialized representation. Do not access it. Use\n# * \
\ {@link isGroupSequenceProvider()} instead.\n# */\n# public bool $groupSequenceProvider\
\ = false;\n# \n# /**\n# * @internal This property is public in order to reduce\
\ the size of the\n# * class' serialized representation. Do not access\
\ it. Use\n# * {@link getGroupProvider()} instead.\n# */\n# public ?string\
\ $groupProvider = null;\n# \n# /**\n# * The strategy for traversing traversable\
\ objects.\n# *\n# * By default, only instances of {@link \\Traversable} are traversed.\n\
# *\n# * @var TraversalStrategy::*\n# *\n# * @internal This property is public\
\ in order to reduce the size of the\n# * class' serialized representation.\
\ Do not access it. Use\n# * {@link getTraversalStrategy()} instead.\n\
# */\n# public int $traversalStrategy = TraversalStrategy::IMPLICIT;\n# \n# private\
\ \\ReflectionClass $reflClass;\n# \n# public function __construct(string $class)\n\
# {\n# $this->name = $class;\n# // class name without namespace\n# if (false !==\
\ $nsSep = strrpos($class, '\\\\')) {\n# $this->defaultGroup = substr($class,\
\ $nsSep + 1);\n# } else {\n# $this->defaultGroup = $class;\n# }\n# }\n# \n# public\
\ function __sleep(): array\n# {\n# $parentProperties = parent::__sleep();\n#\
\ \n# // Don't store the cascading strategy. Classes never cascade.\n# unset($parentProperties[array_search('cascadingStrategy',\
\ $parentProperties)]);\n# \n# return array_merge($parentProperties, [\n# 'getters',\n\
# 'groupSequence',\n# 'groupSequenceProvider',\n# 'groupProvider',\n# 'members',\n\
# 'name',\n# 'properties',\n# 'defaultGroup',\n# ]);\n# }\n# \n# public function\
\ getClassName(): string\n# {\n# return $this->name;\n# }\n# \n# /**\n# * Returns\
\ the name of the default group for this class.\n# *\n# * For each class, the\
\ group \"Default\" is an alias for the group\n# * \"<ClassName>\", where <ClassName>\
\ is the non-namespaced name of the\n# * class. All constraints implicitly or\
\ explicitly assigned to group\n# * \"Default\" belong to both of these groups,\
\ unless the class defines\n# * a group sequence.\n# *\n# * If a class defines\
\ a group sequence, validating the class in \"Default\"\n# * will validate the\
\ group sequence. The constraints assigned to \"Default\"\n# * can still be validated\
\ by validating the class in \"<ClassName>\"."
- name: addConstraint
visibility: public
parameters:
- name: constraint
comment: '# * If the constraint {@link Cascade} is added, the cascading strategy
will be
# * changed to {@link CascadingStrategy::CASCADE}.
# *
# * If the constraint {@link Traverse} is added, the traversal strategy will be
# * changed. Depending on the $traverse property of that constraint,
# * the traversal strategy will be set to one of the following:
# *
# * - {@link TraversalStrategy::IMPLICIT} by default
# * - {@link TraversalStrategy::NONE} if $traverse is disabled
# * - {@link TraversalStrategy::TRAVERSE} if $traverse is enabled'
- name: addPropertyConstraint
visibility: public
parameters:
- name: property
- name: constraint
comment: '# * Adds a constraint to the given property.
# *
# * @return $this'
- name: addPropertyConstraints
visibility: public
parameters:
- name: property
- name: constraints
comment: '# * @param Constraint[] $constraints
# *
# * @return $this'
- name: addGetterConstraint
visibility: public
parameters:
- name: property
- name: constraint
comment: '# * Adds a constraint to the getter of the given property.
# *
# * The name of the getter is assumed to be the name of the property with an
# * uppercased first letter and the prefix "get", "is" or "has".
# *
# * @return $this'
- name: addGetterMethodConstraint
visibility: public
parameters:
- name: property
- name: method
- name: constraint
comment: '# * Adds a constraint to the getter of the given property.
# *
# * @return $this'
- name: addGetterConstraints
visibility: public
parameters:
- name: property
- name: constraints
comment: '# * @param Constraint[] $constraints
# *
# * @return $this'
- name: addGetterMethodConstraints
visibility: public
parameters:
- name: property
- name: method
- name: constraints
comment: '# * @param Constraint[] $constraints
# *
# * @return $this'
- name: mergeConstraints
visibility: public
parameters:
- name: source
comment: '# * Merges the constraints of the given metadata into this object.'
- name: hasPropertyMetadata
visibility: public
parameters:
- name: property
comment: null
- name: getPropertyMetadata
visibility: public
parameters:
- name: property
comment: null
- name: getConstrainedProperties
visibility: public
parameters: []
comment: null
- name: setGroupSequence
visibility: public
parameters:
- name: groupSequence
comment: '# * Sets the default group sequence for this class.
# *
# * @param string[]|GroupSequence $groupSequence An array of group names
# *
# * @return $this
# *
# * @throws GroupDefinitionException'
- name: hasGroupSequence
visibility: public
parameters: []
comment: null
- name: getGroupSequence
visibility: public
parameters: []
comment: null
- name: getReflectionClass
visibility: public
parameters: []
comment: '# * Returns a ReflectionClass instance for this class.'
- name: setGroupSequenceProvider
visibility: public
parameters:
- name: active
comment: '# * Sets whether a group sequence provider should be used.
# *
# * @throws GroupDefinitionException'
- name: isGroupSequenceProvider
visibility: public
parameters: []
comment: null
- name: setGroupProvider
visibility: public
parameters:
- name: provider
comment: null
- name: getGroupProvider
visibility: public
parameters: []
comment: null
- name: getCascadingStrategy
visibility: public
parameters: []
comment: null
- name: addPropertyMetadata
visibility: private
parameters:
- name: metadata
comment: null
- name: checkConstraint
visibility: private
parameters:
- name: constraint
comment: null
- name: canCascade
visibility: private
parameters:
- name: type
default: 'null'
comment: null
traits:
- Symfony\Component\Validator\Constraint
- Symfony\Component\Validator\Constraints\Cascade
- Symfony\Component\Validator\Constraints\Composite
- Symfony\Component\Validator\Constraints\GroupSequence
- Symfony\Component\Validator\Constraints\Traverse
- Symfony\Component\Validator\Constraints\Valid
- Symfony\Component\Validator\Exception\ConstraintDefinitionException
- Symfony\Component\Validator\Exception\GroupDefinitionException
- Symfony\Component\Validator\GroupSequenceProviderInterface
interfaces:
- ClassMetadataInterface