bc6fb11d19b1acca9af7929e489606f48b3deea6
[yaffs-website] / vendor / doctrine / common / lib / Doctrine / Common / Persistence / Mapping / ClassMetadataFactory.php
1 <?php
2 /*
3  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14  *
15  * This software consists of voluntary contributions made by many individuals
16  * and is licensed under the MIT license. For more information, see
17  * <http://www.doctrine-project.org>.
18  */
19
20 namespace Doctrine\Common\Persistence\Mapping;
21
22 /**
23  * Contract for a Doctrine persistence layer ClassMetadata class to implement.
24  *
25  * @link   www.doctrine-project.org
26  * @since  2.1
27  * @author Benjamin Eberlei <kontakt@beberlei.de>
28  * @author Jonathan Wage <jonwage@gmail.com>
29  */
30 interface ClassMetadataFactory
31 {
32     /**
33      * Forces the factory to load the metadata of all classes known to the underlying
34      * mapping driver.
35      *
36      * @return ClassMetadata[] The ClassMetadata instances of all mapped classes.
37      */
38     public function getAllMetadata();
39
40     /**
41      * Gets the class metadata descriptor for a class.
42      *
43      * @param string $className The name of the class.
44      *
45      * @return ClassMetadata
46      */
47     public function getMetadataFor($className);
48
49     /**
50      * Checks whether the factory has the metadata for a class loaded already.
51      *
52      * @param string $className
53      *
54      * @return boolean TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
55      */
56     public function hasMetadataFor($className);
57
58     /**
59      * Sets the metadata descriptor for a specific class.
60      *
61      * @param string $className
62      *
63      * @param ClassMetadata $class
64      */
65     public function setMetadataFor($className, $class);
66
67     /**
68      * Returns whether the class with the specified name should have its metadata loaded.
69      * This is only the case if it is either mapped directly or as a MappedSuperclass.
70      *
71      * @param string $className
72      *
73      * @return boolean
74      */
75     public function isTransient($className);
76 }