builders as $builder) { // Ensure the configuration is hydrated $this->integrationsHelper->getIntegrationConfiguration($builder); if ($builder->isSupported($feature) && $builder->getIntegrationConfiguration()->getIsPublished()) { return $builder; } } throw new IntegrationNotFoundException(); } public function getBuilderNames(): array { $names = []; foreach ($this->builders as $builder) { $names[$builder->getName()] = $builder->getDisplayName(); } return $names; } public function addIntegration(BuilderInterface $integration): void { $this->builders[$integration->getName()] = $integration; } /** * @throws IntegrationNotFoundException */ public function getIntegration(string $integration): BuilderInterface { if (!isset($this->builders[$integration])) { throw new IntegrationNotFoundException("$integration either doesn't exist or has not been tagged with mautic.builder_integration"); } // Ensure the configuration is hydrated $this->integrationsHelper->getIntegrationConfiguration($this->builders[$integration]); return $this->builders[$integration]; } public function saveIntegrationConfiguration(Integration $integrationConfiguration): void { $this->integrationsHelper->saveIntegrationConfiguration($integrationConfiguration); } }