You are here

protected function AnonymousPublishingClAdminSpam::getAllSpamContents in Anonymous Publishing 8

Get all contents to moderate.

Parameters

int $test_id: The test_id to retrieve results of.

Return value

array Array of results grouped by test_class.

1 call to AnonymousPublishingClAdminSpam::getAllSpamContents()
AnonymousPublishingClAdminSpam::buildForm in modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminSpam.php
Form constructor.

File

modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminSpam.php, line 240

Class

AnonymousPublishingClAdminSpam

Namespace

Drupal\anonymous_publishing_cl\Form

Code

protected function getAllSpamContents() {
  $query = $this->database
    ->select('anonymous_publishing_bots', 'a');
  $query
    ->fields('a');
  if (\Drupal::moduleHandler()
    ->moduleExists('ban')) {
    $query
      ->join('ban_ip', 'b', 'a.ip = b.ip');
  }
  $query
    ->orderBy('a.visits');
  $query
    ->range(0, 10);
  return $query
    ->execute()
    ->fetchAll();
}