add todos from github

This commit is contained in:
Dennis Eichhorn 2019-12-31 19:54:45 +01:00
parent 757dc81e2d
commit 40258fc10b
3 changed files with 9 additions and 21 deletions

View File

@ -259,8 +259,7 @@ final class ApiController extends Controller
*/ */
private function createEmployeeHistoryFromRequest(RequestAbstract $request) : EmployeeHistory private function createEmployeeHistoryFromRequest(RequestAbstract $request) : EmployeeHistory
{ {
$history = new EmployeeHistory(); $history = new EmployeeHistory((int) ($request->getData('employee') ?? 0));
$history->setEmployee((int) ($request->getData('employee') ?? 0));
$history->setUnit((int) ($request->getData('unit') ?? 0)); $history->setUnit((int) ($request->getData('unit') ?? 0));
$history->setDepartment((int) ($request->getData('department') ?? 0)); $history->setDepartment((int) ($request->getData('department') ?? 0));
$history->setPosition((int) ($request->getData('position') ?? 0)); $history->setPosition((int) ($request->getData('position') ?? 0));

View File

@ -62,7 +62,8 @@ class Employee implements ArrayableInterface, \JsonSerializable
/** /**
* Employee education history. * Employee education history.
* *
* @todo: implement! * @todo Orange-Management/Modules#187
* Implement the education history for an employee. This can be done similarly to the company history.
* *
* @var array * @var array
* @since 1.0.0 * @since 1.0.0
@ -72,6 +73,9 @@ class Employee implements ArrayableInterface, \JsonSerializable
/** /**
* Employee external work history. * Employee external work history.
* *
* @todo Orange-Management/Modules#188
* Implement the work history (at other companies) for an employee. This can be done similarly to the company history.
*
* @var array * @var array
* @since 1.0.0 * @since 1.0.0
*/ */

View File

@ -94,9 +94,10 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct() public function __construct($employee = 0)
{ {
$this->start = new \DateTime('now'); $this->employee = $employee;
$this->start = new \DateTime('now');
} }
/** /**
@ -123,22 +124,6 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
return empty($this->employee) ? new NullEmployee() : $this->employee; return empty($this->employee) ? new NullEmployee() : $this->employee;
} }
/**
* Set the employee
*
* @param int|Employee $employee Employee
*
* @return void
*
* @todo maybe only do this in the constructor
*
* @since 1.0.0
*/
public function setEmployee($employee) : void
{
$this->employee = $employee;
}
/** /**
* Get the position * Get the position
* *