did = $did; $this->handle = StringNormalizer::normalizeHandle($handle); $this->createdAt = $createdAt; $this->takedownRef = $takedownRef; $this->deactivatedAt = $deactivatedAt; $this->deleteAfter = $deleteAfter; } public function getDid(): string { return $this->did; } public function getHandle(): ?string { return $this->handle; } public function getCreatedAt(): DateTimeImmutable { return $this->createdAt; } public function getTakedownRef(): ?string { return $this->takedownRef; } public function getDeactivatedAt(): ?DateTimeImmutable { return $this->deactivatedAt; } public function getDeleteAfter(): ?DateTimeImmutable { return $this->deleteAfter; } /** * Derive the lex `status` value for this actor's repo. * * Returns null when the repo is active, otherwise the matching * non-active status string (e.g. "takendown", "deactivated"). * Takedown takes precedence over deactivation. */ public function getRepoStatus(): ?string { if ($this->takedownRef !== null) { return RepoView::STATUS_TAKENDOWN; } if ($this->deactivatedAt !== null) { return RepoView::STATUS_DEACTIVATED; } return null; } public function isRepoActive(): bool { return $this->getRepoStatus() === null; } /** * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize(): array { return [ 'did' => $this->did, 'handle' => $this->handle, 'createdAt' => $this->createdAt->format(DATE_ATOM), 'takedownRef' => $this->takedownRef, 'deactivatedAt' => $this->deactivatedAt?->format(DATE_ATOM), 'deleteAfter' => $this->deleteAfter?->format(DATE_ATOM), ]; } }