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;
15 * Stores all metadata needed for validating objects of specific class.
17 * Most importantly, the metadata stores the constraints against which an object
18 * and its properties should be validated.
20 * Additionally, the metadata stores whether the "Default" group is overridden
21 * by a group sequence for that class and whether instances of that class
22 * should be traversed or not.
24 * @author Bernhard Schussek <bschussek@gmail.com>
26 * @see MetadataInterface
27 * @see \Symfony\Component\Validator\Constraints\GroupSequence
28 * @see \Symfony\Component\Validator\GroupSequenceProviderInterface
29 * @see TraversalStrategy
31 interface ClassMetadataInterface extends MetadataInterface
34 * Returns the names of all constrained properties.
36 * @return string[] A list of property names
38 public function getConstrainedProperties();
41 * Returns whether the "Default" group is overridden by a group sequence.
43 * If it is, you can access the group sequence with {@link getGroupSequence()}.
45 * @return bool Returns true if the "Default" group is overridden
47 * @see \Symfony\Component\Validator\Constraints\GroupSequence
49 public function hasGroupSequence();
52 * Returns the group sequence that overrides the "Default" group for this
55 * @return \Symfony\Component\Validator\Constraints\GroupSequence|null The group sequence or null
57 * @see \Symfony\Component\Validator\Constraints\GroupSequence
59 public function getGroupSequence();
62 * Returns whether the "Default" group is overridden by a dynamic group
63 * sequence obtained by the validated objects.
65 * If this method returns true, the class must implement
66 * {@link \Symfony\Component\Validator\GroupSequenceProviderInterface}.
67 * This interface will be used to obtain the group sequence when an object
68 * of this class is validated.
70 * @return bool Returns true if the "Default" group is overridden by
71 * a dynamic group sequence
73 * @see \Symfony\Component\Validator\GroupSequenceProviderInterface
75 public function isGroupSequenceProvider();
78 * Check if there's any metadata attached to the given named property.
80 * @param string $property The property name
84 public function hasPropertyMetadata($property);
87 * Returns all metadata instances for the given named property.
89 * If your implementation does not support properties, simply throw an
90 * exception in this method (for example a <tt>BadMethodCallException</tt>).
92 * @param string $property The property name
94 * @return PropertyMetadataInterface[] A list of metadata instances. Empty if
95 * no metadata exists for the property.
97 public function getPropertyMetadata($property);
100 * Returns the name of the backing PHP class.
102 * @return string The name of the backing class
104 public function getClassName();