-
Notifications
You must be signed in to change notification settings - Fork 0
/
MetadataFactoryInterface.php
76 lines (65 loc) · 1.92 KB
/
MetadataFactoryInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*
* This file is part of the Klipper package.
*
* (c) François Pluchino <francois.pluchino@klipper.dev>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Klipper\Component\Metadata;
use Klipper\Component\Metadata\Exception\ObjectMetadataNotFoundException;
use Klipper\Component\Metadata\Loader\ChoiceNameCollection;
use Klipper\Component\Metadata\Loader\ObjectMetadataNameCollection;
/**
* @author François Pluchino <francois.pluchino@klipper.dev>
*/
interface MetadataFactoryInterface
{
/**
* Get the managed classes by doctrine.
*/
public function getManagedClasses(): ObjectMetadataNameCollection;
/**
* Check if the class is managed in doctrine.
*
* @param string $class The class name
*/
public function isManagedClass(string $class): bool;
/**
* Check if the metadata name is managed in doctrine.
*
* @param string $name The metadata name
*/
public function isManagedByName(string $name): bool;
/**
* Get the managed class name defined in doctrine.
*
* @param string $class The class name
*
* @throws ObjectMetadataNotFoundException When the class is not registered in doctrine
*/
public function getManagedClass(string $class): string;
/**
* Create the metadata.
*
* @param string $class The class name
*/
public function create(string $class): ObjectMetadataInterface;
/**
* Create the choice.
*
* @param string $name The choice name
*/
public function createChoice(string $name): ChoiceInterface;
/**
* Get the choice names.
*/
public function getChoiceNames(): ChoiceNameCollection;
/**
* Check if the choice is managed.
*
* @param string $name The choice name
*/
public function isChoiceManaged(string $name): bool;
}