mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-11-22 04:38:09 +01:00
29 lines
No EOL
536 B
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,
|
|
];
|
|
}
|
|
} |