You are here

public function application_manager::get_all_applications in Apply for role 8

Helper function that gets all applications for all time.

File

src/application_manager.php, line 31
Contains two classes.

Class

application_manager
Application manager object used for performing any tasks relating to applications.

Namespace

Drupal\apply_for_role

Code

public function get_all_applications() {
  $select = Database::getConnection()
    ->select('apply_for_role_applications', 'a')
    ->fields('a');

  // Make this return an array of application objects?
  $db_apps = $select
    ->execute()
    ->fetchAll(\PDO::FETCH_ASSOC);
  $user_applications = array();
  foreach ($db_apps as $db_app) {
    $user_applications[] = $this
      ->map_application_db_response_to_application($db_app);
  }
  return $user_applications;
}