getHeaderAndFlags($id); $this->rawHeader = $data['header']; $this->flagList = $data['flags']; } $this->id = $id; $this->storage = $storage; $this->parser = $parser; } public function setFullRawContent($content) { $this->fullRawContent = $content; } public function getRawHeader() { return $this->rawHeader; } public function getParser() { return $this->parser; } public function checkAttribute($attribute) { return $this->getParser()->checkMessageAttribute($this, $attribute); } public function getAttribute($attribute) { return $this->getParser()->getMessageAttribute($this, $attribute); } public function getRawContent() { if (is_null($this->rawContent)) { $this->rawContent = $this->storage->getRawContent($this->id); } return $this->rawContent; } public function getFullRawContent() { if ($this->fullRawContent) { return $this->fullRawContent; } return $this->getRawHeader() . "\n" . $this->getRawContent(); } public function getZendMessage() { if (!$this->zendMessage) { if ($this->setFullRawContent) { $this->message = new $this->zendMessageClass([ 'handler' => $this->storage, 'raw' => $this->fullRawContent, 'flags' => $this->flagList ]); } else { $this->message = new $this->zendMessageClass([ 'handler' => $this->storage, 'id' => $this->id, 'headers' => $this->rawHeader, 'flags' => $this->flagList ]); } } return $this->message; } public function getFlags() { return $this->flagList; } public function isFetched() { return !!$this->rawHeader; } }