settings = $settings; } public function isEmailTrackingEnabled(string $level = null): bool { $level = $level ?? $this->settings->get('tracking.level', self::LEVEL_FULL); return in_array($level, [self::LEVEL_PARTIAL, self::LEVEL_FULL], true); } public function isCookieTrackingEnabled(string $level = null): bool { $level = $level ?? $this->settings->get('tracking.level', self::LEVEL_FULL); return $level === self::LEVEL_FULL; } public function getConfig(): array { return [ 'level' => $this->settings->get('tracking.level', self::LEVEL_FULL), 'emailTrackingEnabled' => $this->isEmailTrackingEnabled(), 'cookieTrackingEnabled' => $this->isCookieTrackingEnabled(), ]; } }