1 | <?php |
||
7 | class Schemas implements \IteratorAggregate, \Countable |
||
8 | { |
||
9 | /** @var Schema[] */ |
||
10 | private $schemas = []; |
||
11 | |||
12 | /** |
||
13 | * Return the XML of a Xsd that includes all the namespaces |
||
14 | * with the local location |
||
15 | * |
||
16 | * @return string |
||
17 | */ |
||
18 | 7 | public function getImporterXsd(): string |
|
30 | |||
31 | /** |
||
32 | * Create a new schema and inserts it to the collection |
||
33 | * The returned object is the schema |
||
34 | * @param string $namespace |
||
35 | * @param string $location |
||
36 | * @return Schema |
||
37 | */ |
||
38 | 9 | public function create(string $namespace, string $location): Schema |
|
42 | |||
43 | /** |
||
44 | * Insert a schema to the collection |
||
45 | * The returned object is the same schema |
||
46 | * @param Schema $schema |
||
47 | * @return Schema |
||
48 | */ |
||
49 | 11 | public function insert(Schema $schema): Schema |
|
54 | |||
55 | /** |
||
56 | * Remove a schema |
||
57 | * @param string $namespace |
||
58 | */ |
||
59 | 1 | public function remove(string $namespace) |
|
63 | |||
64 | /** |
||
65 | * Return the complete collection of schemas as an associative array |
||
66 | * @return Schema[] |
||
67 | */ |
||
68 | 1 | public function all(): array |
|
72 | |||
73 | /** |
||
74 | * @param string $namespace |
||
75 | * @return bool |
||
76 | */ |
||
77 | 4 | public function exists(string $namespace): bool |
|
81 | |||
82 | /** |
||
83 | * Get an schema object by its namespace |
||
84 | * @param string $namespace |
||
85 | * @return Schema |
||
86 | */ |
||
87 | 3 | public function item(string $namespace): Schema |
|
94 | |||
95 | 12 | public function count() |
|
99 | |||
100 | 1 | public function getIterator() |
|
104 | } |
||
105 |