You are here

private function EvaluationImplementation::upgradeCheckCommentData in Drupal 8 upgrade evaluation 7

Same name and namespace in other branches
  1. 6 includes/EvaluationImplementation.php \Upgrade_check\EvaluationImplementation::upgradeCheckCommentData()

Fetch comment data.

File

includes/EvaluationImplementation.php, line 377

Class

EvaluationImplementation

Namespace

Upgrade_check

Code

private function upgradeCheckCommentData() {
  $result = array();
  $param = array(
    't' => 'comment',
    'a' => 'c',
    'f' => array(
      'cid',
      'pid',
    ),
  );
  $comments = $this
    ->generateSql($param);
  foreach ($comments as $comment) {
    $key = !empty($comment->pid) ? 'children_comments' : 'parent_comments';
    if (empty($result[$key])) {
      $result[$key] = 1;
    }
    else {
      ++$result[$key];
    }
  }
  return $result;
}