4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Validator\Mapping;
14 use Symfony\Component\Validator\ClassBasedInterface;
15 use Symfony\Component\Validator\PropertyMetadataContainerInterface as LegacyPropertyMetadataContainerInterface;
18 * Stores all metadata needed for validating objects of specific class.
20 * Most importantly, the metadata stores the constraints against which an object
21 * and its properties should be validated.
23 * Additionally, the metadata stores whether the "Default" group is overridden
24 * by a group sequence for that class and whether instances of that class
25 * should be traversed or not.
27 * @author Bernhard Schussek <bschussek@gmail.com>
29 * @see MetadataInterface
30 * @see \Symfony\Component\Validator\Constraints\GroupSequence
31 * @see \Symfony\Component\Validator\GroupSequenceProviderInterface
32 * @see TraversalStrategy
34 interface ClassMetadataInterface extends MetadataInterface, LegacyPropertyMetadataContainerInterface, ClassBasedInterface
37 * Returns the names of all constrained properties.
39 * @return string[] A list of property names
41 public function getConstrainedProperties();
44 * Returns whether the "Default" group is overridden by a group sequence.
46 * If it is, you can access the group sequence with {@link getGroupSequence()}.
48 * @return bool Returns true if the "Default" group is overridden
50 * @see \Symfony\Component\Validator\Constraints\GroupSequence
52 public function hasGroupSequence();
55 * Returns the group sequence that overrides the "Default" group for this
58 * @return \Symfony\Component\Validator\Constraints\GroupSequence|null The group sequence or null
60 * @see \Symfony\Component\Validator\Constraints\GroupSequence
62 public function getGroupSequence();
65 * Returns whether the "Default" group is overridden by a dynamic group
66 * sequence obtained by the validated objects.
68 * If this method returns true, the class must implement
69 * {@link \Symfony\Component\Validator\GroupSequenceProviderInterface}.
70 * This interface will be used to obtain the group sequence when an object
71 * of this class is validated.
73 * @return bool Returns true if the "Default" group is overridden by
74 * a dynamic group sequence
76 * @see \Symfony\Component\Validator\GroupSequenceProviderInterface
78 public function isGroupSequenceProvider();