You are here

protected function CommentThread::sortThread in Comment Delete 8

Sorts associative array of comments by creation time.

Parameters

array $a: The left comment.

array $b: The right comment.

Return value

int The sorting integer.

File

src/CommentThread.php, line 131

Class

CommentThread
Service container for comment thread calculations.

Namespace

Drupal\comment_delete

Code

protected function sortThread(array $a, array $b) {
  if ($a['created'] == $b['created']) {
    return 0;
  }
  return $a['created'] < $b['created'] ? -1 : 1;
}