0
0
Fork 0
mirror of https://github.com/verdigado/organization_folders.git synced 2024-11-22 12:40:28 +01:00
organization_folders/lib/Model/Principal.php

29 lines
No EOL
536 B
PHP

<?php
namespace OCA\OrganizationFolders\Model;
use OCA\OrganizationFolders\Enum\PrincipalType;
class Principal implements \JsonSerializable {
public function __construct(
private PrincipalType $type,
private string $id,
) {
// check if id fits format
}
public function getType(): PrincipalType {
return $this->type;
}
public function getId(): string {
return $this->id;
}
public function jsonSerialize(): array {
return [
'type' => $this->type->value,
'id' => $this->id,
];
}
}