1 | <?php |
||
13 | class FluentDriver implements MappingDriver |
||
14 | { |
||
15 | /** |
||
16 | * @var MapperSet |
||
17 | */ |
||
18 | protected $mappers; |
||
19 | |||
20 | /** |
||
21 | * @var callable |
||
22 | */ |
||
23 | protected $fluentFactory; |
||
24 | |||
25 | /** |
||
26 | * Initializes a new FileDriver that looks in the given path(s) for mapping |
||
27 | * documents and operates in the specified operating mode. |
||
28 | * |
||
29 | * @param string[]|null $mappings |
||
30 | * @param string[]|null $paths |
||
31 | * |
||
32 | * @throws \Doctrine\ORM\Mapping\MappingException |
||
33 | 4 | */ |
|
34 | 4 | public function __construct($mappings, $paths) |
|
50 | 5 | ||
51 | 5 | /** |
|
52 | 5 | * Loads the metadata for the specified class into the provided container. |
|
53 | * |
||
54 | * @param string $className |
||
55 | * @param ClassMetadata $metadata |
||
56 | */ |
||
57 | public function loadMetadataForClass($className, ClassMetadata $metadata) |
||
63 | |||
64 | /** |
||
65 | * Gets the names of all mapped classes known to this driver. |
||
66 | * |
||
67 | * @throws MappingException |
||
68 | * |
||
69 | * @return string[] The names of all mapped classes known to this driver. |
||
70 | */ |
||
71 | public function getAllClassNames() |
||
75 | |||
76 | 4 | /** |
|
77 | 4 | * Returns whether the class with the specified name should have its metadata loaded. |
|
78 | * This is only the case if it is either mapped as an Entity or a MappedSuperclass. |
||
79 | * |
||
80 | * @param string $className |
||
81 | * |
||
82 | * @return bool |
||
83 | 92 | */ |
|
84 | public function isTransient($className) |
||
90 | 81 | ||
91 | /** |
||
92 | 81 | * @param string[] $mappings |
|
93 | 1 | */ |
|
94 | public function addMappings(array $mappings = []) |
||
110 | |||
111 | /** |
||
112 | * @param Mapping $mapping |
||
113 | * |
||
114 | 5 | * @throws MappingException |
|
115 | */ |
||
116 | 5 | public function addMapping(Mapping $mapping) |
|
120 | |||
121 | /** |
||
122 | * @return MapperSet |
||
123 | */ |
||
124 | public function getMappers() |
||
128 | 1 | ||
129 | 1 | /** |
|
130 | * Add mappings from an array of folders. |
||
131 | * |
||
132 | * @param string[] $paths |
||
133 | * |
||
134 | * @throws MappingException |
||
135 | 5 | */ |
|
136 | public function addPaths($paths) |
||
159 | |||
160 | /** |
||
161 | * Get the FQN of a class from a source file. |
||
162 | * |
||
163 | * @param $pathToFile |
||
164 | * |
||
165 | * @return string |
||
166 | */ |
||
167 | private function getClassFromFile($pathToFile) |
||
225 | |||
226 | /** |
||
227 | * Override the default Fluent factory method with a custom one. |
||
228 | * Use this to implement your own Fluent builder. |
||
229 | * The method will receive a ClassMetadata object as its only argument. |
||
230 | * |
||
231 | * @param callable $factory |
||
232 | */ |
||
233 | public function setFluentFactory(callable $factory) |
||
237 | |||
238 | /** |
||
239 | * @param ClassMetadata $metadata |
||
240 | * |
||
241 | * @return Fluent |
||
242 | */ |
||
243 | protected function getFluent(ClassMetadata $metadata) |
||
247 | } |
||
248 |