IMP_Compose::_getMessageTextCallback PHP Method

_getMessageTextCallback() public method

Callback used in _getMessageText().
public _getMessageTextCallback ( $id, $attribute, $node ) : string
return string Replacement text.
    public function _getMessageTextCallback($id, $attribute, $node)
    {
        if ($part = $this->getMetadata('related_contents')->getMimePart($id)) {
            $atc = $this->addAttachmentFromPart($part);
            $this->addRelatedAttachment($atc, $node, $attribute);
            return $atc->viewUrl();
        }
        return $node->getAttribute($attribute);
    }