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

47 lines
No EOL
1 KiB
PHP

<?php
namespace OCA\OrganizationFolders\Model;
use OCA\OrganizationFolders\Interface\TableSerializable;
class Organization implements \JsonSerializable, TableSerializable {
public function __construct(
private int $id,
private string $friendlyName,
private string $membersGroup,
private ?int $parentOrganizationId = null,
) {
}
public function getId(): int {
return $this->id;
}
public function getFriendlyName(): string {
return $this->friendlyName;
}
public function getMembersGroup(): string {
return $this->membersGroup;
}
public function getParentOrganizationId(): ?int {
return $this->parentOrganizationId;
}
public function jsonSerialize(): array {
return [
'id' => $this->id,
'friendlyName' => $this->friendlyName,
'membersGroup' => $this->membersGroup,
];
}
public function tableSerialize(?array $params = null): array {
return [
'Id' => $this->id,
'Friendly Name' => $this->friendlyName,
'Members Group' => $this->membersGroup,
];
}
}