diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 0a4a616..f3606d2 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -16,13 +16,13 @@ namespace Modules\HumanResourceManagement\Controller; use Modules\Admin\Models\Account; use Modules\HumanResourceManagement\Models\Employee; -use Modules\HumanResourceManagement\Models\EmployeeHistory; -use Modules\HumanResourceManagement\Models\EmployeeHistoryMapper; use Modules\HumanResourceManagement\Models\EmployeeEducationHistory; use Modules\HumanResourceManagement\Models\EmployeeEducationHistoryMapper; +use Modules\HumanResourceManagement\Models\EmployeeHistory; +use Modules\HumanResourceManagement\Models\EmployeeHistoryMapper; +use Modules\HumanResourceManagement\Models\EmployeeMapper; use Modules\HumanResourceManagement\Models\EmployeeWorkHistory; use Modules\HumanResourceManagement\Models\EmployeeWorkHistoryMapper; -use Modules\HumanResourceManagement\Models\EmployeeMapper; use Modules\Profile\Models\Profile; use Modules\Profile\Models\ProfileMapper; use phpOMS\Message\Http\RequestStatusCode; @@ -344,12 +344,12 @@ final class ApiController extends Controller { $history = new EmployeeWorkHistory((int) ($request->getData('employee') ?? 0)); $history->setStart(new \DateTime($request->getData('start') ?? 'now')); - $history->jobTitle = $request->getData('title'); - $history->address->name = $request->getData('name'); + $history->jobTitle = $request->getData('title'); + $history->address->name = $request->getData('name'); $history->address->address = $request->getData('address') ?? ''; - $history->address->postal = $request->getData('postal') ?? ''; - $history->address->city = $request->getData('city') ?? ''; - $history->address->state = $request->getData('state') ?? ''; + $history->address->postal = $request->getData('postal') ?? ''; + $history->address->city = $request->getData('city') ?? ''; + $history->address->state = $request->getData('state') ?? ''; $history->address->setCountry($request->getData('country') ?? ''); $history->address->setType(AddressType::WORK); @@ -423,14 +423,14 @@ final class ApiController extends Controller { $history = new EmployeeEducationHistory((int) ($request->getData('employee') ?? 0)); $history->setStart(new \DateTime($request->getData('start') ?? 'now')); - $history->educationTitle = $request->getData('title'); - $history->score = $request->getData('score') ?? ''; - $history->passed = (bool) ($request->getData('passed') ?? true); - $history->address->name = $request->getData('name'); + $history->educationTitle = $request->getData('title'); + $history->score = $request->getData('score') ?? ''; + $history->passed = (bool) ($request->getData('passed') ?? true); + $history->address->name = $request->getData('name'); $history->address->address = $request->getData('address') ?? ''; - $history->address->postal = $request->getData('postal') ?? ''; - $history->address->city = $request->getData('city') ?? ''; - $history->address->state = $request->getData('state') ?? ''; + $history->address->postal = $request->getData('postal') ?? ''; + $history->address->city = $request->getData('city') ?? ''; + $history->address->state = $request->getData('state') ?? ''; $history->address->setCountry($request->getData('country') ?? ''); $history->address->setType(AddressType::EDUCATION); diff --git a/Models/EmployeeEducationHistory.php b/Models/EmployeeEducationHistory.php index 3e2ce49..d942938 100755 --- a/Models/EmployeeEducationHistory.php +++ b/Models/EmployeeEducationHistory.php @@ -14,9 +14,9 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Models; -use phpOMS\Contract\ArrayableInterface; use Modules\Admin\Models\Address; use Modules\Media\Models\Media; +use phpOMS\Contract\ArrayableInterface; /** * Employee class. @@ -87,7 +87,7 @@ class EmployeeEducationHistory implements \JsonSerializable, ArrayableInterface { $this->employee = $employee; $this->start = new \DateTime('now'); - $this->address = new Address(); + $this->address = new Address(); } /** diff --git a/Models/EmployeeEducationHistoryMapper.php b/Models/EmployeeEducationHistoryMapper.php index f0e5171..8e447cd 100644 --- a/Models/EmployeeEducationHistoryMapper.php +++ b/Models/EmployeeEducationHistoryMapper.php @@ -14,8 +14,8 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Models; -use phpOMS\DataStorage\Database\DataMapperAbstract; use Modules\Media\Models\MediaMapper; +use phpOMS\DataStorage\Database\DataMapperAbstract; /** * EmployeHistory mapper class. @@ -34,14 +34,14 @@ final class EmployeeEducationHistoryMapper extends DataMapperAbstract * @since 1.0.0 */ protected static array $columns = [ - 'hr_staff_education_history_id' => ['name' => 'hr_staff_education_history_id', 'type' => 'int', 'internal' => 'id'], - 'hr_staff_education_history_staff' => ['name' => 'hr_staff_education_history_staff', 'type' => 'int', 'internal' => 'employee'], + 'hr_staff_education_history_id' => ['name' => 'hr_staff_education_history_id', 'type' => 'int', 'internal' => 'id'], + 'hr_staff_education_history_staff' => ['name' => 'hr_staff_education_history_staff', 'type' => 'int', 'internal' => 'employee'], 'hr_staff_education_history_address' => ['name' => 'hr_staff_education_history_address', 'type' => 'Serializable', 'internal' => 'address'], - 'hr_staff_education_history_title' => ['name' => 'hr_staff_education_history_title', 'type' => 'string', 'internal' => 'educationTitle'], - 'hr_staff_education_history_passed' => ['name' => 'hr_staff_education_history_passed', 'type' => 'bool', 'internal' => 'passed'], - 'hr_staff_education_history_score' => ['name' => 'hr_staff_education_history_score', 'type' => 'string', 'internal' => 'score'], - 'hr_staff_education_history_start' => ['name' => 'hr_staff_education_history_start', 'type' => 'DateTime', 'internal' => 'start'], - 'hr_staff_education_history_end' => ['name' => 'hr_staff_education_history_end', 'type' => 'DateTime', 'internal' => 'end'], + 'hr_staff_education_history_title' => ['name' => 'hr_staff_education_history_title', 'type' => 'string', 'internal' => 'educationTitle'], + 'hr_staff_education_history_passed' => ['name' => 'hr_staff_education_history_passed', 'type' => 'bool', 'internal' => 'passed'], + 'hr_staff_education_history_score' => ['name' => 'hr_staff_education_history_score', 'type' => 'string', 'internal' => 'score'], + 'hr_staff_education_history_start' => ['name' => 'hr_staff_education_history_start', 'type' => 'DateTime', 'internal' => 'start'], + 'hr_staff_education_history_end' => ['name' => 'hr_staff_education_history_end', 'type' => 'DateTime', 'internal' => 'end'], ]; /** diff --git a/Models/EmployeeHistory.php b/Models/EmployeeHistory.php index 7aad680..203c90a 100755 --- a/Models/EmployeeHistory.php +++ b/Models/EmployeeHistory.php @@ -14,6 +14,7 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Models; +use Modules\Media\Models\Media; use Modules\Organization\Models\Department; use Modules\Organization\Models\NullDepartment; use Modules\Organization\Models\NullPosition; @@ -21,7 +22,6 @@ use Modules\Organization\Models\NullUnit; use Modules\Organization\Models\Position; use Modules\Organization\Models\Unit; use phpOMS\Contract\ArrayableInterface; -use Modules\Media\Models\Media; /** * Employee class. diff --git a/Models/EmployeeHistoryMapper.php b/Models/EmployeeHistoryMapper.php index f147054..0620731 100755 --- a/Models/EmployeeHistoryMapper.php +++ b/Models/EmployeeHistoryMapper.php @@ -14,11 +14,11 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Models; +use Modules\Media\Models\MediaMapper; use Modules\Organization\Models\DepartmentMapper; use Modules\Organization\Models\PositionMapper; use Modules\Organization\Models\UnitMapper; use phpOMS\DataStorage\Database\DataMapperAbstract; -use Modules\Media\Models\MediaMapper; /** * EmployeHistory mapper class. diff --git a/Models/EmployeeWorkHistory.php b/Models/EmployeeWorkHistory.php index 79cfb3a..eacc652 100755 --- a/Models/EmployeeWorkHistory.php +++ b/Models/EmployeeWorkHistory.php @@ -14,9 +14,9 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Models; -use phpOMS\Contract\ArrayableInterface; use Modules\Admin\Models\Address; use Modules\Media\Models\Media; +use phpOMS\Contract\ArrayableInterface; /** * Employee class. @@ -83,7 +83,7 @@ class EmployeeWorkHistory implements \JsonSerializable, ArrayableInterface { $this->employee = $employee; $this->start = new \DateTime('now'); - $this->address = new Address(); + $this->address = new Address(); } /** diff --git a/Models/EmployeeWorkHistoryMapper.php b/Models/EmployeeWorkHistoryMapper.php index f7c3335..ae6a65f 100644 --- a/Models/EmployeeWorkHistoryMapper.php +++ b/Models/EmployeeWorkHistoryMapper.php @@ -14,8 +14,8 @@ declare(strict_types=1); namespace Modules\HumanResourceManagement\Models; -use phpOMS\DataStorage\Database\DataMapperAbstract; use Modules\Media\Models\MediaMapper; +use phpOMS\DataStorage\Database\DataMapperAbstract; /** * EmployeHistory mapper class. @@ -34,12 +34,12 @@ final class EmployeeWorkHistoryMapper extends DataMapperAbstract * @since 1.0.0 */ protected static array $columns = [ - 'hr_staff_work_history_id' => ['name' => 'hr_staff_work_history_id', 'type' => 'int', 'internal' => 'id'], - 'hr_staff_work_history_staff' => ['name' => 'hr_staff_work_history_staff', 'type' => 'int', 'internal' => 'employee'], + 'hr_staff_work_history_id' => ['name' => 'hr_staff_work_history_id', 'type' => 'int', 'internal' => 'id'], + 'hr_staff_work_history_staff' => ['name' => 'hr_staff_work_history_staff', 'type' => 'int', 'internal' => 'employee'], 'hr_staff_work_history_address' => ['name' => 'hr_staff_work_history_address', 'type' => 'Serializable', 'internal' => 'address'], - 'hr_staff_work_history_title' => ['name' => 'hr_staff_work_history_title', 'type' => 'string', 'internal' => 'jobTitle'], - 'hr_staff_work_history_start' => ['name' => 'hr_staff_work_history_start', 'type' => 'DateTime', 'internal' => 'start'], - 'hr_staff_work_history_end' => ['name' => 'hr_staff_work_history_end', 'type' => 'DateTime', 'internal' => 'end'], + 'hr_staff_work_history_title' => ['name' => 'hr_staff_work_history_title', 'type' => 'string', 'internal' => 'jobTitle'], + 'hr_staff_work_history_start' => ['name' => 'hr_staff_work_history_start', 'type' => 'DateTime', 'internal' => 'start'], + 'hr_staff_work_history_end' => ['name' => 'hr_staff_work_history_end', 'type' => 'DateTime', 'internal' => 'end'], ]; /**