1 | <?php |
||
16 | class Tools { |
||
17 | |||
18 | /** |
||
19 | * The mongobb.database_factory service. |
||
20 | * |
||
21 | * @var \Drupal\mongodb\DatabaseFactory |
||
22 | */ |
||
23 | protected $dbFactory; |
||
24 | |||
25 | /** |
||
26 | * The settings service. |
||
27 | * |
||
28 | * @var \Drupal\Core\Site\Settings |
||
29 | */ |
||
30 | protected $settings; |
||
31 | |||
32 | /** |
||
33 | * The serialization.yaml service. |
||
34 | * |
||
35 | * @var \Drupal\Component\Serialization\SerializationInterface |
||
36 | */ |
||
37 | protected $yaml; |
||
38 | |||
39 | /** |
||
40 | * MongoDbCommands constructor. |
||
41 | * |
||
42 | * @param \Drupal\mongodb\DatabaseFactory $databaseFactory |
||
43 | * The mongobb.database_factory service. |
||
44 | * @param \Drupal\Core\Site\Settings $settings |
||
45 | * The settings service. |
||
46 | * @param \Drupal\Component\Serialization\SerializationInterface $yaml |
||
47 | * The serialization.yaml service. |
||
48 | */ |
||
49 | public function __construct( |
||
58 | |||
59 | /** |
||
60 | * Command callback for mongodb:mdbf. |
||
61 | * |
||
62 | * @param string $alias |
||
63 | * The alias of the database in which to perform the query. |
||
64 | * @param string $collection |
||
65 | * The name of the collection in which to find. |
||
66 | * @param string $selector |
||
67 | * The selector to apply to the query. |
||
68 | * |
||
69 | * @return array |
||
70 | * The query results. |
||
71 | */ |
||
72 | public function find(string $alias, string $collection, string $selector = '{}'): array { |
||
95 | |||
96 | /** |
||
97 | * List collections matching $regex in database $alias. |
||
98 | * |
||
99 | * @param string $alias |
||
100 | * The alias in which to list the collections. |
||
101 | * @param string $regex |
||
102 | * The pattern collection names must match. |
||
103 | * |
||
104 | * @return array |
||
105 | * An array of collection objects. |
||
106 | */ |
||
107 | public function listCollections(string $alias, string $regex): array { |
||
120 | |||
121 | /** |
||
122 | * Command callback for mongodb:mdbs. |
||
123 | * |
||
124 | * @return array |
||
125 | * The MongoDB portion of the settings. |
||
126 | */ |
||
127 | public function settings(): array { |
||
130 | |||
131 | } |
||
132 |