CommentUserSignature.php in Display Suite 8.2
File
src/Plugin/DsField/Comment/CommentUserSignature.php
View source
<?php
namespace Drupal\ds\Plugin\DsField\Comment;
use Drupal\ds\Plugin\DsField\User\UserSignature;
use Drupal\user\Entity\User;
class CommentUserSignature extends UserSignature {
public function build() {
$comment = $this
->entity();
$user_id = $comment->uid->target_id;
$user = User::load($user_id);
$key = $this
->key();
if (isset($user->{$key}->value)) {
$format = $this
->format();
return array(
'#type' => 'processed_text',
'#text' => $user->{$key}->value,
'#format' => $user->{$format}->value,
'#filter_types_to_skip' => array(),
'#langcode' => '',
);
}
return array();
}
}