ChatSession.php
- Pfad:
src/Domain/Entity/ChatSession.php - Namespace: Domain\Entity
- Zeilen: 178 | Größe: 4,257 Bytes
- Geändert: 2025-12-25 17:00:17 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 90
- Dependencies: 100 (25%)
- LOC: 61 (20%)
- Methods: 90 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Dependencies 5
- constructor Domain\ValueObject\SessionUuid
- constructor Domain\ValueObject\SessionMetadata
- constructor DateTimeImmutable
- use Domain\ValueObject\SessionMetadata
- use Domain\ValueObject\SessionUuid
Klassen 1
-
ChatSessionclass Zeile 12
Funktionen 21
-
__construct()public Zeile 14 -
getId()public Zeile 30 -
getUuid()public Zeile 35 -
getUuidObject()public Zeile 40 -
getSessionToken()public Zeile 45 -
getUserId()public Zeile 50 -
getPersonaId()public Zeile 55 -
getTitle()public Zeile 60 -
getModel()public Zeile 65 -
getCollections()public Zeile 71 -
getContextLimit()public Zeile 76 -
getTemperature()public Zeile 81 -
getMaxTokens()public Zeile 86 -
getAuthorProfileId()public Zeile 91 -
getSystemPromptId()public Zeile 96 -
getCreatedAt()public Zeile 101 -
getUpdatedAt()public Zeile 106 -
getLastActivity()public Zeile 111 -
withId()public Zeile 116 -
withTitle()public Zeile 134 -
updateSettings()public Zeile 152
Verwendet von 10
- ChatSessionDTO.php use
- ChatSessionDTO.php constructor
- ChatSessionFactory.php use
- ChatSessionRepository.php use
- ChatSessionRepositoryInterface.php use
- GetChatSessionUseCase.php use
- GetChatSessionUseCaseInterface.php use
- ManageChatSessionsUseCase.php use
- UpdateChatSessionUseCase.php use
- UpdateChatSessionUseCaseInterface.php use
Versionen 18
-
v18
2025-12-25 16:59 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Write-Operation -
v17
2025-12-25 16:59 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v16
2025-12-25 16:59 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Write-Operation -
v15
2025-12-25 16:58 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v14
2025-12-25 16:58 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v13
2025-12-25 16:58 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v12
2025-12-25 16:57 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v11
2025-12-25 09:53 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v10
2025-12-25 09:53 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v9
2025-12-25 09:53 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v8
2025-12-25 09:53 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v7
2025-12-25 09:53 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v6
2025-12-25 09:53 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v5
2025-12-25 09:43 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v4
2025-12-25 09:40 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v3
2025-12-25 09:40 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v2
2025-12-25 09:40 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v1
2025-12-25 09:40 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
Code
<?php
declare(strict_types=1);
namespace Domain\Entity;
// @responsibility: Repräsentiert eine Chat-Session mit ihren Metadaten
use Domain\ValueObject\SessionMetadata;
use Domain\ValueObject\SessionUuid;
class ChatSession
{
public function __construct(
private readonly SessionUuid $uuid,
private readonly SessionMetadata $metadata,
private readonly ?int $id = null,
private readonly ?string $sessionToken = null,
private readonly ?int $userId = null,
private readonly ?int $personaId = null,
private readonly ?string $title = null,
private readonly ?int $authorProfileId = null,
private readonly ?int $systemPromptId = null,
private readonly \DateTimeImmutable $createdAt = new \DateTimeImmutable(),
private readonly \DateTimeImmutable $updatedAt = new \DateTimeImmutable(),
private readonly \DateTimeImmutable $lastActivity = new \DateTimeImmutable()
) {
}
public function getId(): ?int
{
return $this->id;
}
public function getUuid(): string
{
return $this->uuid->value();
}
public function getUuidObject(): SessionUuid
{
return $this->uuid;
}
public function getSessionToken(): ?string
{
return $this->sessionToken;
}
public function getUserId(): ?int
{
return $this->userId;
}
public function getPersonaId(): ?int
{
return $this->personaId;
}
public function getTitle(): ?string
{
return $this->title;
}
public function getModel(): string
{
return $this->metadata->getModel();
}
/** @return array<string> */
public function getCollections(): array
{
return $this->metadata->getCollections();
}
public function getContextLimit(): int
{
return $this->metadata->getContextLimit();
}
public function getTemperature(): float
{
return $this->metadata->getTemperature();
}
public function getMaxTokens(): int
{
return $this->metadata->getMaxTokens();
}
public function getAuthorProfileId(): ?int
{
return $this->authorProfileId;
}
public function getSystemPromptId(): ?int
{
return $this->systemPromptId;
}
public function getCreatedAt(): \DateTimeImmutable
{
return $this->createdAt;
}
public function getUpdatedAt(): \DateTimeImmutable
{
return $this->updatedAt;
}
public function getLastActivity(): \DateTimeImmutable
{
return $this->lastActivity;
}
public function withId(int $id): self
{
return new self(
$this->uuid,
$this->metadata,
$id,
$this->sessionToken,
$this->userId,
$this->personaId,
$this->title,
$this->authorProfileId,
$this->systemPromptId,
$this->createdAt,
$this->updatedAt,
$this->lastActivity
);
}
public function withTitle(string $title): self
{
return new self(
$this->uuid,
$this->metadata,
$this->id,
$this->sessionToken,
$this->userId,
$this->personaId,
$title,
$this->authorProfileId,
$this->systemPromptId,
$this->createdAt,
new \DateTimeImmutable(),
new \DateTimeImmutable()
);
}
public function updateSettings(
string $model,
array $collections,
int $contextLimit,
?int $authorProfileId,
float $temperature,
int $maxTokens
): self {
$newMetadata = SessionMetadata::create($model, $collections, $contextLimit, $temperature, $maxTokens);
return new self(
$this->uuid,
$newMetadata,
$this->id,
$this->sessionToken,
$this->userId,
$this->personaId,
$this->title,
$authorProfileId,
$this->systemPromptId,
$this->createdAt,
new \DateTimeImmutable(),
new \DateTimeImmutable()
);
}
}