Started to implement employee model

This commit is contained in:
Dennis Eichhorn 2016-02-21 10:09:54 +01:00
parent 74fa459cd1
commit b2e4070153
3 changed files with 60 additions and 20 deletions

View File

@ -45,7 +45,6 @@ class Installer extends InstallerAbstract
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'hr_staff` (
`hr_staff_id` int(11) NOT NULL AUTO_INCREMENT,
`hr_staff_status` tinyint(2) DEFAULT NULL,
`hr_staff_account` int(11) DEFAULT NULL,
PRIMARY KEY (`hr_staff_id`),
KEY `hr_staff_account` (`hr_staff_account`)

View File

@ -15,8 +15,7 @@
*/
namespace Modules\HumanResources\Models;
use phpOMS\Models\User\User;
use phpOMS\Pattern\Multition;
use Modules\Admin\Models\Account;
/**
* Employee class.
@ -29,8 +28,7 @@ use phpOMS\Pattern\Multition;
* @link http://orange-management.com
* @since 1.0.0
*/
class Employee implements Multition
{
class Employee extends Account {
/**
* Employee ID.
@ -38,21 +36,7 @@ class Employee implements Multition
* @var int
* @since 1.0.0
*/
private $id = null;
/**
* User.
*
* @var User
* @since 1.0.0
*/
private $user = null;
private static $instances = [];
public function __construct($id)
{
}
private $employeeId = 0;
public function getInstance($id)
{

57
Models/EmployeeMapper.php Normal file
View 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;
}