mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-11-24 21:50:26 +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,
|
|
];
|
|
}
|
|
} |