1 | <?php |
||
32 | trait SyncByElementTrait |
||
33 | { |
||
34 | use TransformElementIdTrait, |
||
35 | TransformElementPayloadTrait; |
||
36 | |||
37 | /** |
||
38 | * @param string $id |
||
39 | * @param ConnectionInterface|string|null $connection |
||
40 | * @param CacheInterface|string|null $cache |
||
41 | * @return callable |
||
42 | */ |
||
43 | public abstract function rawHttpReadRelay( |
||
48 | |||
49 | /** |
||
50 | * @param array $payload |
||
51 | * @param string|null $identifier |
||
52 | * @param ConnectionInterface|string|null $connection |
||
53 | * @param CacheInterface|string|null $cache |
||
54 | * @return callable |
||
55 | * @throws \yii\base\InvalidConfigException |
||
56 | */ |
||
57 | public abstract function rawHttpUpsertRelay( |
||
63 | |||
64 | /** |
||
65 | * @param ElementInterface $element |
||
66 | * @param Objects $field |
||
67 | * @param ConnectionInterface|null $connection |
||
68 | * @param CacheInterface|null $cache |
||
69 | * @return bool |
||
70 | * @throws \yii\base\InvalidConfigException |
||
71 | */ |
||
72 | public function syncDown( |
||
93 | |||
94 | /** |
||
95 | * @param ElementInterface $element |
||
96 | * @param Objects $field |
||
97 | * @param string $id |
||
98 | * @param ConnectionInterface|null $connection |
||
99 | * @param CacheInterface|null $cache |
||
100 | * @return bool |
||
101 | * @throws \yii\base\InvalidConfigException |
||
102 | */ |
||
103 | public function rawSyncDown( |
||
125 | |||
126 | /** |
||
127 | * @param ResponseInterface $response |
||
128 | * @param ElementInterface $element |
||
129 | * @param Objects $field |
||
130 | * @return bool |
||
131 | */ |
||
132 | protected function handleSyncDownResponse( |
||
154 | |||
155 | /** |
||
156 | * @param ElementInterface $element |
||
157 | * @param Objects $field |
||
158 | * @param ConnectionInterface|null $connection |
||
159 | * @param CacheInterface|null $cache |
||
160 | * @return bool |
||
161 | * @throws \yii\base\InvalidConfigException |
||
162 | */ |
||
163 | |||
164 | public function syncUp( |
||
179 | |||
180 | /** |
||
181 | * @param ElementInterface $element |
||
182 | * @param Objects $field |
||
183 | * @param array $payload |
||
184 | * @param string|null $id |
||
185 | * @param ConnectionInterface|null $connection |
||
186 | * @param CacheInterface|null $cache |
||
187 | * @return bool |
||
188 | * @throws \yii\base\InvalidConfigException |
||
189 | */ |
||
190 | public function rawSyncUp( |
||
214 | |||
215 | /** |
||
216 | * @param ResponseInterface $response |
||
217 | * @param ElementInterface $element |
||
218 | * @param Objects $field |
||
219 | * @return bool |
||
220 | */ |
||
221 | protected function handleSyncUpResponse( |
||
242 | |||
243 | /** |
||
244 | * @param ResponseInterface $response |
||
245 | * @param ElementInterface $element |
||
246 | */ |
||
247 | protected function handleResponseErrors(ResponseInterface $response, ElementInterface $element) |
||
266 | } |
||
267 |