You are here

public function Campaigns::loadAll in SimpleAds 8

1 call to Campaigns::loadAll()
Campaigns::loadAsOptions in src/Campaigns.php

File

src/Campaigns.php, line 124

Class

Campaigns
Campaigns utility class.

Namespace

Drupal\simpleads

Code

public function loadAll() {
  $items = [];
  $result = db_select('simpleads_campaigns', 's')
    ->fields('s')
    ->orderBy('s.changed_at', 'DESC')
    ->execute();
  foreach ($result as $row) {
    $items[] = $this
      ->setId($row->id)
      ->load();
  }
  return $items;
}