1 | <?php |
||
15 | abstract class AbstractCommand extends Command |
||
16 | { |
||
17 | public const DB = 'db'; |
||
18 | public const COLLECTION = 'collection'; |
||
19 | public const INDEX = 'index'; |
||
20 | |||
21 | protected function configure() |
||
22 | { |
||
23 | parent::configure(); |
||
24 | |||
25 | $this |
||
26 | ->addOption('maxTimeMs', null, InputOption::VALUE_REQUIRED, 'An optional maxTimeMs that will be used for all schema operations.') |
||
27 | ->addOption('w', null, InputOption::VALUE_REQUIRED, 'An optional w option for the write concern that will be used for all schema operations.') |
||
28 | ->addOption('wTimeout', null, InputOption::VALUE_REQUIRED, 'An optional wTimeout option for the write concern that will be used for all schema operations.') |
||
29 | ->addOption('journal', null, InputOption::VALUE_REQUIRED, 'An optional journal option for the write concern that will be used for all schema operations.'); |
||
30 | } |
||
31 | |||
32 | abstract protected function processDocumentCollection(SchemaManager $sm, string $document, ?int $maxTimeMs, ?WriteConcern $writeConcern); |
||
33 | |||
34 | abstract protected function processCollection(SchemaManager $sm, ?int $maxTimeMs, ?WriteConcern $writeConcern); |
||
35 | |||
36 | abstract protected function processDocumentDb(SchemaManager $sm, string $document, ?int $maxTimeMs, ?WriteConcern $writeConcern); |
||
37 | |||
38 | abstract protected function processDb(SchemaManager $sm, ?int $maxTimeMs, ?WriteConcern $writeConcern); |
||
39 | |||
40 | abstract protected function processDocumentIndex(SchemaManager $sm, string $document, ?int $maxTimeMs, ?WriteConcern $writeConcern); |
||
41 | |||
42 | abstract protected function processIndex(SchemaManager $sm, ?int $maxTimeMs, ?WriteConcern $writeConcern); |
||
43 | |||
44 | /** |
||
45 | * @return SchemaManager |
||
46 | */ |
||
47 | protected function getSchemaManager() |
||
51 | |||
52 | /** |
||
53 | * @return DocumentManager |
||
54 | */ |
||
55 | protected function getDocumentManager() |
||
59 | |||
60 | /** |
||
61 | * @return ClassMetadataFactory |
||
62 | */ |
||
63 | protected function getMetadataFactory() |
||
67 | |||
68 | protected function getMaxTimeMsFromInput(InputInterface $input) : ?int |
||
74 | |||
75 | protected function getWriteConcernFromInput(InputInterface $input) : ?WriteConcern |
||
87 | } |
||
88 |