1 | <?php |
||
16 | abstract class AbstractSyncCommand extends Command implements CommandInterface |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var boolean |
||
21 | */ |
||
22 | protected $ignoreExisting; |
||
23 | |||
24 | /** |
||
25 | * @var ContentfulService |
||
26 | */ |
||
27 | protected $contentfulService; |
||
28 | |||
29 | /** |
||
30 | * @var AbstractContentfulSyncService |
||
31 | */ |
||
32 | protected $contentfulSyncService; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $contentTypes; |
||
38 | |||
39 | /** |
||
40 | * @var int |
||
41 | */ |
||
42 | protected $numSynchronized; |
||
43 | |||
44 | /** |
||
45 | * @var int |
||
46 | */ |
||
47 | protected $skip; |
||
48 | |||
49 | /** |
||
50 | * @param null|string $contentType the content type, or null if not applicable |
||
51 | * |
||
52 | * @return Query the query used to fetch all entries/assets |
||
53 | */ |
||
54 | abstract protected function getQuery(?string $contentType = null): Query; |
||
55 | |||
56 | /** |
||
57 | * @param null|string $contentType the content type, or null if not applicable |
||
58 | * |
||
59 | * @return Query the query used to get the total number of items |
||
60 | */ |
||
61 | abstract protected function getTotalQuery(?string $contentType = null): Query; |
||
62 | |||
63 | /** |
||
64 | * AbstractSyncCommand constructor. |
||
65 | * |
||
66 | * @param array $contentTypes |
||
67 | * @param ContentfulService $contentfulService |
||
68 | * @param AbstractContentfulSyncService $contentfulSyncService |
||
69 | */ |
||
70 | public function __construct( |
||
81 | |||
82 | /** |
||
83 | * @inheritdoc |
||
84 | * |
||
85 | * @throws \Throwable |
||
86 | */ |
||
87 | public function handle() |
||
94 | |||
95 | /** |
||
96 | * @return Client |
||
97 | */ |
||
98 | protected function getClient(): Client |
||
102 | } |
||
103 |