getHeaderAndFlags($id); $this->rawHeader = $data['header']; $this->flagList = $data['flags']; } $this->id = $id; $this->storage = $storage; $this->parser = $parser; $this->fullRawContent = $fullRawContent; } public function getRawHeader(): string { return $this->rawHeader ?? ''; } public function getParser(): ?Parser { return $this->parser; } public function hasHeader(string $name): bool { return $this->getParser()->hasHeader($this, $name); } public function getHeader(string $attribute): ?string { return $this->getParser()->getHeader($this, $attribute); } public function getRawContent(): string { if (is_null($this->rawContent)) { $this->rawContent = $this->storage->getRawContent($this->id); } return $this->rawContent ?? ''; } public function getFullRawContent(): string { if ($this->fullRawContent) { return $this->fullRawContent; } return $this->getRawHeader() . "\n" . $this->getRawContent(); } public function getFlags(): array { return $this->flagList ?? []; } public function isFetched(): bool { return (bool) $this->rawHeader; } }