You are here

public function Ads::loadAll in SimpleAds 8

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

File

src/Ads.php, line 144

Class

Ads
Ads utility class.

Namespace

Drupal\simpleads

Code

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