| 1 | <?php |
||
| 17 | |||
| 18 | class SyncItemTo extends AbstractIntegrationItemAction |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @inheritdoc |
||
| 22 | */ |
||
| 23 | public function getTriggerLabel(): string |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @inheritdoc |
||
| 30 | */ |
||
| 31 | public function getConfirmationMessage() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @inheritdoc |
||
| 38 | * @throws \Throwable |
||
| 39 | */ |
||
| 40 | public function performAction(Integrations $field, ElementInterface $element, IntegrationAssociation $record): bool |
||
| 41 | { |
||
| 42 | if (!$field instanceof ObjectsFieldInterface) { |
||
| 43 | $this->setMessage("Invalid field type."); |
||
| 44 | return false; |
||
| 45 | } |
||
| 46 | |||
| 47 | if (!$field->syncToHubSpot($element)) { |
||
| 48 | $this->setMessage("Failed to sync to HubSpot"); |
||
| 49 | return false; |
||
| 50 | } |
||
| 56 |