Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Validator\Mapping; Chris@0: Chris@0: /** Chris@0: * Stores all metadata needed for validating objects of specific class. Chris@0: * Chris@0: * Most importantly, the metadata stores the constraints against which an object Chris@0: * and its properties should be validated. Chris@0: * Chris@0: * Additionally, the metadata stores whether the "Default" group is overridden Chris@0: * by a group sequence for that class and whether instances of that class Chris@0: * should be traversed or not. Chris@0: * Chris@0: * @author Bernhard Schussek Chris@0: * Chris@0: * @see MetadataInterface Chris@0: * @see \Symfony\Component\Validator\Constraints\GroupSequence Chris@0: * @see \Symfony\Component\Validator\GroupSequenceProviderInterface Chris@0: * @see TraversalStrategy Chris@0: */ Chris@0: interface ClassMetadataInterface extends MetadataInterface Chris@0: { Chris@0: /** Chris@0: * Returns the names of all constrained properties. Chris@0: * Chris@0: * @return string[] A list of property names Chris@0: */ Chris@0: public function getConstrainedProperties(); Chris@0: Chris@0: /** Chris@0: * Returns whether the "Default" group is overridden by a group sequence. Chris@0: * Chris@0: * If it is, you can access the group sequence with {@link getGroupSequence()}. Chris@0: * Chris@0: * @return bool Returns true if the "Default" group is overridden Chris@0: * Chris@0: * @see \Symfony\Component\Validator\Constraints\GroupSequence Chris@0: */ Chris@0: public function hasGroupSequence(); Chris@0: Chris@0: /** Chris@0: * Returns the group sequence that overrides the "Default" group for this Chris@0: * class. Chris@0: * Chris@0: * @return \Symfony\Component\Validator\Constraints\GroupSequence|null The group sequence or null Chris@0: * Chris@0: * @see \Symfony\Component\Validator\Constraints\GroupSequence Chris@0: */ Chris@0: public function getGroupSequence(); Chris@0: Chris@0: /** Chris@0: * Returns whether the "Default" group is overridden by a dynamic group Chris@0: * sequence obtained by the validated objects. Chris@0: * Chris@0: * If this method returns true, the class must implement Chris@0: * {@link \Symfony\Component\Validator\GroupSequenceProviderInterface}. Chris@0: * This interface will be used to obtain the group sequence when an object Chris@0: * of this class is validated. Chris@0: * Chris@0: * @return bool Returns true if the "Default" group is overridden by Chris@0: * a dynamic group sequence Chris@0: * Chris@0: * @see \Symfony\Component\Validator\GroupSequenceProviderInterface Chris@0: */ Chris@0: public function isGroupSequenceProvider(); Chris@0: Chris@0: /** Chris@0: * Check if there's any metadata attached to the given named property. Chris@0: * Chris@0: * @param string $property The property name Chris@0: * Chris@0: * @return bool Chris@0: */ Chris@0: public function hasPropertyMetadata($property); Chris@0: Chris@0: /** Chris@0: * Returns all metadata instances for the given named property. Chris@0: * Chris@18: * If your implementation does not support properties, throw an exception Chris@18: * in this method (for example a BadMethodCallException). Chris@0: * Chris@0: * @param string $property The property name Chris@0: * Chris@0: * @return PropertyMetadataInterface[] A list of metadata instances. Empty if Chris@0: * no metadata exists for the property. Chris@0: */ Chris@0: public function getPropertyMetadata($property); Chris@0: Chris@0: /** Chris@0: * Returns the name of the backing PHP class. Chris@0: * Chris@0: * @return string The name of the backing class Chris@0: */ Chris@0: public function getClassName(); Chris@0: }