public function CommentStorage::getMaxThread in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/comment/src/CommentStorage.php \Drupal\comment\CommentStorage::getMaxThread()
Gets the maximum encoded thread value for the top level comments.
Parameters
\Drupal\comment\CommentInterface $comment: A comment entity.
Return value
string The maximum encoded thread value among the top level comments of the node $comment belongs to.
Overrides CommentStorageInterface::getMaxThread
File
- core/
modules/ comment/ src/ CommentStorage.php, line 74 - Contains \Drupal\comment\CommentStorage.
Class
- CommentStorage
- Defines the controller class for comments.
Namespace
Drupal\commentCode
public function getMaxThread(CommentInterface $comment) {
$query = $this->database
->select('comment_field_data', 'c')
->condition('entity_id', $comment
->getCommentedEntityId())
->condition('field_name', $comment
->getFieldName())
->condition('entity_type', $comment
->getCommentedEntityTypeId())
->condition('default_langcode', 1);
$query
->addExpression('MAX(thread)', 'thread');
return $query
->execute()
->fetchField();
}