[add] Listing of employee types

This commit is contained in:
2018-08-05 22:31:40 -06:00
parent 6b289695c7
commit 692f52b533
4 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Application;
class EmployeeApplication{
private $pdo;
private $cryptographyService;
private $asserts;
function __construct($mysql, $cryptographyService, $asserts){
$this->cryptographyService = $cryptographyService;
$this->pdo = $mysql;
$this->asserts = $asserts;
$this->databaseSelectQueryErrorMessage = 'There was an error inserting the record.';
}
function listEmployeeTypes(){
$stmt = $this->pdo->prepare("SELECT id, name FROM employeeType WHERE status = 'ACTIVE'");
$stmt->execute();
$results = $stmt->fetchAll();
if(!$results){
exit($this->databaseSelectQueryErrorMessage);
}
$stmt = null;
return $results;
}
}
?>