CommentStorageInterface::getDisplayOrdinal

public CommentStorageInterface::getDisplayOrdinal(CommentInterface $comment, $comment_mode, $divisor = 1)

Gets the display ordinal or page number for a comment.

Parameters

\Drupal\comment\CommentInterface $comment: The comment to use as a reference point.

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

int $divisor: Defaults to 1, which returns the display ordinal for a comment. If the number of comments per page is provided, the returned value will be the page number. (The return value will be divided by $divisor.)

Return value

int The display ordinal or page number for the comment. It is 0-based, so will represent the number of items before the given comment/page.

File

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

Class

CommentStorageInterface
Defines an interface for comment entity storage classes.

Namespace

Drupal\comment

Code

public function getDisplayOrdinal(CommentInterface $comment, $comment_mode, $divisor = 1);
doc_Drupal
2016-10-29 08:51:02
Comments
Leave a Comment

Please login to continue.