mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-11 10:28:41 +00:00
Started to implement employee model
This commit is contained in:
parent
74fa459cd1
commit
b2e4070153
|
|
@ -45,7 +45,6 @@ class Installer extends InstallerAbstract
|
||||||
$dbPool->get('core')->con->prepare(
|
$dbPool->get('core')->con->prepare(
|
||||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'hr_staff` (
|
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'hr_staff` (
|
||||||
`hr_staff_id` int(11) NOT NULL AUTO_INCREMENT,
|
`hr_staff_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`hr_staff_status` tinyint(2) DEFAULT NULL,
|
|
||||||
`hr_staff_account` int(11) DEFAULT NULL,
|
`hr_staff_account` int(11) DEFAULT NULL,
|
||||||
PRIMARY KEY (`hr_staff_id`),
|
PRIMARY KEY (`hr_staff_id`),
|
||||||
KEY `hr_staff_account` (`hr_staff_account`)
|
KEY `hr_staff_account` (`hr_staff_account`)
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,7 @@
|
||||||
*/
|
*/
|
||||||
namespace Modules\HumanResources\Models;
|
namespace Modules\HumanResources\Models;
|
||||||
|
|
||||||
use phpOMS\Models\User\User;
|
use Modules\Admin\Models\Account;
|
||||||
use phpOMS\Pattern\Multition;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employee class.
|
* Employee class.
|
||||||
|
|
@ -29,8 +28,7 @@ use phpOMS\Pattern\Multition;
|
||||||
* @link http://orange-management.com
|
* @link http://orange-management.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
class Employee implements Multition
|
class Employee extends Account {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employee ID.
|
* Employee ID.
|
||||||
|
|
@ -38,21 +36,7 @@ class Employee implements Multition
|
||||||
* @var int
|
* @var int
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $id = null;
|
private $employeeId = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* User.
|
|
||||||
*
|
|
||||||
* @var User
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private $user = null;
|
|
||||||
|
|
||||||
private static $instances = [];
|
|
||||||
|
|
||||||
public function __construct($id)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getInstance($id)
|
public function getInstance($id)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
57
Models/EmployeeMapper.php
Normal file
57
Models/EmployeeMapper.php
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.0
|
||||||
|
*
|
||||||
|
* @category TBD
|
||||||
|
* @package TBD
|
||||||
|
* @author OMS Development Team <dev@oms.com>
|
||||||
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
|
* @copyright 2013 Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://orange-management.com
|
||||||
|
*/
|
||||||
|
namespace Modules\Admin\Models;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||||
|
|
||||||
|
class EmployeeMapper extends AccountMapper
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Columns.
|
||||||
|
*
|
||||||
|
* @var array<string, array>
|
||||||
|
* @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'],
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary table.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected static $table = 'hr_staff';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Primary field name.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @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