Version 1
[yaffs-website] / vendor / symfony / validator / Mapping / ClassMetadataInterface.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Validator\Mapping;
13
14 use Symfony\Component\Validator\ClassBasedInterface;
15 use Symfony\Component\Validator\PropertyMetadataContainerInterface as LegacyPropertyMetadataContainerInterface;
16
17 /**
18  * Stores all metadata needed for validating objects of specific class.
19  *
20  * Most importantly, the metadata stores the constraints against which an object
21  * and its properties should be validated.
22  *
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.
26  *
27  * @author Bernhard Schussek <bschussek@gmail.com>
28  *
29  * @see MetadataInterface
30  * @see \Symfony\Component\Validator\Constraints\GroupSequence
31  * @see \Symfony\Component\Validator\GroupSequenceProviderInterface
32  * @see TraversalStrategy
33  */
34 interface ClassMetadataInterface extends MetadataInterface, LegacyPropertyMetadataContainerInterface, ClassBasedInterface
35 {
36     /**
37      * Returns the names of all constrained properties.
38      *
39      * @return string[] A list of property names
40      */
41     public function getConstrainedProperties();
42
43     /**
44      * Returns whether the "Default" group is overridden by a group sequence.
45      *
46      * If it is, you can access the group sequence with {@link getGroupSequence()}.
47      *
48      * @return bool Returns true if the "Default" group is overridden
49      *
50      * @see \Symfony\Component\Validator\Constraints\GroupSequence
51      */
52     public function hasGroupSequence();
53
54     /**
55      * Returns the group sequence that overrides the "Default" group for this
56      * class.
57      *
58      * @return \Symfony\Component\Validator\Constraints\GroupSequence|null The group sequence or null
59      *
60      * @see \Symfony\Component\Validator\Constraints\GroupSequence
61      */
62     public function getGroupSequence();
63
64     /**
65      * Returns whether the "Default" group is overridden by a dynamic group
66      * sequence obtained by the validated objects.
67      *
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.
72      *
73      * @return bool Returns true if the "Default" group is overridden by
74      *              a dynamic group sequence
75      *
76      * @see \Symfony\Component\Validator\GroupSequenceProviderInterface
77      */
78     public function isGroupSequenceProvider();
79 }