function CommentStorageInterface::getDisplayOrdinal
Same name in other branches
- 9 core/modules/comment/src/CommentStorageInterface.php \Drupal\comment\CommentStorageInterface::getDisplayOrdinal()
- 10 core/modules/comment/src/CommentStorageInterface.php \Drupal\comment\CommentStorageInterface::getDisplayOrdinal()
- 11.x core/modules/comment/src/CommentStorageInterface.php \Drupal\comment\CommentStorageInterface::getDisplayOrdinal()
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.
1 method overrides CommentStorageInterface::getDisplayOrdinal()
- CommentStorage::getDisplayOrdinal in core/
modules/ comment/ src/ CommentStorage.php - Gets the display ordinal or page number for a comment.
File
-
core/
modules/ comment/ src/ CommentStorageInterface.php, line 71
Class
- CommentStorageInterface
- Defines an interface for comment entity storage classes.
Namespace
Drupal\commentCode
public function getDisplayOrdinal(CommentInterface $comment, $comment_mode, $divisor = 1);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.