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 |
|
78 | |||
79 | /** |
||
80 | * Update. |
||
81 | */ |
||
82 | public function update(ResourceNamespaceInterface $resource, array $data): bool |
||
90 | |||
91 | /** |
||
92 | * Delete by name. |
||
93 | */ |
||
94 | 2 | public function deleteOne(string $name): bool |
|
100 | |||
101 | /** |
||
102 | * Add namespace. |
||
103 | */ |
||
104 | 8 | public function add(array $resource): ObjectIdInterface |
|
115 | |||
116 | /** |
||
117 | * Change stream. |
||
118 | */ |
||
119 | public function watch(?ObjectIdInterface $after = null, bool $existing = true, ?array $query = null, ?int $offset = null, ?int $limit = null, ?array $sort = null): Generator |
||
123 | |||
124 | /** |
||
125 | * Build instance. |
||
126 | */ |
||
127 | 5 | public function build(array $resource): ResourceNamespaceInterface |
|
131 | } |
||
132 |