You are here

public function application_manager::get_application in Apply for role 8

Helper function to get a singular application.

Parameters

int $aid:

Return value

object|bool Returns an application object or FALSE if no application

2 calls to application_manager::get_application()
application_manager::approve_application in src/application_manager.php
application_manager::deny_application in src/application_manager.php

File

src/application_manager.php, line 51
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_application($aid) {
  $select = Database::getConnection()
    ->select('apply_for_role_applications', 'a')
    ->fields('a');
  $select
    ->condition('a.aid', $aid);
  $db_app_data = $select
    ->execute()
    ->fetchAll(\PDO::FETCH_ASSOC);
  if (count($db_app_data) == 1) {
    return $this
      ->map_application_db_response_to_application($db_app_data[0]);
  }
  else {
    return FALSE;
  }
}