protected function CommentStorageController::attachLoad

Overrides Drupal\Core\Entity\DatabaseStorageController::attachLoad().

Overrides DatabaseStorageController::attachLoad

File

drupal/core/modules/comment/lib/Drupal/comment/CommentStorageController.php, line 44
Definition of Drupal\comment\CommentStorageController.

Class

CommentStorageController
Defines the controller class for comments.

Namespace

Drupal\comment

Code

protected function attachLoad(&$comments, $load_revision = FALSE) {

  // Set up standard comment properties.
  foreach ($comments as $key => $comment) {
    $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
    $comment->new = node_mark($comment->nid, $comment->changed);
    $comment->node_type = 'comment_node_' . $comment->node_type;
    $comments[$key] = $comment;
  }
  parent::attachLoad($comments, $load_revision);
}