CommentStorageInterface::loadThread

public CommentStorageInterface::loadThread(EntityInterface $entity, $field_name, $mode, $comments_per_page = 0, $pager_id = 0)

Retrieves comments for a thread, sorted in an order suitable for display.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity whose comment(s) needs rendering.

string $field_name: The field_name whose comment(s) needs rendering.

int $mode: The comment display mode: CommentManagerInterface::COMMENT_MODE_FLAT or CommentManagerInterface::COMMENT_MODE_THREADED.

int $comments_per_page: (optional) The amount of comments to display per page. Defaults to 0, which means show all comments.

int $pager_id: (optional) Pager id to use in case of multiple pagers on the one page. Defaults to 0; is only used when $comments_per_page is greater than zero.

Return value

array Ordered array of comment objects, keyed by comment id.

File

core/modules/comment/src/CommentStorageInterface.php, line 103

Class

CommentStorageInterface
Defines an interface for comment entity storage classes.

Namespace

Drupal\comment

Code

public function loadThread(EntityInterface $entity, $field_name, $mode, $comments_per_page = 0, $pager_id = 0);
doc_Drupal
2016-10-29 08:51:03
Comments
Leave a Comment

Please login to continue.