public function PullStatusEntity::execute in CMS Content Sync 2.1.x
Same name and namespace in other branches
- 8 modules/cms_content_sync_views/src/Plugin/Action/PullStatusEntity.php \Drupal\cms_content_sync_views\Plugin\Action\PullStatusEntity::execute()
- 2.0.x modules/cms_content_sync_views/src/Plugin/Action/PullStatusEntity.php \Drupal\cms_content_sync_views\Plugin\Action\PullStatusEntity::execute()
Throws
\Exception
Overrides ExecutableInterface::execute
File
- modules/
cms_content_sync_views/ src/ Plugin/ Action/ PullStatusEntity.php, line 28
Class
- PullStatusEntity
- Pull entity of status entity.
Namespace
Drupal\cms_content_sync_views\Plugin\ActionCode
public function execute($entity = NULL) {
/** @var \Drupal\cms_content_sync\Entity\EntityStatus $entity */
if ($entity instanceof EntityStatus) {
$flow = $entity
->getFlow();
try {
FlowPull::force_pull_entity($flow
->id(), $entity
->get('entity_type')
->getValue()[0]['value'], $entity
->get('entity_uuid')
->getValue()[0]['value']);
} catch (InvalidPluginDefinitionException $e) {
throw new \Exception($e);
} catch (PluginNotFoundException $e) {
throw new \Exception($e);
}
}
}