[add] Listing of employee types
This commit is contained in:
31
api-payroll/src/application/EmployeeApplication.php
Normal file
31
api-payroll/src/application/EmployeeApplication.php
Normal 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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user