Xpressengine\Document\Models\Document::getReplyChar PHP Method

getReplyChar() protected method

get reply code
protected getReplyChar ( Document $parent ) : string
$parent Document Parent document model
return string
    protected function getReplyChar(Document $parent)
    {
        $lastReply = self::where('head', $parent->head)->where('reply', 'like', $parent->reply . str_repeat('_', self::$replyCharLen))->max('reply');
        $lastChar = null;
        if ($lastReply !== null) {
            $lastChar = substr($lastReply, -1 * self::getReplyCharLen());
        }
        return $parent->reply . $this->makeReplyChar($lastChar);
    }