addType('id', 'integer'); $this->addType('archived', 'boolean'); } /** * @psalm-return TablesTable */ public function jsonSerialize(): array { return [ 'id' => $this->id, 'title' => $this->title ?: '', 'emoji' => $this->emoji, 'ownership' => $this->ownership ?: '', 'ownerDisplayName' => $this->ownerDisplayName ?: '', 'createdBy' => $this->createdBy ?: '', 'createdAt' => $this->createdAt ?: '', 'lastEditBy' => $this->lastEditBy ?: '', 'lastEditAt' => $this->lastEditAt ?: '', 'archived' => $this->archived, 'isShared' => (bool)$this->isShared, 'favorite' => $this->favorite, 'onSharePermissions' => $this->getSharePermissions()?->jsonSerialize(), 'hasShares' => (bool)$this->hasShares, 'rowsCount' => $this->rowsCount ?: 0, 'columnsCount' => $this->columnsCount ?: 0, 'views' => $this->getViewsArray(), 'description' => $this->description ?:'', ]; } private function getSharePermissions(): ?Permissions { return $this->onSharePermissions; } /** * @psalm-suppress MismatchingDocblockReturnType * @return TablesView[] */ private function getViewsArray(): array { return $this->getViews() ?: []; } }