-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMetadataManagerInterface.php
80 lines (69 loc) · 1.85 KB
/
MetadataManagerInterface.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
77
78
79
80
<?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;
/**
* @author François Pluchino <francois.pluchino@klipper.dev>
*/
interface MetadataManagerInterface
{
/**
* Get the object metadatas.
*
* @return ObjectMetadataInterface[]
*/
public function all(): array;
/**
* Check if the object metadata is present.
*
* @param string $class The class name
*/
public function has(string $class): bool;
/**
* Check if the object metadata is present by her name.
*
* @param string $name The object name
*/
public function hasByName(string $name): bool;
/**
* Get the object metadata.
*
* @param string $class The class name
*
* @throws ObjectMetadataNotFoundException When the class is not managed
*/
public function get(string $class): ObjectMetadataInterface;
/**
* Get the object metadata by her name.
*
* @param string $name The object name
*
* @throws ObjectMetadataNotFoundException When the object name is not managed
*/
public function getByName(string $name): ObjectMetadataInterface;
/**
* Get the choices.
*
* @return ChoiceInterface[]
*/
public function allChoices(): array;
/**
* Check if the choice is present.
*
* @param string $name The choice name
*/
public function hasChoice(string $name): bool;
/**
* Get the choice.
*
* @param string $name The choice name
*/
public function getChoice(string $name): ChoiceInterface;
}