summaryrefslogtreecommitdiff
path: root/vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadataFactory.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadataFactory.php')
-rw-r--r--vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadataFactory.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadataFactory.php b/vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadataFactory.php
new file mode 100644
index 0000000..28b8303
--- /dev/null
+++ b/vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadataFactory.php
@@ -0,0 +1,61 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\Persistence\Mapping;
6
7/**
8 * Contract for a Doctrine persistence layer ClassMetadata class to implement.
9 *
10 * @template T of ClassMetadata
11 */
12interface ClassMetadataFactory
13{
14 /**
15 * Forces the factory to load the metadata of all classes known to the underlying
16 * mapping driver.
17 *
18 * @return ClassMetadata[] The ClassMetadata instances of all mapped classes.
19 * @psalm-return list<T>
20 */
21 public function getAllMetadata();
22
23 /**
24 * Gets the class metadata descriptor for a class.
25 *
26 * @param class-string $className The name of the class.
27 *
28 * @return ClassMetadata
29 * @psalm-return T
30 */
31 public function getMetadataFor(string $className);
32
33 /**
34 * Checks whether the factory has the metadata for a class loaded already.
35 *
36 * @param class-string $className
37 *
38 * @return bool TRUE if the metadata of the class in question is already loaded, FALSE otherwise.
39 */
40 public function hasMetadataFor(string $className);
41
42 /**
43 * Sets the metadata descriptor for a specific class.
44 *
45 * @param class-string $className
46 * @psalm-param T $class
47 *
48 * @return void
49 */
50 public function setMetadataFor(string $className, ClassMetadata $class);
51
52 /**
53 * Returns whether the class with the specified name should have its metadata loaded.
54 * This is only the case if it is either mapped directly or as a MappedSuperclass.
55 *
56 * @psalm-param class-string $className
57 *
58 * @return bool
59 */
60 public function isTransient(string $className);
61}