|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is a part of "Axessors" library. |
|
4
|
|
|
* |
|
5
|
|
|
* @author <[email protected]> |
|
6
|
|
|
* @package NoOne4rever\Axessors |
|
7
|
|
|
* @license GPL |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace NoOne4rever\Axessors\Examples; |
|
11
|
|
|
|
|
12
|
|
|
use NoOne4rever\Axessors\Axessors; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Class Employee. |
|
16
|
|
|
* |
|
17
|
|
|
* Stores information about employee. |
|
18
|
|
|
* |
|
19
|
|
|
* @method void deleteRoom(Room $room) deletes employee's room |
|
20
|
|
|
* @method void deletePastPosition(PastPosition $pastPosition) deletes past position |
|
21
|
|
|
* @method string getPosition() getter for position |
|
22
|
|
|
* @method IdCard getIdCard() getter for id card |
|
23
|
|
|
* @method Room[] getRoom() getter for rooms |
|
24
|
|
|
* @method Departament getDepartament() getter for departament |
|
25
|
|
|
* @method PastPosition[] getPastPosition() getter for past positions |
|
26
|
|
|
* @method void setPosition(string $position) setter for position |
|
27
|
|
|
* @method void setIdCard(IdCard $idCard) setter for id card |
|
28
|
|
|
* @method void addRoom(Room $room) setter for room |
|
29
|
|
|
* @method void setPastPosition(PastPosition $position) setter for past position |
|
30
|
|
|
*/ |
|
31
|
|
|
class Employee extends Man |
|
32
|
|
|
{ |
|
33
|
|
|
use Axessors; |
|
34
|
|
|
|
|
35
|
|
|
/** @var string employee's position */ |
|
36
|
|
|
private $position; #> +axs string >> `$this->addPastPosition(new :PastPosition($this->position, $this->departament))` |
|
37
|
|
|
/** @var IdCard employee's id card */ |
|
38
|
|
|
private $idCard; #> +axs IdCard |
|
39
|
|
|
/** @var Room[] rooms */ |
|
40
|
|
|
private $room = []; #> +axs Array[Room] |
|
41
|
|
|
/** @var Departament employee's departament */ |
|
42
|
|
|
private $departament; #> +axs Departament |
|
43
|
|
|
/** @var PastPosition[] past positions */ |
|
44
|
|
|
private $pastPosition = []; #> +axs Array[PastPosition] |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Employee constructor. |
|
48
|
|
|
* |
|
49
|
|
|
* @param string $name name |
|
50
|
|
|
* @param string $surname second name |
|
51
|
|
|
* @param string $position employee's position |
|
52
|
|
|
* @param Departament $departament departament |
|
53
|
|
|
*/ |
|
54
|
|
|
public function __construct(string $name, string $surname, string $position, Departament $departament) |
|
55
|
|
|
{ |
|
56
|
|
|
parent::__construct($name, $surname); |
|
57
|
|
|
$this->position = $position; |
|
58
|
|
|
$this->departament = $departament; |
|
59
|
|
|
} |
|
60
|
|
|
} |