setCurrent($company); * tenant() // returns Company|null */ class TenantManager { protected ?Company $current = null; public function setCurrent(?Company $company): void { $this->current = $company; } public function current(): ?Company { return $this->current; } public function currentId(): ?int { return $this->current?->id; } public function isResolved(): bool { return $this->current !== null; } public function clear(): void { $this->current = null; } }