mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-15 21:58:41 +00:00
Employee preparation
This commit is contained in:
parent
b2e4070153
commit
dea6bd0e2e
|
|
@ -28,7 +28,7 @@ use Modules\Admin\Models\Account;
|
|||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Employee extends Account {
|
||||
class Employee {
|
||||
|
||||
/**
|
||||
* Employee ID.
|
||||
|
|
@ -36,73 +36,16 @@ class Employee extends Account {
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $employeeId = 0;
|
||||
private $id = 0;
|
||||
|
||||
public function getInstance($id)
|
||||
private $account = null;
|
||||
|
||||
public function setAccount(Account $account)
|
||||
{
|
||||
if (!isset(self::$instances[$id])) {
|
||||
self::$instances[$id] = new self($id);
|
||||
}
|
||||
|
||||
return self::$instances[$id];
|
||||
$this->account = $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init($id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
public function setUser($id)
|
||||
{
|
||||
$this->user = new User($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
// TODO: Implement serialize() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
// TODO: Implement unserialize() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
// TODO: Implement delete() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
// TODO: Implement create() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function update()
|
||||
{
|
||||
// TODO: Implement update() method.
|
||||
public function getAccount() : Account {
|
||||
return $this->account;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Modules\Admin\Models;
|
|||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
|
||||
class EmployeeMapper extends AccountMapper
|
||||
class EmployeeMapper
|
||||
{
|
||||
|
||||
/**
|
||||
|
|
@ -27,8 +27,24 @@ class EmployeeMapper extends AccountMapper
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static $columns = [
|
||||
'hr_staff_id' => ['name' => 'account_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'hr_staff' => ['name' => 'account_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'hr_staff_id' => ['name' => 'hr_staff_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'hr_staff' => ['name' => 'hr_staff', 'type' => 'int', 'internal' => 'account'],
|
||||
];
|
||||
|
||||
protected static $ownsOne = [
|
||||
'account' => [
|
||||
'mapper' => '\Modules\Admin\Models\AccountMapper',
|
||||
'src' => 'hr_staff',
|
||||
],
|
||||
];
|
||||
|
||||
protected static $hasMany = [
|
||||
'position' => [
|
||||
'mapper' => '',
|
||||
'table' => '',
|
||||
'src' => '',
|
||||
'dst' => '',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -46,12 +62,4 @@ class EmployeeMapper extends AccountMapper
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static $primaryField = 'hr_staff_id';
|
||||
|
||||
/**
|
||||
* Overwriting extended
|
||||
*
|
||||
* @var bool
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $overwrite = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user