Spaces:
No application file
No application file
Download plugins/GrapesJsBuilderBundle/Integration/Config.php from chrisbryan17/mautic: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/spaces/chrisbryan17/mautic/resolve/main/plugins/GrapesJsBuilderBundle/Integration/Config.php
- Command line
-
hf download hf://spaces/chrisbryan17/mautic/plugins/GrapesJsBuilderBundle/Integration/Config.php
-
curl -L -o Config.php https://huggingface.co/spaces/chrisbryan17/mautic/resolve/main/plugins/GrapesJsBuilderBundle/Integration/Config.php
1.28 kB
| declare(strict_types=1); | |
| namespace MauticPlugin\GrapesJsBuilderBundle\Integration; | |
| use Mautic\IntegrationsBundle\Exception\IntegrationNotFoundException; | |
| use Mautic\IntegrationsBundle\Helper\IntegrationsHelper; | |
| use Mautic\PluginBundle\Entity\Integration; | |
| class Config | |
| { | |
| public function __construct( | |
| private IntegrationsHelper $integrationsHelper | |
| ) { | |
| } | |
| public function isPublished(): bool | |
| { | |
| try { | |
| $integration = $this->getIntegrationEntity(); | |
| return (bool) $integration->getIsPublished() ?: false; | |
| } catch (IntegrationNotFoundException) { | |
| return false; | |
| } | |
| } | |
| /** | |
| * @return mixed[] | |
| */ | |
| public function getFeatureSettings(): array | |
| { | |
| try { | |
| $integration = $this->getIntegrationEntity(); | |
| return $integration->getFeatureSettings() ?: []; | |
| } catch (IntegrationNotFoundException) { | |
| return []; | |
| } | |
| } | |
| /** | |
| * @throws IntegrationNotFoundException | |
| */ | |
| public function getIntegrationEntity(): Integration | |
| { | |
| $integrationObject = $this->integrationsHelper->getIntegration(GrapesJsBuilderIntegration::NAME); | |
| return $integrationObject->getIntegrationConfiguration(); | |
| } | |
| } | |