mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-12 19:08:41 +00:00
autofixes
This commit is contained in:
parent
93e6d2175c
commit
0f8d2553f9
|
|
@ -184,13 +184,13 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function createEmployeeNewFromRequest(RequestAbstract $request) : Employee
|
private function createEmployeeNewFromRequest(RequestAbstract $request) : Employee
|
||||||
{
|
{
|
||||||
$account = new Account();
|
$account = new Account();
|
||||||
$account->name1 = (string) ($request->getData('name1') ?? '');
|
$account->name1 = (string) ($request->getData('name1') ?? '');
|
||||||
$account->name2 = (string) ($request->getData('name2') ?? '');
|
$account->name2 = (string) ($request->getData('name2') ?? '');
|
||||||
$account->name3 = (string) ($request->getData('name3') ?? '');
|
$account->name3 = (string) ($request->getData('name3') ?? '');
|
||||||
$account->name3 = (string) ($request->getData('email') ?? '');
|
$account->name3 = (string) ($request->getData('email') ?? '');
|
||||||
|
|
||||||
$profile = new Profile($account);
|
$profile = new Profile($account);
|
||||||
$profile->birthday = new \DateTime((string) ($request->getData('birthday') ?? 'now'));
|
$profile->birthday = new \DateTime((string) ($request->getData('birthday') ?? 'now'));
|
||||||
|
|
||||||
$employee = new Employee($profile);
|
$employee = new Employee($profile);
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ declare(strict_types=1);
|
||||||
namespace Modules\HumanResourceManagement\Models;
|
namespace Modules\HumanResourceManagement\Models;
|
||||||
|
|
||||||
use Modules\Admin\Models\AccountMapper;
|
use Modules\Admin\Models\AccountMapper;
|
||||||
|
use Modules\Media\Models\MediaMapper;
|
||||||
use Modules\Profile\Models\ProfileMapper;
|
use Modules\Profile\Models\ProfileMapper;
|
||||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||||
use phpOMS\DataStorage\Database\Query\Builder;
|
use phpOMS\DataStorage\Database\Query\Builder;
|
||||||
use Modules\Media\Models\MediaMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employe mapper class.
|
* Employe mapper class.
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Modules\HumanResourceManagement\Models\NullEmployeeHistory;
|
||||||
use Modules\Media\Models\NullMedia;
|
use Modules\Media\Models\NullMedia;
|
||||||
use phpOMS\Uri\UriFactory;
|
use phpOMS\Uri\UriFactory;
|
||||||
use Modules\HumanResourceManagement\Models\NullEmployeeHistory;
|
|
||||||
|
|
||||||
$employee = $this->getData('employee');
|
$employee = $this->getData('employee');
|
||||||
$history = $employee->getHistorY();
|
$history = $employee->getHistorY();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class EmployeeMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
if (($profile = ProfileMapper::getFor(1, 'account'))->getId() === 0) {
|
if (($profile = ProfileMapper::getFor(1, 'account'))->getId() === 0) {
|
||||||
$profile = new Profile();
|
$profile = new Profile();
|
||||||
|
|
||||||
$profile->account = AccountMapper::get(1);
|
$profile->account = AccountMapper::get(1);
|
||||||
$profile->birthday = ($date = new \DateTime('now'));
|
$profile->birthday = ($date = new \DateTime('now'));
|
||||||
|
|
||||||
$id = ProfileMapper::create($profile);
|
$id = ProfileMapper::create($profile);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user