Skip to content

Commit

Permalink
Applications: Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fet1sov authored Jun 4, 2024
1 parent 3a851df commit 1dfaf7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions www/backend/models/application.mdl.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public function __construct($id = 0, $applicationData = array()) {
}
}

/**
* Getting full list of applications from database
* @return array
*/
public static function getFullList() {
$stmt = $GLOBALS["dbAdapter"]->prepare("SELECT `applications`.*, `user`.`username` AS `user_author`, `manager_user`.`username` AS `user_manager`, `application_statuses`.`name` AS `status_name` FROM `applications` LEFT JOIN `application_statuses` ON `applications`.`status` = `application_statuses`.`id` INNER JOIN `user` ON `applications`.`author_id` = `user`.`id` LEFT JOIN `user` manager_user ON `applications`.`manager_id`=`manager_user`.`id`");
$stmt->execute();
Expand Down Expand Up @@ -128,6 +132,7 @@ public function setStatus($statusID) : void

/**
* Getting current status information
* @return array
*/
public function getStatus() : ?array {
$stmt = $GLOBALS["dbAdapter"]->prepare("SELECT * FROM `application_statuses` WHERE `id`=?");
Expand All @@ -141,6 +146,7 @@ public function getStatus() : ?array {
/**
* Static method which returns
* All status list
* @return array
*/
public static function getStatusList() : ?array
{
Expand All @@ -159,6 +165,7 @@ public static function getStatusList() : ?array

/**
* Getting all user data by author indetifier (id)
* @return array
*/
public function getAuthorInfo() : ?array {
$stmt = $GLOBALS["dbAdapter"]->prepare("SELECT * FROM `user` WHERE `id`=?");
Expand All @@ -171,6 +178,7 @@ public function getAuthorInfo() : ?array {

/**
* Getting all user data by manager indetifier (id)
* @return array
*/
public function getManagerInfo() : ?array {
$stmt = $GLOBALS["dbAdapter"]->prepare("SELECT * FROM `user` WHERE `id`=?");
Expand Down

0 comments on commit 1dfaf7f

Please sign in to comment.