Security update for Core, with self-updated composer
[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 /**
15  * Stores all metadata needed for validating objects of specific class.
16  *
17  * Most importantly, the metadata stores the constraints against which an object
18  * and its properties should be validated.
19  *
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.
23  *
24  * @author Bernhard Schussek <bschussek@gmail.com>
25  *
26  * @see MetadataInterface
27  * @see \Symfony\Component\Validator\Constraints\GroupSequence
28  * @see \Symfony\Component\Validator\GroupSequenceProviderInterface
29  * @see TraversalStrategy
30  */
31 interface ClassMetadataInterface extends MetadataInterface
32 {
33     /**
34      * Returns the names of all constrained properties.
35      *
36      * @return string[] A list of property names
37      */
38     public function getConstrainedProperties();
39
40     /**
41      * Returns whether the "Default" group is overridden by a group sequence.
42      *
43      * If it is, you can access the group sequence with {@link getGroupSequence()}.
44      *
45      * @return bool Returns true if the "Default" group is overridden
46      *
47      * @see \Symfony\Component\Validator\Constraints\GroupSequence
48      */
49     public function hasGroupSequence();
50
51     /**
52      * Returns the group sequence that overrides the "Default" group for this
53      * class.
54      *
55      * @return \Symfony\Component\Validator\Constraints\GroupSequence|null The group sequence or null
56      *
57      * @see \Symfony\Component\Validator\Constraints\GroupSequence
58      */
59     public function getGroupSequence();
60
61     /**
62      * Returns whether the "Default" group is overridden by a dynamic group
63      * sequence obtained by the validated objects.
64      *
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.
69      *
70      * @return bool Returns true if the "Default" group is overridden by
71      *              a dynamic group sequence
72      *
73      * @see \Symfony\Component\Validator\GroupSequenceProviderInterface
74      */
75     public function isGroupSequenceProvider();
76
77     /**
78      * Check if there's any metadata attached to the given named property.
79      *
80      * @param string $property The property name
81      *
82      * @return bool
83      */
84     public function hasPropertyMetadata($property);
85
86     /**
87      * Returns all metadata instances for the given named property.
88      *
89      * If your implementation does not support properties, simply throw an
90      * exception in this method (for example a <tt>BadMethodCallException</tt>).
91      *
92      * @param string $property The property name
93      *
94      * @return PropertyMetadataInterface[] A list of metadata instances. Empty if
95      *                                     no metadata exists for the property.
96      */
97     public function getPropertyMetadata($property);
98
99     /**
100      * Returns the name of the backing PHP class.
101      *
102      * @return string The name of the backing class
103      */
104     public function getClassName();
105 }