Files
nextcloud-analytics/analyticshub/lib/Model/ClientConfig.php
WLTBAgent 8a445c4d46 Fix: Rename app folder to match app ID
- Renamed analytics-hub/ → analyticshub/
- App ID in info.xml is 'analyticshub' (no hyphen)
- Nextcloud requires folder name to match app ID exactly
- Fixes 'Could not download app analyticshub' error during installation

Installation:
- Upload analyticshub/ folder to /var/www/nextcloud/apps/
- Folder name must match app ID in info.xml
2026-02-13 18:21:39 +00:00

111 lines
2.5 KiB
PHP

<?php
declare(strict_types=1);
namespace OCA\AnalyticsHub\Model;
/**
* Client configuration model
*/
class ClientConfig {
private int $id;
private string $propertyId;
private string $name;
private string $slug;
private bool $active;
private ?array $context;
private ?array $webdavConfig;
private ?array $thresholds;
public function __construct(
int $id,
string $propertyId,
string $name,
string $slug,
bool $active = true,
?array $context = null,
?array $webdavConfig = null,
?array $thresholds = null
) {
$this->id = $id;
$this->propertyId = $propertyId;
$this->name = $name;
$this->slug = $slug;
$this->active = $active;
$this->context = $context;
$this->webdavConfig = $webdavConfig;
$this->thresholds = $thresholds;
}
// Getters
public function getId(): int {
return $this->id;
}
public function getPropertyId(): string {
return $this->propertyId;
}
public function getName(): string {
return $this->name;
}
public function getSlug(): string {
return $this->slug;
}
public function isActive(): bool {
return $this->active;
}
public function getContext(): ?array {
return $this->context;
}
public function getWebdavConfig(): ?array {
return $this->webdavConfig;
}
public function getThresholds(): ?array {
return $this->thresholds;
}
// Setters
public function setActive(bool $active): void {
$this->active = $active;
}
/**
* Create from JSON
*/
public static function fromJson(array $data): self {
return new self(
(int)($data['id'] ?? 0),
(string)($data['property_id'] ?? ''),
(string)($data['name'] ?? ''),
(string)($data['slug'] ?? ''),
(bool)($data['active'] ?? true),
$data['context'] ?? null,
$data['webdav_config'] ?? null,
$data['thresholds'] ?? null
);
}
/**
* Convert to array
*/
public function toArray(): array {
return [
'id' => $this->id,
'property_id' => $this->propertyId,
'name' => $this->name,
'slug' => $this->slug,
'active' => $this->active,
'context' => $this->context,
'webdav_config' => $this->webdavConfig,
'thresholds' => $this->thresholds,
];
}
}