normalizeTypeParts($this->fullType); $this->mainType = $parts[0] ?? ''; $this->recordType = $parts[1] ?? null; } public function getUid(): int { return $this->uid; } public function getPid(): int { return $this->pid; } public function getFullType(): string { return $this->fullType; } /** * @return non-empty-string|null */ public function getRecordType(): ?string { return $this->recordType; } public function getMainType(): string { return $this->mainType; } public function toArray(bool $includeComputedProperties = false): array { $properties = ['uid' => $this->uid, 'pid' => $this->pid] + $this->properties; if ($includeComputedProperties) { $properties += ['_computed' => $this->computedProperties->toArray()]; } return $properties; } public function has(string $id): bool { return array_key_exists($id, $this->properties); } public function get(string $id): mixed { if (!$this->has($id)) { throw new RecordPropertyNotFoundException( 'Record property "' . $id . '" is not available.', 1725892140 ); } return $this->properties[$id] ?? null; } public function getComputedProperties(): ComputedProperties { return $this->computedProperties; } public function getRawRecord(): RawRecord { return $this; } /** * @return array{0?: string, 1?: string} */ protected function normalizeTypeParts(string $type): array { return array_filter( array_map(trim(...), explode('.', $type, 2)), static fn(string $part): bool => $part !== '' ); } }