> */ #[ORM\Column(type: 'json')] private array $configuration = []; public function getId(): ?int { return $this->id; } public function getType(): ConfigurationType { return $this->type; } public function setType(ConfigurationType $type): self { $this->type = $type; return $this; } /** * @return array> */ public function getConfiguration(): array { return $this->configuration; } /** * @param array> $configuration */ public function setConfiguration(array $configuration): self { $this->configuration = $configuration; return $this; } public static function getInstanceConfiguration(): Configuration { return (new self())->setType(ConfigurationType::INSTANCE); } /** end of basic getters and setters ------------------------------------------------ */ /** * @return bool[] */ public function getServices(): array { /** @var array $services */ $services = $this->configuration['services'] ?? []; return $services; } public function getServicesEnabled(): bool { $services = $this->getServices(); return $services['servicesEnabled']; } /** * @return array */ public function getNotificationsSender(): array { /** @var array $notificationsSender */ $notificationsSender = $this->configuration['notificationsSender'] ?? []; return $notificationsSender; } public function getNotificationsSenderEmail(): string { $notificationsSender = $this->getNotificationsSender(); return $notificationsSender['notificationsSenderEmail'] ?? ''; } public function getNotificationsSenderName(): string { $notificationsSender = $this->getNotificationsSender(); return $notificationsSender['notificationsSenderName'] ?? ''; } /** * @return array */ public function getContactInformations(): array { /** @var array $contactInfo */ $contactInfo = $this->configuration['contact'] ?? []; return $contactInfo; } public function getContactEnabled(): bool { /** @var array $contactEnabled */ $contactEnabled = $this->getContactInformations(); return $contactEnabled['contactFormEnabled']; } public function getContactEmail(): string { /** @var array $contactEnabled */ $contactEnabled = $this->getContactInformations(); return $contactEnabled['contactFormEmail']; } public function isConversationAdminAccessible(): bool { /** @var array $config */ $config = $this->configuration['confidentiality'] ?? []; return $config['confidentialityConversationAdminAccess']; } public function isGroupsCreationForAll(): bool { return $this->configuration['groups']['groupsCreationMode'] === ParametersFormCommand::ALL; } // for test only public function setGroupsCreationModeToAdminOnly(): self { $this->configuration['groups']['groupsCreationMode'] = ParametersFormCommand::ONLY_ADMIN; return $this; } }