mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-11 12:28:39 +00:00
use direct data access for response data
This commit is contained in:
parent
6a5aed8079
commit
cc92c59281
|
|
@ -85,7 +85,7 @@ final class ApiController extends Controller
|
|||
public function apiEmployeeFromAccountCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateEmployeeFromAccountCreate($request))) {
|
||||
$response->set('employee_create', new FormValidation($val));
|
||||
$response->data['employee_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -154,7 +154,7 @@ final class ApiController extends Controller
|
|||
public function apiEmployeeNewCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateEmployeeNewCreate($request))) {
|
||||
$response->set('employee_create', new FormValidation($val));
|
||||
$response->data['employee_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -225,7 +225,7 @@ final class ApiController extends Controller
|
|||
public function apiEmployeeHistoryCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateEmployeeHistoryCreate($request))) {
|
||||
$response->set('history_create', new FormValidation($val));
|
||||
$response->data['history_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -297,7 +297,7 @@ final class ApiController extends Controller
|
|||
public function apiEmployeeWorkHistoryCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateEmployeeWorkHistoryCreate($request))) {
|
||||
$response->set('history_work_create', new FormValidation($val));
|
||||
$response->data['history_work_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -373,7 +373,7 @@ final class ApiController extends Controller
|
|||
public function apiEmployeeEducationHistoryCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateEmployeeEducationHistoryCreate($request))) {
|
||||
$response->set('history_education_create', new FormValidation($val));
|
||||
$response->data['history_education_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -53,14 +53,6 @@ class Employee implements \JsonSerializable
|
|||
*/
|
||||
public $image = null;
|
||||
|
||||
/**
|
||||
* Files.
|
||||
*
|
||||
* @var Media[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $files = [];
|
||||
|
||||
/**
|
||||
* Employee department/position history.
|
||||
*
|
||||
|
|
@ -163,18 +155,6 @@ class Employee implements \JsonSerializable
|
|||
return \hash_equals($this->semiPrivateHash, $hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
*
|
||||
* @return Media[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFiles() : array
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get media file by type
|
||||
*
|
||||
|
|
@ -350,4 +330,6 @@ class Employee implements \JsonSerializable
|
|||
{
|
||||
return $this->toArray();
|
||||
}
|
||||
|
||||
use \Modules\Media\Models\MediaListTrait;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,14 +52,6 @@ class EmployeeEducationHistory implements \JsonSerializable
|
|||
|
||||
public string $score = '';
|
||||
|
||||
/**
|
||||
* Files.
|
||||
*
|
||||
* @var Media[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $files = [];
|
||||
|
||||
/**
|
||||
* Start date
|
||||
*
|
||||
|
|
@ -102,18 +94,6 @@ class EmployeeEducationHistory implements \JsonSerializable
|
|||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
*
|
||||
* @return Media[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFiles() : array
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get media file by type
|
||||
*
|
||||
|
|
@ -177,4 +157,6 @@ class EmployeeEducationHistory implements \JsonSerializable
|
|||
{
|
||||
return $this->toArray();
|
||||
}
|
||||
|
||||
use \Modules\Media\Models\MediaListTrait;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,14 +73,6 @@ class EmployeeHistory implements \JsonSerializable
|
|||
*/
|
||||
public Position $position;
|
||||
|
||||
/**
|
||||
* Files.
|
||||
*
|
||||
* @var Media[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $files = [];
|
||||
|
||||
/**
|
||||
* Start date
|
||||
*
|
||||
|
|
@ -125,18 +117,6 @@ class EmployeeHistory implements \JsonSerializable
|
|||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
*
|
||||
* @return Media[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFiles() : array
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get media file by type
|
||||
*
|
||||
|
|
@ -200,4 +180,6 @@ class EmployeeHistory implements \JsonSerializable
|
|||
{
|
||||
return $this->toArray();
|
||||
}
|
||||
|
||||
use \Modules\Media\Models\MediaListTrait;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,14 +48,6 @@ class EmployeeWorkHistory implements \JsonSerializable
|
|||
|
||||
public string $jobTitle = '';
|
||||
|
||||
/**
|
||||
* Files.
|
||||
*
|
||||
* @var Media[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private array $files = [];
|
||||
|
||||
/**
|
||||
* Start date
|
||||
*
|
||||
|
|
@ -98,18 +90,6 @@ class EmployeeWorkHistory implements \JsonSerializable
|
|||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
*
|
||||
* @return Media[]
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFiles() : array
|
||||
{
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get media file by type
|
||||
*
|
||||
|
|
@ -171,4 +151,6 @@ class EmployeeWorkHistory implements \JsonSerializable
|
|||
{
|
||||
return $this->toArray();
|
||||
}
|
||||
|
||||
use \Modules\Media\Models\MediaListTrait;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user