1 | <?php |
||
22 | class Factory extends ResourceFactory |
||
23 | { |
||
24 | /** |
||
25 | * Collection name. |
||
26 | */ |
||
27 | public const COLLECTION_NAME = 'namespaces'; |
||
28 | |||
29 | /** |
||
30 | * Datatype. |
||
31 | * |
||
32 | * @var CollectionFactory |
||
33 | */ |
||
34 | protected $collection_factory; |
||
35 | |||
36 | /** |
||
37 | * Initialize. |
||
38 | */ |
||
39 | 11 | public function __construct(Database $db, CollectionFactory $collection_factory, LoggerInterface $logger) |
|
44 | |||
45 | /** |
||
46 | * Has namespace. |
||
47 | */ |
||
48 | 9 | public function has(string $name): bool |
|
52 | |||
53 | /** |
||
54 | * Get all. |
||
55 | */ |
||
56 | 3 | public function getAll(?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
|
60 | |||
61 | /** |
||
62 | * Get namespace. |
||
63 | */ |
||
64 | 4 | public function getOne(string $name): ResourceNamespaceInterface |
|
74 | |||
75 | /** |
||
76 | * Update. |
||
77 | */ |
||
78 | public function update(ResourceNamespaceInterface $resource, array $data): bool |
||
86 | |||
87 | /** |
||
88 | * Delete by name. |
||
89 | */ |
||
90 | 2 | public function deleteOne(string $name): bool |
|
96 | |||
97 | /** |
||
98 | * Add namespace. |
||
99 | */ |
||
100 | 8 | public function add(array $resource): ObjectIdInterface |
|
110 | |||
111 | /** |
||
112 | * Change stream. |
||
113 | */ |
||
114 | public function watch(?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
||
118 | |||
119 | /** |
||
120 | * Build instance. |
||
121 | */ |
||
122 | 5 | public function build(array $resource): ResourceNamespaceInterface |
|
126 | } |
||
127 |